[LLVMdev] Linking opaque types

Talin viridia at gmail.com
Wed Jul 27 18:35:56 PDT 2011


On Wed, Jul 27, 2011 at 8:02 AM, Chris Lattner <clattner at apple.com> wrote:

>
> On Jul 27, 2011, at 12:41 AM, Talin wrote:
>
> 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,
>>
>> It's llvm-ld that asserts here:
>
> Assertion failed: (N < NumContainedTys && "Element number out of range!"),
> function getElementType, file
> /Users/talin/Projects/llvm/include/llvm/DerivedTypes.h, line 268.
>
>
> Sounds like a bug, thanks.
>
> I figured out the problem - it was a case where a static constant had an
unnamed struct type:

%tart.text.encodings.UTF8 = type opaque

@tart.text.encodings.Codecs.UTF_8 = global %tart.text.encodings.UTF8 {
%tart.core.Object { %tart.core.TypeInfoBlock* undef, i64 0 }, i32 1 }


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.

-Chris
>



-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110727/d8e93186/attachment.html>


More information about the llvm-dev mailing list