diff options
author | James Molloy <james.molloy@arm.com> | 2015-11-06 10:32:53 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2015-11-06 10:32:53 +0000 |
commit | e6f87ca812809543444d7d5961aea2509b8a3227 (patch) | |
tree | 0484ecea76aab7032b2b590638de7650912e9e14 /llvm/lib/IR/Attributes.cpp | |
parent | a805030ae821fa03fb76d89b9bb81ee66f676105 (diff) | |
download | bcm5719-llvm-e6f87ca812809543444d7d5961aea2509b8a3227.tar.gz bcm5719-llvm-e6f87ca812809543444d7d5961aea2509b8a3227.zip |
Add a new attribute: norecurse
This attribute allows the compiler to assume that the function never recurses into itself, either directly or indirectly (transitively). This can be used among other things to demote global variables to locals.
llvm-svn: 252282
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 2586cb54c3e..bdefe5917fe 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -232,6 +232,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const { return "noredzone"; if (hasAttribute(Attribute::NoReturn)) return "noreturn"; + if (hasAttribute(Attribute::NoRecurse)) + return "norecurse"; if (hasAttribute(Attribute::NoUnwind)) return "nounwind"; if (hasAttribute(Attribute::OptimizeNone)) @@ -442,6 +444,7 @@ uint64_t AttributeImpl::getAttrMask(Attribute::AttrKind Val) { case Attribute::JumpTable: return 1ULL << 45; case Attribute::Convergent: return 1ULL << 46; case Attribute::SafeStack: return 1ULL << 47; + case Attribute::NoRecurse: return 1ULL << 48; case Attribute::Dereferenceable: llvm_unreachable("dereferenceable attribute not supported in raw format"); break; |