diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-10-12 19:51:18 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-10-12 19:51:18 +0000 |
commit | 6700415542121e2cb7d867728046ffa21e402019 (patch) | |
tree | c45b4afdda68460a0ca4054cd8180fe78c605ab2 /include/clang/Basic/Builtins.h | |
parent | d768150ef57f617c8d9fef48f3c92e8f21698024 (diff) |
Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Builtins.h')
-rw-r--r-- | include/clang/Basic/Builtins.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index fbf4ef417f..5afa020100 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -103,6 +103,11 @@ public: return strchr(GetRecord(ID).Attributes, 'r') != 0; } + /// isReturnsTwice - Return true if we know this builtin can return twice. + bool isReturnsTwice(unsigned ID) const { + return strchr(GetRecord(ID).Attributes, 'j') != 0; + } + /// isLibFunction - Return true if this is a builtin for a libc/libm function, /// with a "__builtin_" prefix (e.g. __builtin_abs). bool isLibFunction(unsigned ID) const { |