本文整理汇总了C++中AnalysisResultPtr::getIncludeLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::getIncludeLevel方法的具体用法?C++ AnalysisResultPtr::getIncludeLevel怎么用?C++ AnalysisResultPtr::getIncludeLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::getIncludeLevel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: analyzeProgramImpl
void InterfaceStatement::analyzeProgramImpl(AnalysisResultPtr ar) {
ClassScopeRawPtr classScope = getClassScope();
if (m_stmt) {
classScope->setIncludeLevel(ar->getIncludeLevel());
m_stmt->analyzeProgram(ar);
}
ar->recordClassSource(m_name, m_loc, getFileScope()->getName());
checkVolatile(ar);
if (ar->getPhase() != AnalysisResult::AnalyzeAll) return;
vector<string> bases;
if (m_base) m_base->getStrings(bases);
for (unsigned int i = 0; i < bases.size(); i++) {
addUserClass(ar, bases[i]);
ClassScopePtr cls = ar->findClass(bases[i]);
if (cls) {
if (!cls->isInterface()) {
Compiler::Error(Compiler::InvalidDerivation, shared_from_this(),
cls->getOriginalName());
}
if (cls->isUserClass()) {
cls->addUse(classScope, BlockScope::UseKindParentRef);
}
}
}
}
示例2: analyzeProgramImpl
void MethodStatement::analyzeProgramImpl(AnalysisResultPtr ar) {
FunctionScopePtr funcScope = m_funcScope.lock();
if (ar->isAnalyzeInclude()) {
if (funcScope->isSepExtension() ||
BuiltinSymbols::IsDeclaredDynamic(m_name) ||
Option::IsDynamicFunction(m_method, m_name) || Option::AllDynamic) {
funcScope->setDynamic();
}
}
funcScope->setIncludeLevel(ar->getIncludeLevel());
if (m_params) {
m_params->analyzeProgram(ar);
if (Option::GenRTTIProfileData &&
ar->getPhase() == AnalysisResult::AnalyzeFinal) {
addParamRTTI(ar);
}
}
if (m_stmt) m_stmt->analyzeProgram(ar);
if (ar->isAnalyzeInclude()) {
if (!funcScope->isStatic() && getClassScope() &&
funcScope->getVariables()->
getAttribute(VariableTable::ContainsDynamicVariable)) {
// Add this to variable table if we'll need it in a lookup table
// Use object because there's no point to specializing, just makes
// code gen harder when dealing with redeclared classes.
TypePtr tp(Type::Object);
funcScope->getVariables()->add("this", tp, true, ar, shared_from_this(),
ModifierExpressionPtr());
}
FunctionScope::RecordRefParamInfo(m_name, funcScope);
}
}
示例3: analyzeProgramImpl
void MethodStatement::analyzeProgramImpl(AnalysisResultPtr ar) {
FunctionScopePtr funcScope = m_funcScope.lock();
// registering myself as a parent in dependency graph, so that
// (1) we can tell orphaned parents
// (2) overwrite non-master copy of function declarations
if (ar->isFirstPass()) {
ar->getDependencyGraph()->addParent(DependencyGraph::KindOfFunctionCall,
"", getFullName(), shared_from_this());
if (Option::AllDynamic || hasHphpNote("Dynamic") ||
funcScope->isSepExtension() ||
BuiltinSymbols::IsDeclaredDynamic(m_name) ||
Option::IsDynamicFunction(m_method, m_name)) {
funcScope->setDynamic();
}
if (hasHphpNote("Volatile")) funcScope->setVolatile();
}
funcScope->setIncludeLevel(ar->getIncludeLevel());
ar->pushScope(funcScope);
if (m_params) {
m_params->analyzeProgram(ar);
if (Option::GenRTTIProfileData &&
ar->getPhase() == AnalysisResult::AnalyzeFinal) {
addParamRTTI(ar);
}
}
if (m_stmt) m_stmt->analyzeProgram(ar);
if (ar->isFirstPass()) {
if (!funcScope->isStatic() && ar->getClassScope() &&
funcScope->getVariables()->
getAttribute(VariableTable::ContainsDynamicVariable)) {
// Add this to variable table if we'll need it in a lookup table
// Use object because there's no point to specializing, just makes
// code gen harder when dealing with redeclared classes.
TypePtr tp(NEW_TYPE(Object));
funcScope->getVariables()->add("this", tp, true, ar, shared_from_this(),
ModifierExpressionPtr());
}
FunctionScope::RecordRefParamInfo(m_name, funcScope);
}
ar->popScope();
}
示例4: analyzeProgramImpl
void InterfaceStatement::analyzeProgramImpl(AnalysisResultPtr ar) {
ClassScopePtr classScope = m_classScope.lock();
if (hasHphpNote("Volatile")) classScope->setVolatile();
if (m_stmt) {
classScope->setIncludeLevel(ar->getIncludeLevel());
ar->pushScope(classScope);
m_stmt->analyzeProgram(ar);
ar->popScope();
}
ar->recordClassSource(m_name, ar->getFileScope()->getName());
checkVolatile(ar);
if (ar->getPhase() != AnalysisResult::AnalyzeAll) return;
vector<string> bases;
if (m_base) m_base->getStrings(bases);
DependencyGraphPtr dependencies = ar->getDependencyGraph();
for (unsigned int i = 0; i < bases.size(); i++) {
ClassScopePtr cls = ar->findClass(bases[i]);
if (cls) {
if (!cls->isInterface()) {
ar->getCodeError()->record(CodeError::InvalidDerivation,
shared_from_this(), ConstructPtr(),
cls->getOriginalName());
}
if (dependencies->checkCircle(DependencyGraph::KindOfClassDerivation,
m_originalName,
cls->getOriginalName())) {
ClassScopePtr classScope = m_classScope.lock();
ar->getCodeError()->record(CodeError::InvalidDerivation,
shared_from_this(), ConstructPtr(),
cls->getOriginalName());
m_base = ExpressionListPtr();
classScope->clearBases();
} else if (cls->isUserClass()) {
dependencies->add(DependencyGraph::KindOfClassDerivation,
ar->getName(),
m_originalName, shared_from_this(),
cls->getOriginalName(), cls->getStmt());
}
}
}
}