本文整理汇总了C++中FunctionScopePtr::getScopeName方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionScopePtr::getScopeName方法的具体用法?C++ FunctionScopePtr::getScopeName怎么用?C++ FunctionScopePtr::getScopeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionScopePtr
的用法示例。
在下文中一共展示了FunctionScopePtr::getScopeName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addFunction
bool FileScope::addFunction(AnalysisResultConstPtr ar,
FunctionScopePtr funcScope) {
if (ar->declareFunction(funcScope)) {
FunctionScopePtr &fs = m_functions[funcScope->getScopeName()];
if (fs) {
if (!m_redeclaredFunctions) {
m_redeclaredFunctions = new StringToFunctionScopePtrVecMap;
}
auto& funcVec = (*m_redeclaredFunctions)[funcScope->getScopeName()];
if (!funcVec.size()) {
fs->setLocalRedeclaring();
funcVec.push_back(fs);
}
funcScope->setLocalRedeclaring();
funcVec.push_back(funcScope);
} else {
fs = funcScope;
}
return true;
}
return false;
}
示例2: declareFunction
bool AnalysisResult::declareFunction(FunctionScopePtr funcScope) const {
assert(m_phase < AnalyzeAll);
// System functions override
auto it = m_functions.find(funcScope->getScopeName());
if (it != m_functions.end()) {
// we need someone to hold on to a reference to it
// even though we're not going to do anything with it
this->lock()->m_ignoredScopes.push_back(funcScope);
std::string msg;
string_printf(
msg,
Strings::REDECLARE_BUILTIN,
funcScope->getScopeName().c_str()
);
funcScope->setFatal(msg);
return false;
}
return true;
}
示例3: addFunction
bool ClassScope::addFunction(AnalysisResultConstPtr ar,
FileScopeRawPtr fileScope,
FunctionScopePtr funcScope) {
FunctionScopePtr &func = m_functions[funcScope->getScopeName()];
if (func) {
func->getStmt()->parseTimeFatal(fileScope,
Compiler::DeclaredMethodTwice,
"Redeclared method %s::%s",
getScopeName().c_str(),
func->getScopeName().c_str());
}
func = funcScope;
m_functionsVec.push_back(funcScope);
return true;
}
示例4: declareFunction
bool AnalysisResult::declareFunction(FunctionScopePtr funcScope) const {
assert(m_phase < AnalyzeAll);
// System functions override
auto it = m_functions.find(funcScope->getScopeName());
if (it != m_functions.end()) {
if (!it->second->allowOverride()) {
// we need someone to hold on to a reference to it
// even though we're not going to do anything with it
this->lock()->m_ignoredScopes.push_back(funcScope);
return false;
}
}
return true;
}