[llvm-commits] [llvm] r47965 - /llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
Devang Patel
dpatel at apple.com
Fri Mar 7 17:37:56 PST 2008
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.
-
Devang
More information about the llvm-commits
mailing list