[PATCH] D124701: [clang] Honor __attribute__((no_builtin("foo"))) on functions
Stephen Long via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 4 13:13:55 PDT 2022
steplong added inline comments.
================
Comment at: clang/lib/CodeGen/CGExpr.cpp:5219
+ // function.
+ else if (!CGF.CurFn->getAttributes().hasFnAttr(AttributeNoBuiltin))
return CGCallee::forBuiltin(builtinID, FD);
----------------
hans wrote:
> What if CurFn has the "wildcard" no-builtins attribute?
Hmmm, good question. Currently, "*" generates a warning. I was able to get "*" to add the attribute no-builtins to the function, but if I try making it affect the calls in the function, I see a compiler crash when compiling compiler-rt. It looks like some builtins must be generated even if -fno-builtins is called such as __sync_lock_test_and_set_1. I'm not sure how to check for that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124701/new/
https://reviews.llvm.org/D124701
More information about the cfe-commits
mailing list