summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2018-03-28 12:36:46 +0000
committerAlexander Potapenko <glider@google.com>2018-03-28 12:36:46 +0000
commit202f8094372e51e120629f7a5d04993455d36ad7 (patch)
tree6c8898775f36e92d2ce0b1776f19a2cd5d088d03 /llvm/lib/CodeGen/AsmPrinter
parent5076b98fb91b5befd592cbcf220b0de28855fc59 (diff)
downloadbcm5719-llvm-202f8094372e51e120629f7a5d04993455d36ad7.tar.gz
bcm5719-llvm-202f8094372e51e120629f7a5d04993455d36ad7.zip
Revert "Reapply "[DWARFv5] Emit file 0 to the line table.""
This reverts commit r328676. Commit r328676 broke the -no-integrated-as flag necessary to build Linux kernel with Clang: $ cat t.c void foo() {} $ clang -no-integrated-as -c t.c -g /tmp/t-dcdec5.s: Assembler messages: /tmp/t-dcdec5.s:8: Error: file number less than one clang-7.0: error: assembler command failed with exit code 1 (use -v to see invocation) llvm-svn: 328699
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp11
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h8
3 files changed, 9 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 0398d0f4c97..024472db87c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -499,9 +499,8 @@ DwarfDebug::getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit) {
// explicitly describe the directory of all files, never relying on the
// compilation directory.
if (!Asm->OutStreamer->hasRawTextSupport() || SingleCU)
- Asm->OutStreamer->emitDwarfFile0Directive(
- CompilationDir, FN, NewCU.getMD5AsBytes(DIUnit->getFile()),
- DIUnit->getSource(), NewCU.getUniqueID());
+ Asm->OutStreamer->getContext().setMCLineTableCompilationDir(
+ NewCU.getUniqueID(), CompilationDir);
StringRef Producer = DIUnit->getProducer();
StringRef Flags = DIUnit->getFlags();
@@ -2149,10 +2148,8 @@ void DwarfDebug::emitDebugStrDWO() {
MCDwarfDwoLineTable *DwarfDebug::getDwoLineTable(const DwarfCompileUnit &CU) {
if (!useSplitDwarf())
return nullptr;
- const DICompileUnit *DIUnit = CU.getCUNode();
- SplitTypeUnitFileTable.maybeSetRootFile(
- DIUnit->getDirectory(), DIUnit->getFilename(),
- CU.getMD5AsBytes(DIUnit->getFile()), DIUnit->getSource());
+ if (SingleCU)
+ SplitTypeUnitFileTable.setCompilationDir(CU.getCUNode()->getDirectory());
return &SplitTypeUnitFileTable;
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index a0cd34ea76f..811112a0430 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -282,7 +282,7 @@ void DwarfUnit::addSectionOffset(DIE &Die, dwarf::Attribute Attribute,
addUInt(Die, Attribute, dwarf::DW_FORM_data4, Integer);
}
-MD5::MD5Result *DwarfUnit::getMD5AsBytes(const DIFile *File) const {
+MD5::MD5Result *DwarfUnit::getMD5AsBytes(const DIFile *File) {
assert(File);
Optional<DIFile::ChecksumInfo<StringRef>> Checksum = File->getChecksum();
if (!Checksum || Checksum->Kind != DIFile::CSK_MD5)
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
index c1d46173567..328e3549e05 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -306,10 +306,6 @@ public:
const MCSymbol *Label,
const MCSymbol *Sec);
- /// If the \p File has an MD5 checksum, return it as an MD5Result
- /// allocated in the MCContext.
- MD5::MD5Result *getMD5AsBytes(const DIFile *File) const;
-
protected:
~DwarfUnit();
@@ -320,6 +316,10 @@ protected:
/// create a new ID and insert it in the line table.
virtual unsigned getOrCreateSourceID(const DIFile *File) = 0;
+ /// If the \p File has an MD5 checksum, return it as an MD5Result
+ /// allocated in the MCContext.
+ MD5::MD5Result *getMD5AsBytes(const DIFile *File);
+
/// Look in the DwarfDebug map for the MDNode that corresponds to the
/// reference.
template <typename T> T *resolve(TypedDINodeRef<T> Ref) const {
OpenPOWER on IntegriCloud