aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorGulfem Savrun Yeniceri <gulfem@google.com>2020-12-14 13:56:11 -0800
committerHaowei Wu <haowei@google.com>2020-12-14 14:48:17 -0800
commit7c0e3a77bc43a9c4d05f68ffd4e84d0f75efbd91 (patch)
tree3ef410f32fa7b0501d29beaa9e64e27e79fe20df /clang/lib/CodeGen/CGCall.cpp
parentb3d1d1f4fff816423ea8c652d8d849aacc4c6ce8 (diff)
downloadllvm-7c0e3a77bc43a9c4d05f68ffd4e84d0f75efbd91.zip
llvm-7c0e3a77bc43a9c4d05f68ffd4e84d0f75efbd91.tar.gz
llvm-7c0e3a77bc43a9c4d05f68ffd4e84d0f75efbd91.tar.bz2
[clang][IR] Add support for leaf attribute
This patch adds support for leaf attribute as an optimization hint in Clang/LLVM. Differential Revision: https://reviews.llvm.org/D90275
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 5db34b6..73194be 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1989,6 +1989,8 @@ void CodeGenModule::ConstructAttributeList(
FuncAttrs.addAttribute("no_caller_saved_registers");
if (TargetDecl->hasAttr<AnyX86NoCfCheckAttr>())
FuncAttrs.addAttribute(llvm::Attribute::NoCfCheck);
+ if (TargetDecl->hasAttr<LeafAttr>())
+ FuncAttrs.addAttribute(llvm::Attribute::NoCallback);
HasOptnone = TargetDecl->hasAttr<OptimizeNoneAttr>();
if (auto *AllocSize = TargetDecl->getAttr<AllocSizeAttr>()) {