aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorAndy Kaylor <akaylor@nvidia.com>2025-06-13 09:42:58 -0700
committerGitHub <noreply@github.com>2025-06-13 09:42:58 -0700
commit36c710c40e8a59f74f56eb0e04e438cec5532ec5 (patch)
tree74252dfaf29115ac9d134795ec97835fbc7561f1 /clang/lib
parent3b09a3d5ae41faac3c0046b93a9c6e0297cc860b (diff)
downloadllvm-36c710c40e8a59f74f56eb0e04e438cec5532ec5.zip
llvm-36c710c40e8a59f74f56eb0e04e438cec5532ec5.tar.gz
llvm-36c710c40e8a59f74f56eb0e04e438cec5532ec5.tar.bz2
[CIR] Change default assumption about allowing builtins (#144004)
The code to read the "nobuiltins" attributes hasn't been implemented yet, but we were defaulting to the assumption that use of builtins is allowed for function calls that we recognize as standard C library calls and have builtin equivalents of. This change reverses that assumption so that when such calls are encountered, we just emit the call. This is a better default assumption, and since our builtin handling for these functions isn't implemented yet, it also allows us to compile more programs.
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CIR/CodeGen/CIRGenExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index 99f942f..42d0c78 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
@@ -1056,7 +1056,8 @@ CIRGenCallee CIRGenFunction::emitDirectCallee(const GlobalDecl &gd) {
bool isPredefinedLibFunction =
cgm.getASTContext().BuiltinInfo.isPredefinedLibFunction(builtinID);
- bool hasAttributeNoBuiltin = false;
+ // Assume nobuiltins everywhere until we actually read the attributes.
+ bool hasAttributeNoBuiltin = true;
assert(!cir::MissingFeatures::attributeNoBuiltin());
// When directing calling an inline builtin, call it through it's mangled