//
//===----------------------------------------------------------------------===//
-#ifndef CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H__
-#define CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H__
+#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H
+#define LLVM_LIB_CODEGEN_ASMPRINTER_WINCODEVIEWLINETABLES_H
#include "AsmPrinterHandler.h"
#include "llvm/ADT/DenseMap.h"
namespace llvm {
/// \brief Collects and handles line tables information in a CodeView format.
-class WinCodeViewLineTables : public AsmPrinterHandler {
+class LLVM_LIBRARY_VISIBILITY WinCodeViewLineTables : public AsmPrinterHandler {
AsmPrinter *Asm;
DebugLoc PrevInstLoc;
- LexicalScopes LScopes;
// For each function, store a vector of labels to its instructions, as well as
// to the end of the function.
struct FunctionInfo {
SmallVector<MCSymbol *, 10> Instrs;
MCSymbol *End;
+ FunctionInfo() : End(nullptr) {}
} *CurFn;
typedef DenseMap<const Function *, FunctionInfo> FnDebugInfoTy;
struct InstrInfoTy {
StringRef Filename;
unsigned LineNumber;
+ unsigned ColumnNumber;
- InstrInfoTy() : LineNumber(0) {}
+ InstrInfoTy() : LineNumber(0), ColumnNumber(0) {}
- InstrInfoTy(StringRef Filename, unsigned LineNumber)
- : Filename(Filename), LineNumber(LineNumber) {}
+ InstrInfoTy(StringRef Filename, unsigned LineNumber, unsigned ColumnNumber)
+ : Filename(Filename), LineNumber(LineNumber),
+ ColumnNumber(ColumnNumber) {}
};
DenseMap<MCSymbol *, InstrInfoTy> InstrInfo;
}
} FileNameRegistry;
- typedef std::map<std::pair<StringRef, StringRef>, char *>
+ typedef std::map<std::pair<StringRef, StringRef>, std::string>
DirAndFilenameToFilepathMapTy;
DirAndFilenameToFilepathMapTy DirAndFilenameToFilepathMap;
StringRef getFullFilepath(const MDNode *S);
void maybeRecordLocation(DebugLoc DL, const MachineFunction *MF);
void clear() {
- assert(CurFn == 0);
+ assert(CurFn == nullptr);
FileNameRegistry.clear();
InstrInfo.clear();
}
public:
WinCodeViewLineTables(AsmPrinter *Asm);
- ~WinCodeViewLineTables() {
- for (DirAndFilenameToFilepathMapTy::iterator
- I = DirAndFilenameToFilepathMap.begin(),
- E = DirAndFilenameToFilepathMap.end();
- I != E; ++I)
- free(I->second);
- }
-
- virtual void setSymbolSize(const llvm::MCSymbol *, uint64_t) {}
+ void setSymbolSize(const llvm::MCSymbol *, uint64_t) override {}
/// \brief Emit the COFF section that holds the line table information.
- virtual void endModule();
+ void endModule() override;
/// \brief Gather pre-function debug information.
- virtual void beginFunction(const MachineFunction *MF);
+ void beginFunction(const MachineFunction *MF) override;
/// \brief Gather post-function debug information.
- virtual void endFunction(const MachineFunction *);
+ void endFunction(const MachineFunction *) override;
/// \brief Process beginning of an instruction.
- virtual void beginInstruction(const MachineInstr *MI);
+ void beginInstruction(const MachineInstr *MI) override;
/// \brief Process end of an instruction.
- virtual void endInstruction() {}
+ void endInstruction() override {}
};
} // End of namespace llvm