[llvm-commits] [llvm] r47965 - /llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
Chris Lattner
clattner at apple.com
Fri Mar 7 17:49:29 PST 2008
On Mar 7, 2008, at 5:37 PM, Devang Patel wrote:
>
> On Mar 7, 2008, at 5:30 PM, Devang Patel wrote:
>
>> On Mar 7, 2008, at 5:27 PM, Chris Lattner wrote:
>>
>>>> + else if (const StructType *STy =
>>>> dyn_cast<StructType>(F.getReturnType())) {
>>>> + for (unsigned i = 0; i < NumRetVals; ++i) {
>>>> + PHINode *PN = new PHINode(STy->getElementType(i),
>>>> "UnifiedRetVal");
>>>> + NewRetBlock->getInstList().push_back(PN);
>>>> + Phis.push_back(PN);
>>>> + }
>>>> + new ReturnInst(&Phis[0], NumRetVals);
>>>
>>> This loop is not specific to multiple return case. It would work
>>> just
>>> as well for the single return case. Please remove the check for
>>> StructType.
>
> hmm.. need StructType check to get individual struct element types.
Ah, you're right, disregard then!
-Chris
More information about the llvm-commits
mailing list