Add DwarfUnit::isDwoUnit and use it to generalize string creation
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 08:51:37 +0000 (08:51 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 08:51:37 +0000 (08:51 +0000)
commit67177d320d9f12575b9a0ceed461a8c056d27518
treecf371972e002b31cade7fb03aba50bcecaba9bfe
parent1fcc568ebb4b859beeeea2dadfe98a36547f9c57
Add DwarfUnit::isDwoUnit and use it to generalize string creation

Currently we only need to emit skeleton strings into the CU header and
we do this by explicitly calling "addLocalString". With gmlt-in-fission,
we'll be emitting a bunch of other strings from other codepaths where
it's not statically known that these strings will be local or not.

Introduce a virtual function to indicate whether this unit is a DWO unit
or not (I'm not sure if we have a good term for this, the
opposite/alternative to 'skeleton' unit) and use that to generalize the
string emission logic so that strings can be correctly emitted in both
the skeleton and dwo unit when in split dwarf mode.

And to demonstrate that this works, switch the existing special callers
of addLocalString in the skeleton builder to addString - and they still
work. Yay.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221094 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h