diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-21 19:47:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-21 19:47:46 +0000 |
commit | b68e39930d06ed81a2b431dc09e4cb97e5c0d57a (patch) | |
tree | 3127acbd6bac43e80859bd4441ddcf902dfdb3aa /include/clang/Basic/Builtins.h | |
parent | 32038bb8486a1f31e8bd8e19ef388049669e9ed2 (diff) |
In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.
C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.
Fixes PR8839.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Builtins.h')
-rw-r--r-- | include/clang/Basic/Builtins.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 76f21c842b..4df4c8f953 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -117,6 +117,10 @@ public: return strchr(GetRecord(ID).Attributes, 'f') != 0; } + /// \brief Completely forget that the given ID was ever considered a builtin, + /// e.g., because the user provided a conflicting signature. + void ForgetBuiltin(unsigned ID, IdentifierTable &Table); + /// \brief If this is a library function that comes from a specific /// header, retrieve that header name. const char *getHeaderName(unsigned ID) const { |