[PATCH] D73495: [CodeGen] Attach no-builtin attributes to functions with no Decl
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 27 13:48:18 PST 2020
efriedma added inline comments.
================
Comment at: clang/lib/CodeGen/CGCall.cpp:1917
const auto *NBA = Fn->getAttr<NoBuiltinAttr>();
- bool HasWildcard = NBA && llvm::is_contained(NBA->builtinNames(), "*");
- if (getLangOpts().NoBuiltin || HasWildcard)
- FuncAttrs.addAttribute("no-builtins");
- else {
- auto AddNoBuiltinAttr = [&FuncAttrs](StringRef BuiltinName) {
- SmallString<32> AttributeName;
- AttributeName += "no-builtin-";
- AttributeName += BuiltinName;
- FuncAttrs.addAttribute(AttributeName);
- };
- llvm::for_each(getLangOpts().NoBuiltinFuncs, AddNoBuiltinAttr);
- if (NBA)
- llvm::for_each(NBA->builtinNames(), AddNoBuiltinAttr);
- }
+ addNonCallSiteNoBuiltinAttributes(FuncAttrs, getLangOpts(), NBA);
}
----------------
What happens if we have a TargetDecl that isn't a FunctionDecl? (I think this happens in some cases, but not completely sure which, exactly.)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73495/new/
https://reviews.llvm.org/D73495
More information about the cfe-commits
mailing list