[cfe-commits] r128198 - in /cfe/trunk: lib/CodeGen/CGBuiltin.cpp test/CodeGen/builtin-attributes.c

Eli Friedman eli.friedman at gmail.com
Wed Mar 23 22:09:45 PDT 2011


Author: efriedma
Date: Thu Mar 24 00:09:45 2011
New Revision: 128198

URL: http://llvm.org/viewvc/llvm-project?rev=128198&view=rev
Log:
Make sure we aggressively attach nounwind (etc.) to calls to library
functions of the form __builtin_XXX.


Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/test/CodeGen/builtin-attributes.c

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=128198&r1=128197&r2=128198&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Mar 24 00:09:45 2011
@@ -948,8 +948,7 @@
       getContext().BuiltinInfo.isPredefinedLibFunction(BuiltinID))
     return EmitCall(E->getCallee()->getType(),
                     CGM.getBuiltinLibFunction(FD, BuiltinID),
-                    ReturnValueSlot(),
-                    E->arg_begin(), E->arg_end());
+                    ReturnValueSlot(), E->arg_begin(), E->arg_end(), FD);
 
   // See if we have a target specific intrinsic.
   const char *Name = getContext().BuiltinInfo.GetName(BuiltinID);

Modified: cfe/trunk/test/CodeGen/builtin-attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-attributes.c?rev=128198&r1=128197&r2=128198&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtin-attributes.c (original)
+++ cfe/trunk/test/CodeGen/builtin-attributes.c Thu Mar 24 00:09:45 2011
@@ -10,3 +10,8 @@
 void f1() {
   exit(1);
 }
+
+// CHECK: call i8* @strstr{{.*}} nounwind
+char* f2(char* a, char* b) {
+  return __builtin_strstr(a, b);
+}





More information about the cfe-commits mailing list