From 2ff866e5e8be34d143decc171068e720b416552d Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 12 Apr 2019 01:02:02 +0000 Subject: [PATCH] Remove a parameter that was being passed around that we had at the local callsite. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358244 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCDwarf.h | 3 +-- lib/MC/MCDwarf.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/llvm/MC/MCDwarf.h b/include/llvm/MC/MCDwarf.h index 3dc9cab512b..5b972109eb4 100644 --- a/include/llvm/MC/MCDwarf.h +++ b/include/llvm/MC/MCDwarf.h @@ -247,8 +247,7 @@ public: private: void emitV2FileDirTables(MCStreamer *MCOS) const; - void emitV5FileDirTables(MCStreamer *MCOS, Optional &LineStr, - StringRef CtxCompilationDir) const; + void emitV5FileDirTables(MCStreamer *MCOS, Optional &LineStr) const; }; class MCDwarfDwoLineTable { diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index f59d91d5c62..ebc45f4c427 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -378,8 +378,7 @@ static void emitOneV5FileEntry(MCStreamer *MCOS, const MCDwarfFile &DwarfFile, } void MCDwarfLineTableHeader::emitV5FileDirTables( - MCStreamer *MCOS, Optional &LineStr, - StringRef CtxCompilationDir) const { + MCStreamer *MCOS, Optional &LineStr) const { // The directory format, which is just a list of the directory paths. In a // non-split object, these are references to .debug_line_str; in a split // object, they are inline strings. @@ -389,8 +388,9 @@ void MCDwarfLineTableHeader::emitV5FileDirTables( : dwarf::DW_FORM_string); MCOS->EmitULEB128IntValue(MCDwarfDirs.size() + 1); // Try not to emit an empty compilation directory. - const StringRef CompDir = - CompilationDir.empty() ? CtxCompilationDir : StringRef(CompilationDir); + const StringRef CompDir = CompilationDir.empty() + ? MCOS->getContext().getCompilationDir() + : StringRef(CompilationDir); if (LineStr) { // Record path strings, emit references here. LineStr->emitRef(MCOS, CompDir); @@ -509,7 +509,7 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, // Put out the directory and file tables. The formats vary depending on // the version. if (LineTableVersion >= 5) - emitV5FileDirTables(MCOS, LineStr, context.getCompilationDir()); + emitV5FileDirTables(MCOS, LineStr); else emitV2FileDirTables(MCOS); -- 2.50.1