aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorZequan Wu <zequanwu@google.com>2020-12-07 16:37:14 -0800
committerZequan Wu <zequanwu@google.com>2020-12-17 07:45:38 -0800
commitfb0f7288051eb2745bb9211306f53ff9aa6f73e2 (patch)
treeceb257f84ac3121524f07cc49434d0f614393b24 /clang/lib/CodeGen/CodeGenModule.cpp
parentbd343d26814640b4934fdde8637ad5577d30c83c (diff)
downloadllvm-fb0f7288051eb2745bb9211306f53ff9aa6f73e2.zip
llvm-fb0f7288051eb2745bb9211306f53ff9aa6f73e2.tar.gz
llvm-fb0f7288051eb2745bb9211306f53ff9aa6f73e2.tar.bz2
[Clang] Make nomerge attribute a function attribute as well as a statement attribute.
Differential Revision: https://reviews.llvm.org/D92800
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 0bb9c91..7dd343d 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1749,6 +1749,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
B.addAttribute(llvm::Attribute::MinSize);
}
+ if (D->hasAttr<NoMergeAttr>())
+ B.addAttribute(llvm::Attribute::NoMerge);
+
F->addAttributes(llvm::AttributeList::FunctionIndex, B);
unsigned alignment = D->getMaxAlignment() / Context.getCharWidth();