本文整理汇总了C++中Sema::LazilyCreateBuiltin方法的典型用法代码示例。如果您正苦于以下问题:C++ Sema::LazilyCreateBuiltin方法的具体用法?C++ Sema::LazilyCreateBuiltin怎么用?C++ Sema::LazilyCreateBuiltin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sema
的用法示例。
在下文中一共展示了Sema::LazilyCreateBuiltin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LookupBuiltin
/// LookupBuiltin - Lookup for built-in functions
static bool LookupBuiltin(Sema &S, LookupResult &R) {
Sema::LookupNameKind NameKind = R.getLookupKind();
// If we didn't find a use of this identifier, and if the identifier
// corresponds to a compiler builtin, create the defn object for the builtin
// now, injecting it into system scope, and return it.
if (NameKind == Sema::LookupOrdinaryName) {
IdentifierInfo *II = R.getLookupName().getAsIdentifierInfo();
if (II) {
// If this is a builtin on this (or all) targets, create the defn.
if (unsigned BuiltinID = II->getBuiltinID()) {
if (NamedDefn *D = S.LazilyCreateBuiltin((IdentifierInfo *)II,
BuiltinID, S.BaseWorkspace,
/*R.isForRedeclaration()*/false,
R.getNameLoc())) {
R.addDefn(D);
return true;
}
//FIXME yabin
// should i deal with this situation in gmat?
// if (R.isForRedeclaration()) {
// // If we're redeclaring this function anyway, forget that
// // this was a builtin at all.
// S.Context.BuiltinInfo.ForgetBuiltin(BuiltinID,
// S.Context.Idents);
// }
return false;
}
}
}
return false;
}