On Wed, Jul 27, 2011 at 8:02 AM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word"><div class="im"><br><div><div>On Jul 27, 2011, at 12:41 AM, Talin wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div>What do you mean "the linker fails"? Type mismatches should not cause the linker to fail.  In any case, this example should link, please provide a minimal example of two .ll files that repros what you're seeing with llvm-link.  Thanks,</div>

<div><br></div></div></blockquote><div>It's llvm-ld that asserts here:</div><div><br></div><div><div>Assertion failed: (N < NumContainedTys && "Element number out of range!"), function getElementType, file /Users/talin/Projects/llvm/include/llvm/DerivedTypes.h, line 268.</div>

</div></span><br></blockquote></div><br></div><div>Sounds like a bug, thanks.</div><div><br></div></div></blockquote><div>I figured out the problem - it was a case where a static constant had an unnamed struct type:</div>

<div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div class="gmail_quote"><div><div>%tart.text.encodings.UTF8 = type opaque</div></div></div><div class="gmail_quote">

<div><div><br></div></div></div><div class="gmail_quote"><div><div>@tart.text.encodings.Codecs.UTF_8 = global %tart.text.encodings.UTF8 { %tart.core.Object { %tart.core.TypeInfoBlock* undef, i64 0 }, i32 1 }</div></div></div>

</blockquote><div class="gmail_quote"><div><br></div><div>That being said - I would feel safer if invalid IR like this would assert at the time it was generated, rather than causing an error when attempting to read in the file. </div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div></div><font color="#888888"><div>-Chris</div></font></div></blockquote>

</div><br><br clear="all"><br>-- <br>-- Talin<br>