[llvm-dev] TableGen - cryptic error messages (~feature request)
RCU via llvm-dev
llvm-dev at lists.llvm.org
Tue Dec 29 14:54:00 PST 2015
I started implementing a back end in LLVM (and I'm writing some hints I consider
useful at https://sites.google.com/site/alexsusu/home/backend-llvm ).
Unfortunately, I hit quite a few times very cryptic error messages when compiling
with TableGen, which required a few good hours of debugging the TableGen program.
The most cryptic error message was when compiling with TableGen, with the option
-gen-asm-matcher . Here I got the following error message:
llvm-tblgen: ~/llvm/lib/TableGen/StringMatcher.cpp:52: bool
std::pair<std::basic_string<char>, std::basic_string<char> >*>&, unsigned int, unsigned
int) const: Assertion `Matches.size() == 1 && "Had duplicate keys to match on"' failed.
0. Program arguments: ~/llvm/build3/bin/llvm-tblgen -gen-asm-matcher -I
./run_tblgen.sh: line 13: 27011 Aborted (core dumped)
~/llvm/build3/bin/llvm-tblgen -gen-asm-matcher -I ~/llvm/include Connex.td >
It took me quite a few hours to find the source of the error, namely the fact I had
defined two registers with the SAME ASM name (string) - so the disassembly (ASM matcher)
info had conflicts. I actually sped up my debugging by editing the file
~/llvm/lib/TableGen/StringMatcher.cpp and adding in StringMatcher::
EmitStringMatcherForChar() some printing that explained more clearly why the error happens.
Therefore I have this IMPORTANT question: would you feel it is useful to make
TableGen give more detailed error messages? I personally recommend this.
More information about the llvm-dev