diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-04-06 12:29:04 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-04-06 12:29:04 +0000 |
commit | 0ac2cf4d28e1ed92508b27a3d9e28fc8db2a390b (patch) | |
tree | 2e713613627e2c14946dd6b213ade5ad77d28528 /lib/CodeGen | |
parent | 98b8f16a0b056919f24206a8a3ca86f9ea75fa34 (diff) |
If this is an intrinsic function, set the function's attributes to the intrinsic's attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index d180a2253e..34f594ecaa 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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) |