summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-08-01 12:53:06 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-08-01 12:53:06 +0000
commit8acb74e01f1095f028bb19d3cd157687ddf173cc (patch)
tree3981de30ab746bdad08cb14482be2bd4d0894e01 /llvm/lib/CodeGen
parent59dad0f7cd90fc2d19ffcc98a3cb8f7b7d715609 (diff)
downloadbcm5719-llvm-8acb74e01f1095f028bb19d3cd157687ddf173cc.tar.gz
bcm5719-llvm-8acb74e01f1095f028bb19d3cd157687ddf173cc.zip
[MC] Report fatal error for DWARF types for non-ELF object files
Getting the DWARF types section is only implemented for ELF object files. We already disabled emitting debug types in clang (r337717), but now we also report an fatal error (rather than crashing) when trying to obtain this section in MC. Additionally we ignore the generate debug types flag for unsupported target triples. See PR38190 for more information. Differential revision: https://reviews.llvm.org/D50057 llvm-svn: 338527
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 0af408ae599..500e7a00196 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -364,7 +364,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
else
UseSectionsAsReferences = DwarfSectionsAsReferences == Enable;
- GenerateTypeUnits = GenerateDwarfTypeUnits;
+ // Don't generate type units for unsupported object file formats.
+ GenerateTypeUnits =
+ A->TM.getTargetTriple().isOSBinFormatELF() && GenerateDwarfTypeUnits;
TheAccelTableKind = computeAccelTableKind(
DwarfVersion, GenerateTypeUnits, DebuggerTuning, A->TM.getTargetTriple());
OpenPOWER on IntegriCloud