summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-01-29 00:49:42 +0000
committerReid Kleckner <rnk@google.com>2016-01-29 00:49:42 +0000
commit2214ed8937a05b9457b167a84d6732a448fad27f (patch)
tree8418d7840e286b16568c7f6c3301757fbd92771e /llvm/lib/MC/MCContext.cpp
parent0407108020ed12d8c34582d847d2c37cd68d1d0b (diff)
downloadbcm5719-llvm-2214ed8937a05b9457b167a84d6732a448fad27f.tar.gz
bcm5719-llvm-2214ed8937a05b9457b167a84d6732a448fad27f.zip
Reland "[CodeView] Use assembler directives for line tables"
This reverts commit r259126 and relands r259117. This time with updated library dependencies. llvm-svn: 259130
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index b5ad518d033..c5243ef62c9 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -12,6 +12,7 @@
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCCodeView.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCLabel.h"
#include "llvm/MC/MCObjectFileInfo.h"
@@ -90,6 +91,8 @@ void MCContext::reset() {
DwarfCompileUnitID = 0;
CurrentDwarfLoc = MCDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0);
+ CVContext.reset();
+
MachOUniquingMap.clear();
ELFUniquingMap.clear();
COFFUniquingMap.clear();
@@ -474,6 +477,20 @@ void MCContext::finalizeDwarfSections(MCStreamer &MCOS) {
[&](MCSection *Sec) { return !MCOS.mayHaveInstructions(*Sec); });
}
+CodeViewContext &MCContext::getCVContext() {
+ if (!CVContext.get())
+ CVContext.reset(new CodeViewContext);
+ return *CVContext.get();
+}
+
+unsigned MCContext::getCVFile(StringRef FileName, unsigned FileNumber) {
+ return getCVContext().addFile(FileNumber, FileName) ? FileNumber : 0;
+}
+
+bool MCContext::isValidCVFileNumber(unsigned FileNumber) {
+ return getCVContext().isValidFileNumber(FileNumber);
+}
+
//===----------------------------------------------------------------------===//
// Error Reporting
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud