[LLVMdev] llvm-dis fails to parse bytecode emitted by clang

Duncan Sands
2010-10-26T08:23:22Z

Hi Lorenzo,

> I am trying to generate LLVM bytecode using CLANG and I ran into the
> following problem. If I run clang with the -emit-llvm option and then
> try to get a textual representation of the output using llvm-dis, the
> latter crashes because of a failed assertion in BitCodeReader.cpp,
> mentioning a "Type mismatch in value table" (the exact error
message
> is appended at the end of this email). However, if I generate the
> bytecode from the same source using llvm-gcc instead of clang,
> llvm-dis works fine.

I've seen similar errors to this in the past, and they invariably meant that
LLVM and/or clang had been miscompiled by the system compiler.  Take a look at
http://llvm.org/docs/GettingStarted.html#brokengcc

Ciao,

Duncan.