diff options
author | Atmn Patel <atmndp@gmail.com> | 2020-10-20 02:48:18 -0400 |
---|---|---|
committer | Atmn Patel <a335pate@uwaterloo.ca> | 2020-10-20 03:09:57 -0400 |
commit | 595c6156068458481395d0f87da16e51a3121a4e (patch) | |
tree | b41c72c4bb5d576213b154983bfd0df27706ebeb /llvm/lib/IR/Attributes.cpp | |
parent | 08c8d5bc51c512e605840b8003fcf38c86d0fc96 (diff) | |
download | llvm-595c6156068458481395d0f87da16e51a3121a4e.zip llvm-595c6156068458481395d0f87da16e51a3121a4e.tar.gz llvm-595c6156068458481395d0f87da16e51a3121a4e.tar.bz2 |
[IR] Adds mustprogress as a LLVM IR attribute
This adds the LLVM IR attribute `mustprogress` as defined in LangRef through D86233. This attribute will be applied to functions with in languages like C++ where forward progress is guaranteed. Functions without this attribute are not required to make progress.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D85393
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 9e4ff20..63384689 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -451,6 +451,8 @@ std::string Attribute::getAsString(bool InAttrGrp) const { return "immarg"; if (hasAttribute(Attribute::NoUndef)) return "noundef"; + if (hasAttribute(Attribute::MustProgress)) + return "mustprogress"; const bool IsByVal = hasAttribute(Attribute::ByVal); if (IsByVal || hasAttribute(Attribute::StructRet)) { |