Rename WinCodeViewLineTables to CodeViewDebug, similar to DwarfDebug

Soon it will be responsible for more than line tables.

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D16199

llvm-svn: 257792
This commit is contained in:
Reid Kleckner 2016-01-14 19:25:04 +00:00
parent 813c0f745c
commit 70f5bc99b6
4 changed files with 20 additions and 20 deletions

View File

@ -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 @@ bool AsmPrinter::doInitialization(Module &M) {
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));
}

View File

@ -20,7 +20,7 @@ add_llvm_library(LLVMAsmPrinter
ErlangGCPrinter.cpp
OcamlGCPrinter.cpp
WinException.cpp
WinCodeViewLineTables.cpp
CodeViewDebug.cpp
)
add_dependencies(LLVMAsmPrinter intrinsics_gen)

View File

@ -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 @@ using namespace llvm::codeview;
namespace llvm {
StringRef WinCodeViewLineTables::getFullFilepath(const MDNode *S) {
StringRef CodeViewDebug::getFullFilepath(const MDNode *S) {
assert(S);
assert((isa<DICompileUnit>(S) || isa<DIFile>(S) || isa<DISubprogram>(S) ||
isa<DILexicalBlockBase>(S)) &&
@ -81,7 +81,7 @@ StringRef WinCodeViewLineTables::getFullFilepath(const MDNode *S) {
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 @@ void WinCodeViewLineTables::maybeRecordLocation(DebugLoc DL,
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 @@ WinCodeViewLineTables::WinCodeViewLineTables(AsmPrinter *AP)
Asm = AP;
}
void WinCodeViewLineTables::endModule() {
void CodeViewDebug::endModule() {
if (FnDebugInfo.empty())
return;
@ -195,7 +195,7 @@ static void EmitLabelDiff(MCStreamer &Streamer,
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 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
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::beginFunction(const MachineFunction *MF) {
}
}
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 @@ void WinCodeViewLineTables::endFunction(const MachineFunction *MF) {
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;

View File

@ -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 @@ class LLVM_LIBRARY_VISIBILITY WinCodeViewLineTables : public AsmPrinterHandler {
void emitDebugInfoForFunction(const Function *GV);
public:
WinCodeViewLineTables(AsmPrinter *Asm);
CodeViewDebug(AsmPrinter *Asm);
void setSymbolSize(const llvm::MCSymbol *, uint64_t) override {}