[PATCH] D27326: Make a DWARF generator so we can unit test DWARF APIs with gtest.

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 17:30:04 PST 2016


> On Dec 5, 2016, at 5:21 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> 
> On Mon, Dec 5, 2016 at 3:59 PM Greg Clayton via Phabricator <reviews at reviews.llvm.org> wrote:
> clayborg updated this revision to Diff 80340.
> clayborg added a comment.
> 
> Fixed Adrian's issues. Big changes include:
> 
> - Added llvm::Expected support to the dwarfgen::Generator
> - Handle errors if any arise
> - Get host triple and get its 32 and 64 bits variants for 4 byte and 8 byte addresses and bail out if targets are not available without breaking the gtest.
> 
> It's possible to build the compiler without support for the host architecture, I should think... 

Currently this will cause the code to not get a target and return an error from the dwarfgen::Generator::create(...) method and and it will just exit the test without causing an error.

> It's probably simpler/OK (open to debate/disagreement, for sure) hardcode some architecture and use lit test config to opt out of running these tests unless that target is built in. (lots of our lit tests do this because they test some specific architecture feature - not sure if any of the unit tests do, though, os that might be a bit trickier)

Do you know of an example I can look at for this?

Greg

>  
> 
> 
> https://reviews.llvm.org/D27326
> 
> Files:
>   include/llvm/CodeGen/DIE.h
>   include/llvm/CodeGen/DIEValue.def
>   include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
>   include/llvm/MC/MCContext.h
>   lib/CodeGen/AsmPrinter/DIE.cpp
>   lib/CodeGen/AsmPrinter/DIEHash.cpp
>   lib/CodeGen/AsmPrinter/DwarfFile.cpp
>   lib/CodeGen/AsmPrinter/DwarfFile.h
>   lib/CodeGen/CMakeLists.txt
>   lib/CodeGen/DwarfGenerator.cpp
>   lib/CodeGen/DwarfGenerator.h
>   lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp
>   unittests/DebugInfo/DWARF/CMakeLists.txt
>   unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
> 



More information about the llvm-commits mailing list