From eafa4e4b5bee6f95382bc3cc8b08c9368e054717 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 6 Apr 2011 12:29:04 +0000 Subject: If this is an intrinsic function, set the function's attributes to the intrinsic's attributes. llvm-svn: 129000 --- clang/lib/CodeGen/CodeGenModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d180a22..34f594e 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(GD.getDecl()); if (!IsIncompleteFunction) -- cgit v1.1