[llvm-commits] [llvm-gcc-4.2] r55382 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Dan Gohman
gohman at apple.com
Tue Aug 26 13:43:00 PDT 2008
Author: djg
Date: Tue Aug 26 15:43:00 2008
New Revision: 55382
URL: http://llvm.org/viewvc/llvm-project?rev=55382&view=rev
Log:
Don't create a non-aggregate return value when returning an
aggregate when only a single member. That's no longer valid,
now that we're using first-class aggregates instead of
multiple-return-values.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=55382&r1=55381&r2=55382&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Aug 26 15:43:00 2008
@@ -817,9 +817,10 @@
if (TheDebugInfo) TheDebugInfo->EmitRegionEnd(Fn, Builder.GetInsertBlock());
if (RetVals.empty())
Builder.CreateRetVoid();
- else if (RetVals.size() == 1)
+ else if (!Fn->getReturnType()->isAggregateType()) {
+ assert(RetVals.size() == 1 && "Non-aggregate return has multiple values!");
Builder.CreateRet(RetVals[0]);
- else
+ } else
Builder.CreateAggregateRet(&RetVals[0], RetVals.size());
// Emit pending exception handling code.
More information about the llvm-commits
mailing list