summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/CompileUnit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/dsymutil/CompileUnit.cpp')
-rw-r--r--llvm/tools/dsymutil/CompileUnit.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/dsymutil/CompileUnit.cpp b/llvm/tools/dsymutil/CompileUnit.cpp
index 670591a9436..036c61a6b92 100644
--- a/llvm/tools/dsymutil/CompileUnit.cpp
+++ b/llvm/tools/dsymutil/CompileUnit.cpp
@@ -22,6 +22,14 @@ static bool inFunctionScope(CompileUnit &U, unsigned Idx) {
return false;
}
+uint16_t CompileUnit::getLanguage() {
+ if (!Language) {
+ DWARFDie CU = getOrigUnit().getUnitDIE();
+ Language = dwarf::toUnsigned(CU.find(dwarf::DW_AT_language), 0);
+ }
+ return Language;
+}
+
void CompileUnit::markEverythingAsKept() {
unsigned Idx = 0;
OpenPOWER on IntegriCloud