<html><head><base href="x-msg://2694/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 04.09.2012, at 08:43, Jin Gu Kang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div ocsi="x"><div dir="ltr"><font color="#000000" size="2" face="Tahoma">Hi all,</font></div><div dir="ltr"><font size="2" face="Tahoma"></font> </div><div dir="ltr"><font size="2" face="Tahoma">I checked "VisitInitListExpr(InitListExpr *ILE)" function and found strange type checking order. Current type checking order is as following.</font></div><div dir="ltr"><font size="2" face="Tahoma"></font> </div><div dir="ltr"><font size="2" face="Tahoma"> 829   llvm::Constant *VisitInitListExpr(InitListExpr *ILE) {<br> 830     if (ILE->getType()->isArrayType())<br> 831       return EmitArrayInitialization(ILE);<br> 832<br> 833     if (ILE->getType()->isRecordType())<br> 834       return EmitUnionInitialization(ILE);<br> 835<br> 836     if (ILE->getType()->isUnionType())<br> 837       return EmitStructInitialization(ILE);<br></font></div><div dir="ltr"><font size="2" face="Tahoma"><font face="tahoma">If RecodeType is checked eariler, UnionType will not be check because UnionType is checked from Decl's field and Type is also RecordType. Although EmitStructInitialization() and EmitUnionInitialization() call the same ConstStructBuilder::BuildStruct() function, It looks like wrong. I think UnionType should be checked eariler than RecordType.</font></font></div><div dir="ltr"><font size="2" face="Tahoma"><font face="tahoma"></font></font> </div><div dir="ltr"><font size="2" face="Tahoma">What do you think about this?</font></div><div dir="ltr"><font size="2" face="Tahoma"></font> </div><div dir="ltr"><font size="2" face="Tahoma">I attach a simple patch to fix it.</font></div></div></span></blockquote><br></div><div>Looks good, go ahead.</div><div><br></div><div>Sebastian</div></body></html>