Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -15,7 +15,7 @@ #include "DwarfDebug.h" #include "DwarfException.h" #include "WinException.h" -#include "WinCodeViewLineTables.h" +#include "CodeViewDebug.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/ConstantFolding.h" @@ -248,7 +248,7 @@ if (MAI->doesSupportDebugInformation()) { bool EmitCodeView = MMI->getModule()->getCodeViewFlag(); if (EmitCodeView && TM.getTargetTriple().isKnownWindowsMSVCEnvironment()) { - Handlers.push_back(HandlerInfo(new WinCodeViewLineTables(this), + Handlers.push_back(HandlerInfo(new CodeViewDebug(this), DbgTimerName, CodeViewLineTablesGroupName)); } Index: lib/CodeGen/AsmPrinter/CMakeLists.txt =================================================================== --- lib/CodeGen/AsmPrinter/CMakeLists.txt +++ lib/CodeGen/AsmPrinter/CMakeLists.txt @@ -20,7 +20,7 @@ ErlangGCPrinter.cpp OcamlGCPrinter.cpp WinException.cpp - WinCodeViewLineTables.cpp + CodeViewDebug.cpp ) add_dependencies(LLVMAsmPrinter intrinsics_gen) Index: lib/CodeGen/AsmPrinter/CodeViewDebug.h =================================================================== --- lib/CodeGen/AsmPrinter/CodeViewDebug.h +++ lib/CodeGen/AsmPrinter/CodeViewDebug.h @@ -1,4 +1,4 @@ -//===-- llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.h ----*- C++ -*--===// +//===-- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h ----*- C++ -*--===// // // The LLVM Compiler Infrastructure // @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// // -// This file contains support for writing line tables info into COFF files. +// This file contains support for writing Microsoft CodeView debug info. // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H -#define LLVM_LIB_CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H +#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H +#define LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H #include "AsmPrinterHandler.h" #include "llvm/ADT/DenseMap.h" @@ -29,7 +29,7 @@ namespace llvm { /// \brief Collects and handles line tables information in a CodeView format. -class LLVM_LIBRARY_VISIBILITY WinCodeViewLineTables : public AsmPrinterHandler { +class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public AsmPrinterHandler { AsmPrinter *Asm; DebugLoc PrevInstLoc; @@ -114,7 +114,7 @@ void emitDebugInfoForFunction(const Function *GV); public: - WinCodeViewLineTables(AsmPrinter *Asm); + CodeViewDebug(AsmPrinter *Asm); void setSymbolSize(const llvm::MCSymbol *, uint64_t) override {} Index: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp =================================================================== --- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1,4 +1,4 @@ -//===-- llvm/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp --*- C++ -*--===// +//===-- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --*- C++ -*--===// // // The LLVM Compiler Infrastructure // @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// // -// This file contains support for writing line tables info into COFF files. +// This file contains support for writing Microsoft CodeView debug info. // //===----------------------------------------------------------------------===// -#include "WinCodeViewLineTables.h" +#include "CodeViewDebug.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/SymbolRecord.h" #include "llvm/MC/MCExpr.h" @@ -22,7 +22,7 @@ namespace llvm { -StringRef WinCodeViewLineTables::getFullFilepath(const MDNode *S) { +StringRef CodeViewDebug::getFullFilepath(const MDNode *S) { assert(S); assert((isa(S) || isa(S) || isa(S) || isa(S)) && @@ -81,7 +81,7 @@ return Filepath; } -void WinCodeViewLineTables::maybeRecordLocation(DebugLoc DL, +void CodeViewDebug::maybeRecordLocation(DebugLoc DL, const MachineFunction *MF) { const MDNode *Scope = DL.getScope(); if (!Scope) @@ -114,7 +114,7 @@ InstrInfo[MCL] = InstrInfoTy(Filename, LineNumber, ColumnNumber); } -WinCodeViewLineTables::WinCodeViewLineTables(AsmPrinter *AP) +CodeViewDebug::CodeViewDebug(AsmPrinter *AP) : Asm(nullptr), CurFn(nullptr) { MachineModuleInfo *MMI = AP->MMI; @@ -129,7 +129,7 @@ Asm = AP; } -void WinCodeViewLineTables::endModule() { +void CodeViewDebug::endModule() { if (FnDebugInfo.empty()) return; @@ -195,7 +195,7 @@ Streamer.EmitValue(AddrDelta, Size); } -void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) { +void CodeViewDebug::emitDebugInfoForFunction(const Function *GV) { // For each function there is a separate subsection // which holds the PC to file:line table. const MCSymbol *Fn = Asm->getSymbol(GV); @@ -347,7 +347,7 @@ Asm->OutStreamer->EmitLabel(LineTableEnd); } -void WinCodeViewLineTables::beginFunction(const MachineFunction *MF) { +void CodeViewDebug::beginFunction(const MachineFunction *MF) { assert(!CurFn && "Can't process two functions at once!"); if (!Asm || !Asm->MMI->hasDebugInfo()) @@ -387,7 +387,7 @@ } } -void WinCodeViewLineTables::endFunction(const MachineFunction *MF) { +void CodeViewDebug::endFunction(const MachineFunction *MF) { if (!Asm || !CurFn) // We haven't created any debug info for this function. return; @@ -404,7 +404,7 @@ CurFn = nullptr; } -void WinCodeViewLineTables::beginInstruction(const MachineInstr *MI) { +void CodeViewDebug::beginInstruction(const MachineInstr *MI) { // Ignore DBG_VALUE locations and function prologue. if (!Asm || MI->isDebugValue() || MI->getFlag(MachineInstr::FrameSetup)) return; Index: tools/llvm-readobj/COFFDumper.cpp =================================================================== --- tools/llvm-readobj/COFFDumper.cpp +++ tools/llvm-readobj/COFFDumper.cpp @@ -1053,7 +1053,7 @@ StringRef LinkageName; error(resolveSymbolName(Obj->getCOFFSection(Section), SectionOffset, LinkageName)); - if (!FunctionFrameData.emplace(LinkageName, FD).second) { + if (!FunctionFrameData.insert(std::make_pair(LinkageName, FD)).second) { error(object_error::parse_failed); return; }