[LLVMdev] Writing unit tests for DWARF?

Devang Patel dpatel at apple.com
Thu Mar 17 06:48:41 PDT 2011


Renato,

On Mar 17, 2011, at 3:25 AM, Renato Golin wrote:

>  could help with the verification process (since it's much better to
> fail verification than to fail gdb testuite), but I don't know the
> design decisions being taken for debug information/metadata, and they
> change too frequently to dig the code to learn.

I think you are mistaken here. I maintain and support debug info for two front ends (llvm-gcc and clang). Go ahead and check svn archives for last one year and see how many times I had to update llvm-gcc FE.

> There is no API
> documentation and the interface (IR metadata) docs are old and
> inaccurate.
> 
> I'd say, in order of importance, the three things that need to be done ASAP are:
> 
> 1. Stick to one representation and document it (like LangRef), so
> other people could help

In last 5 or so llvm releases, encoded debug info representation in llvm IR has changed only once (using metadata, instead of global variables). All other changes are incremental *and* backward compatible.

Regarding documentation, it is on my list. However, your argument has same disconnect as some one who looks at LangReg and says I do not know what exactly FE has to generate to produce a working program. Well, what you need is a How To Write a Front End document. 

> 2. Enhance Validate() methods to be extremely strict (like Module's),
> so it fails straight away

See my response regarding Verify().

> 3. Create tests (unit and regression) and run them during check-all,
> so we don't regress

I have already mentioned debuginfo-tests  at least once to you earlier.

> 
> The tests are last because it's much easier to catch an assertion than
> a silent codegen error.
> 

-
Devang




More information about the llvm-dev mailing list