[clang] [clang][Sema] Don't warn for implicit uses of builtins in system headers (PR #138205)
Nick Sarnie via cfe-commits
cfe-commits at lists.llvm.org
Mon May 19 11:38:54 PDT 2025
================
@@ -1825,6 +1825,11 @@ class Sema final : public SemaBase {
/// Set of no-builtin functions listed by \#pragma function.
llvm::SmallSetVector<StringRef, 4> MSFunctionNoBuiltins;
+ /// Map of BuiltinIDs to source locations that have #pragma intrinsic calls
+ /// that refer to them.
+ llvm::DenseMap<unsigned, llvm::SmallSetVector<SourceLocation, 4>>
----------------
sarnex wrote:
I tried compiling the system header into a PCH and [dumping](https://gist.github.com/sarnex/2ae0c9c543a004622734a6cb1bdead0a) the AST with `llvm-bcanalyzer` and I didn't see any implicit declarations, not sure if I was checking for the right thing.
Either way, I tried another solution where we declare the builtin if it wasn't already delcared. Fixes the ambiguous call errors I saw when trying to universally declare it and fixes the original issue. Please take a look when you have a sec, thanks.
https://github.com/llvm/llvm-project/pull/138205
More information about the cfe-commits
mailing list