summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-04-06 12:29:04 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-04-06 12:29:04 +0000
commiteafa4e4b5bee6f95382bc3cc8b08c9368e054717 (patch)
treefcf0839602d0ac81b5821b784bddc2a708a2b0ed /clang/lib/CodeGen/CodeGenModule.cpp
parentcc771acd7703b2a2a0bac89ba1f5f1408a6980a7 (diff)
downloadbcm5719-llvm-eafa4e4b5bee6f95382bc3cc8b08c9368e054717.tar.gz
bcm5719-llvm-eafa4e4b5bee6f95382bc3cc8b08c9368e054717.zip
If this is an intrinsic function, set the function's attributes to the intrinsic's attributes.
llvm-svn: 129000
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d180a2253ef..34f594ecaa9 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -505,6 +505,13 @@ void CodeGenModule::SetInternalFunctionAttributes(const Decl *D,
void CodeGenModule::SetFunctionAttributes(GlobalDecl GD,
llvm::Function *F,
bool IsIncompleteFunction) {
+ if (unsigned IID = F->getIntrinsicID()) {
+ // If this is an intrinsic function, set the function's attributes
+ // to the intrinsic's attributes.
+ F->setAttributes(llvm::Intrinsic::getAttributes((llvm::Intrinsic::ID)IID));
+ return;
+ }
+
const FunctionDecl *FD = cast<FunctionDecl>(GD.getDecl());
if (!IsIncompleteFunction)
OpenPOWER on IntegriCloud