本文整理汇总了C++中AnalysisResultPtr::incNewlyInferred方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::incNewlyInferred方法的具体用法?C++ AnalysisResultPtr::incNewlyInferred怎么用?C++ AnalysisResultPtr::incNewlyInferred使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::incNewlyInferred方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setParamType
TypePtr FunctionScope::setParamType(AnalysisResultPtr ar, int index,
TypePtr type) {
ASSERT(index >= 0 && index < (int)m_paramTypes.size());
TypePtr paramType = m_paramTypes[index];
if (!paramType) paramType = NEW_TYPE(Some);
type = Type::Coerce(ar, paramType, type);
if (type && !Type::SameType(paramType, type)) {
ar->incNewlyInferred();
if (!ar->isFirstPass()) {
Logger::Verbose("Corrected type of parameter %d of %s: %s -> %s",
index, m_name.c_str(),
paramType->toString().c_str(), type->toString().c_str());
}
}
m_paramTypes[index] = type;
return type;
}
示例2: setType
TypePtr SymbolTable::setType(AnalysisResultPtr ar, const std::string &name,
TypePtr type, bool coerced) {
TypePtr oldType = getType(name, true);
if (!oldType) oldType = NEW_TYPE(Some);
if (m_declarations.find(name) == m_declarations.end()) {
m_symbols.push_back(name);
m_declarations[name] = ConstructPtr();
}
if (type) {
TypePtr ret = coerceTo(ar, coerced? m_coerced : m_rtypes, name, type);
TypePtr newType = getType(name, true);
if (!newType) newType = NEW_TYPE(Some);
if (!Type::SameType(oldType, newType)) {
ar->incNewlyInferred();
}
return newType;
}
return type;
}
示例3: setReturnType
void FunctionScope::setReturnType(AnalysisResultPtr ar, TypePtr type) {
// no change can be made to virtual function's prototype
if (m_overriding) return;
if (m_returnType) {
type = Type::Coerce(ar, m_returnType, type);
if (type && !Type::SameType(m_returnType, type)) {
ar->incNewlyInferred();
if (!ar->isFirstPass()) {
Logger::Verbose("Corrected function return type %s -> %s",
m_returnType->toString().c_str(),
type->toString().c_str());
}
}
}
if (!type->getName().empty()) {
FileScopePtr fs = getFileScope();
if (fs) fs->addClassDependency(ar, type->getName());
}
m_returnType = type;
}