[llvm-commits] [dragonegg] r129003 - /dragonegg/trunk/Convert.cpp

Duncan Sands baldrick at free.fr
Wed Apr 6 08:26:34 PDT 2011


Author: baldrick
Date: Wed Apr  6 10:26:34 2011
New Revision: 129003

URL: http://llvm.org/viewvc/llvm-project?rev=129003&view=rev
Log:
Elimination of old style multiple return value support broke the case of
returning an empty struct (previously it was possible to return void in
this case).

Modified:
    dragonegg/trunk/Convert.cpp

Modified: dragonegg/trunk/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Convert.cpp?rev=129003&r1=129002&r2=129003&view=diff
==============================================================================
--- dragonegg/trunk/Convert.cpp (original)
+++ dragonegg/trunk/Convert.cpp Wed Apr  6 10:26:34 2011
@@ -943,6 +943,9 @@
           Value *E = Builder.CreateLoad(GEP, "mrv");
           RetVals.push_back(E);
         }
+        // If the return type specifies an empty struct then return one.
+        if (RetVals.empty())
+          RetVals.push_back(UndefValue::get(Fn->getReturnType()));
       } else {
         // Otherwise, this aggregate result must be something that is returned
         // in a scalar register for this target.  We must bit convert the





More information about the llvm-commits mailing list