[llvm-commits] [dragonegg] r156242 - /dragonegg/trunk/src/Convert.cpp

Duncan Sands baldrick at free.fr
Sat May 5 11:19:57 PDT 2012


Author: baldrick
Date: Sat May  5 13:19:57 2012
New Revision: 156242

URL: http://llvm.org/viewvc/llvm-project?rev=156242&view=rev
Log:
In gcc-4.7, a call to a function returning a value may be marked as having void
type.  This may be a GCC bug since it only seems to occur for C++ template code,
but since it is mild and easy to handle, handle it.  This fires for gcc-4.7 on
tests already in dragonegg's compilator test suite.

Modified:
    dragonegg/trunk/src/Convert.cpp

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=156242&r1=156241&r2=156242&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Sat May  5 13:19:57 2012
@@ -3347,12 +3347,14 @@
     BeginBlock(NextBlock);
   }
 
+  // If the call statement has void type then either the callee does not return
+  // a result, or it does but the result should be discarded.
+  if (isa<VOID_TYPE>(gimple_call_return_type(stmt)))
+    return 0;
+
   if (Client.isShadowReturn())
     return Client.EmitShadowResult(gimple_call_return_type(stmt), DestLoc);
 
-  if (Call->getType()->isVoidTy())
-    return 0;
-
   if (Client.isAggrReturn()) {
     MemRef Target;
     if (DestLoc)





More information about the llvm-commits mailing list