]> granicus.if.org Git - clang/commitdiff
when making a decl for __builtin_fabsf() make sure to
authorChris Lattner <sabre@nondot.org>
Wed, 30 Dec 2009 22:06:22 +0000 (22:06 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 30 Dec 2009 22:06:22 +0000 (22:06 +0000)
attach the appropriate attributes to it.  I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92316 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 21964d295ea8242ca9698efab050a274c6c9b161..2253f093df099c5212e6b8d2fe9669cef30f76ae 100644 (file)
@@ -4461,6 +4461,10 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) {
 
     if (Context.BuiltinInfo.isNoReturn(BuiltinID))
       FD->addAttr(::new (Context) NoReturnAttr());
+    if (Context.BuiltinInfo.isNoThrow(BuiltinID))
+      FD->addAttr(::new (Context) NoThrowAttr());
+    if (Context.BuiltinInfo.isConst(BuiltinID))
+      FD->addAttr(::new (Context) ConstAttr());
   }
 
   IdentifierInfo *Name = FD->getIdentifier();