[cfe-commits] r65473 - in /cfe/trunk: lib/CodeGen/CGCall.cpp test/CodeGen/function-attributes.c

Daniel Dunbar daniel at zuster.org
Wed Feb 25 12:59:29 PST 2009


Author: ddunbar
Date: Wed Feb 25 14:59:29 2009
New Revision: 65473

URL: http://llvm.org/viewvc/llvm-project?rev=65473&view=rev
Log:
Temporarily disable clearing of insert point (to indicate unreachable
code) when calling noreturn functions; general expression emission
isn't ready to do the right thing in all cases.

Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp
    cfe/trunk/test/CodeGen/function-attributes.c

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=65473&r1=65472&r2=65473&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Wed Feb 25 14:59:29 2009
@@ -1787,6 +1787,11 @@
       Builder.CreateUnreachable();
       Builder.ClearInsertionPoint();
       
+      // FIXME: For now, emit a dummy basic block because expr
+      // emitters in generally are not ready to handle emitting
+      // expressions at unreachable points.
+      EnsureInsertPoint();
+
       // Return a reasonable RValue.
       return GetUndefRValue(RetTy);
     }    

Modified: cfe/trunk/test/CodeGen/function-attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/function-attributes.c?rev=65473&r1=65472&r2=65473&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/function-attributes.c (original)
+++ cfe/trunk/test/CodeGen/function-attributes.c Wed Feb 25 14:59:29 2009
@@ -35,5 +35,12 @@
 // RUN: grep 'call i32 @f10_t() readnone' %t &&
 int __attribute__((const)) f10_t(void);
 int f10(void) { return f10_t(); }
+int f11(void) {
+ exit:
+  return f10_t();
+}
+int f12(int arg) {
+  return arg ? 0 : f10_t();
+}
 
 // RUN: true





More information about the cfe-commits mailing list