[cfe-commits] r117645 - in /cfe/trunk: lib/CodeGen/CGException.cpp test/CodeGenCXX/throw-expressions.cpp

John McCall rjmccall at apple.com
Fri Oct 29 01:14:02 PDT 2010


Author: rjmccall
Date: Fri Oct 29 03:14:02 2010
New Revision: 117645

URL: http://llvm.org/viewvc/llvm-project?rev=117645&view=rev
Log:
Don't assert on attempts to throw 'bool'.  I wonder if in the history of C++
anyone has ever intentionally done this outside of a compiler test case.


Modified:
    cfe/trunk/lib/CodeGen/CGException.cpp
    cfe/trunk/test/CodeGenCXX/throw-expressions.cpp

Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=117645&r1=117644&r2=117645&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Fri Oct 29 03:14:02 2010
@@ -526,7 +526,7 @@
 
   // __cxa_allocate_exception returns a void*;  we need to cast this
   // to the appropriate type for the object.
-  const llvm::Type *Ty = CGF.ConvertType(E->getType())->getPointerTo();
+  const llvm::Type *Ty = CGF.ConvertTypeForMem(E->getType())->getPointerTo();
   llvm::Value *TypedExnLoc = CGF.Builder.CreateBitCast(ExnLoc, Ty);
 
   // FIXME: this isn't quite right!  If there's a final unelided call

Modified: cfe/trunk/test/CodeGenCXX/throw-expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/throw-expressions.cpp?rev=117645&r1=117644&r2=117645&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/throw-expressions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/throw-expressions.cpp Fri Oct 29 03:14:02 2010
@@ -8,3 +8,8 @@
 int test2() {
   return val ? throw val : val;
 }
+
+// rdar://problem/8608801
+void test3() {
+  throw false;
+}





More information about the cfe-commits mailing list