本文整理汇总了C++中MethodStatementPtr::isRef方法的典型用法代码示例。如果您正苦于以下问题:C++ MethodStatementPtr::isRef方法的具体用法?C++ MethodStatementPtr::isRef怎么用?C++ MethodStatementPtr::isRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MethodStatementPtr
的用法示例。
在下文中一共展示了MethodStatementPtr::isRef方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setParamCounts
void FunctionScope::setParamCounts(AnalysisResultConstPtr ar, int minParam,
int numDeclParam) {
if (minParam >= 0) {
m_minParam = minParam;
m_numDeclParams = numDeclParam;
} else {
assert(numDeclParam == minParam);
}
assert(m_minParam >= 0 && m_numDeclParams >= m_minParam);
assert(IMPLIES(hasVariadicParam(), m_numDeclParams > 0));
if (m_numDeclParams > 0) {
m_paramNames.resize(m_numDeclParams);
m_refs.resize(m_numDeclParams);
if (m_stmt) {
MethodStatementPtr stmt = dynamic_pointer_cast<MethodStatement>(m_stmt);
ExpressionListPtr params = stmt->getParams();
for (int i = 0; i < m_numDeclParams; i++) {
if (stmt->isRef(i)) m_refs[i] = true;
ParameterExpressionPtr param =
dynamic_pointer_cast<ParameterExpression>((*params)[i]);
m_paramNames[i] = param->getName();
}
assert(m_paramNames.size() == m_numDeclParams);
}
}
}
示例2: setParamCounts
void FunctionScope::setParamCounts(AnalysisResultPtr ar, int minParam,
int maxParam) {
m_minParam = minParam;
m_maxParam = maxParam;
ASSERT(m_minParam >= 0 && m_maxParam >= m_minParam);
if (m_maxParam > 0) {
m_paramNames.resize(m_maxParam);
m_paramTypes.resize(m_maxParam);
m_paramTypeSpecs.resize(m_maxParam);
m_refs.resize(m_maxParam);
if (m_stmt) {
MethodStatementPtr stmt = dynamic_pointer_cast<MethodStatement>(m_stmt);
ExpressionListPtr params = stmt->getParams();
for (int i = 0; i < m_maxParam; i++) {
if (stmt->isRef(i)) m_refs[i] = true;
ParameterExpressionPtr param =
dynamic_pointer_cast<ParameterExpression>((*params)[i]);
m_paramNames[i] = param->getName();
m_paramTypeSpecs[i] = param->getTypeSpec(ar);
}
}
}
}