[LLVMdev] Values have no names when generating *.ll files in clang and llvm 2.8 ?

Duncan Sands baldrick at free.fr
Thu Oct 14 01:48:30 PDT 2010


Hi John,

>>> This isn't a 2.8 change, the issue is that release-without-asserts builds don't add names on instructions (because IRBuilder gets a different argument).
>>
>> having the output of clang depend on whether clang was built with assertions
>> on or not sounds like a bad idea to me.
>
> While I agree in the abstract that this is an independent choice from
> assertions and optimization, I'm not convinced that it's an important
> enough feature to seriously complicate our configuration over.

is adding a debug flag to turn on name generation really a serious complication?

> Nobody really wants names unless they're debugging a compiler,
> and even then they're not crucial.

how about always having name generation be turned off, whatever mode the
compiler is built in?  People debugging the compiler can reasonably (IMO)
be required to pass a debug flag to clang to turn on name generation, or
if you don't want a debug flag they can always use opt -instnamer.  That
said, I agree that it's not a big deal, just likely to cause confusion
when people see that they are getting different output from two copies of
the same compiler (as happened to me yesterday when I saw that my version
of clang-2.8 was giving everything names).

   They should be on by default as
> long as Debug builds are the default,

I guess this is the bit I don't really get.  Why should it be on by default in
debug builds?  I guess your point of view is that "Debug build" means that
you are interested in debugging the compiler, while in fact it just means
that the compiler was built without optimization which is not quite the same
thing (in spite of the name).  For example because otherwise your system
compiler miscompiles LLVM/clang [*]

Ciao,

Duncan.

[*] In which case you could argue that you should be debugging the situation.

but we don't want people to
> unintentionally make production compilers with names enabled.
>
> I think there's a case to be made that we should kill names based on
> --enable-optimized instead of --disable-assertions.  The only problem
> is that --enable-optimized doesn't actually turn into a -D right now.
>
> John.




More information about the llvm-dev mailing list