summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-11-02 08:51:37 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-11-02 08:51:37 +0000
commitcafd962d97166164328fc21bc813f19e321a1049 (patch)
tree2536d8658e868de0957d52508358a66fc178a353 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent279c451c0bf0be07255c152bd78f952641b158c4 (diff)
downloadbcm5719-llvm-cafd962d97166164328fc21bc813f19e321a1049.tar.gz
bcm5719-llvm-cafd962d97166164328fc21bc813f19e321a1049.zip
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. llvm-svn: 221094
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 485ea34dc5c..13b3fda9380 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -836,4 +836,8 @@ void DwarfCompileUnit::applySubprogramAttributesToDefinition(DISubprogram SP,
DIBuilder::LineTablesOnly);
addGlobalName(SP.getName(), SPDie, Context);
}
+
+bool DwarfCompileUnit::isDwoUnit() const {
+ return DD->useSplitDwarf() && Skeleton;
+}
} // end llvm namespace
OpenPOWER on IntegriCloud