本文整理汇总了C++中MethodStatementPtr::setOriginalName方法的典型用法代码示例。如果您正苦于以下问题:C++ MethodStatementPtr::setOriginalName方法的具体用法?C++ MethodStatementPtr::setOriginalName怎么用?C++ MethodStatementPtr::setOriginalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MethodStatementPtr
的用法示例。
在下文中一共展示了MethodStatementPtr::setOriginalName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: informClosuresAboutScopeClone
MethodStatementPtr
ClassScope::importTraitMethod(const TraitMethod& traitMethod,
AnalysisResultPtr ar,
string methName,
const std::map<string, MethodStatementPtr>&
importedTraitMethods) {
MethodStatementPtr meth = traitMethod.m_method;
string origMethName = traitMethod.m_originalName;
ModifierExpressionPtr modifiers = traitMethod.m_modifiers;
MethodStatementPtr cloneMeth = dynamic_pointer_cast<MethodStatement>(
dynamic_pointer_cast<ClassStatement>(m_stmt)->addClone(meth));
cloneMeth->setName(methName);
cloneMeth->setOriginalName(origMethName);
// Note: keep previous modifiers if none specified when importing the trait
if (modifiers && modifiers->getCount()) {
cloneMeth->setModifiers(modifiers);
}
FunctionScopePtr funcScope = meth->getFunctionScope();
// Trait method typehints, self and parent, need to be converted
ClassScopePtr cScope = dynamic_pointer_cast<ClassScope>(shared_from_this());
cloneMeth->fixupSelfAndParentTypehints( cScope );
FunctionScopePtr cloneFuncScope
(new HPHP::FunctionScope(funcScope, ar, methName, origMethName, cloneMeth,
cloneMeth->getModifiers(), cScope->isUserClass()));
cloneMeth->resetScope(cloneFuncScope, true);
cloneFuncScope->setOuterScope(shared_from_this());
informClosuresAboutScopeClone(cloneMeth, cloneFuncScope, ar);
cloneMeth->addTraitMethodToScope(ar,
dynamic_pointer_cast<ClassScope>(shared_from_this()));
// Preserve original filename (as this varies per-function and not per-unit
// in the case of methods imported from flattened traits)
cloneMeth->setOriginalFilename(meth->getFileScope()->getName());
return cloneMeth;
}