[cfe-commits] r129000 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Peter Collingbourne
peter at pcc.me.uk
Wed Apr 6 05:29:04 PDT 2011
Author: pcc
Date: Wed Apr 6 07:29:04 2011
New Revision: 129000
URL: http://llvm.org/viewvc/llvm-project?rev=129000&view=rev
Log:
If this is an intrinsic function, set the function's attributes to the intrinsic's attributes.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=129000&r1=128999&r2=129000&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Wed Apr 6 07:29:04 2011
@@ -505,6 +505,13 @@
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)
More information about the cfe-commits
mailing list