summaryrefslogtreecommitdiff
path: root/bolt/lib/Core/BinaryContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Core/BinaryContext.cpp')
-rw-r--r--bolt/lib/Core/BinaryContext.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index da59a188c6b6..23a5a65c2c5f 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -207,7 +207,7 @@ Expected<std::unique_ptr<BinaryContext>> BinaryContext::createBinaryContext(
Twine("BOLT-ERROR: ", Error));
std::unique_ptr<const MCRegisterInfo> MRI(
- TheTarget->createMCRegInfo(TripleName));
+ TheTarget->createMCRegInfo(TheTriple));
if (!MRI)
return createStringError(
make_error_code(std::errc::not_supported),
@@ -215,7 +215,7 @@ Expected<std::unique_ptr<BinaryContext>> BinaryContext::createBinaryContext(
// Set up disassembler.
std::unique_ptr<MCAsmInfo> AsmInfo(
- TheTarget->createMCAsmInfo(*MRI, TripleName, MCTargetOptions()));
+ TheTarget->createMCAsmInfo(*MRI, TheTriple, MCTargetOptions()));
if (!AsmInfo)
return createStringError(
make_error_code(std::errc::not_supported),
@@ -227,7 +227,7 @@ Expected<std::unique_ptr<BinaryContext>> BinaryContext::createBinaryContext(
AsmInfo->setAllowAtInName(true);
std::unique_ptr<const MCSubtargetInfo> STI(
- TheTarget->createMCSubtargetInfo(TripleName, "", FeaturesStr));
+ TheTarget->createMCSubtargetInfo(TheTriple, "", FeaturesStr));
if (!STI)
return createStringError(
make_error_code(std::errc::not_supported),
@@ -1568,23 +1568,19 @@ unsigned BinaryContext::addDebugFilenameToUnit(const uint32_t DestCUID,
DWARFCompileUnit *SrcUnit = DwCtx->getCompileUnitForOffset(SrcCUID);
const DWARFDebugLine::LineTable *LineTable =
DwCtx->getLineTableForUnit(SrcUnit);
- const std::vector<DWARFDebugLine::FileNameEntry> &FileNames =
- LineTable->Prologue.FileNames;
- // Dir indexes start at 1, as DWARF file numbers, and a dir index 0
+ const DWARFDebugLine::FileNameEntry &FileNameEntry =
+ LineTable->Prologue.getFileNameEntry(FileIndex);
+ // Dir indexes start at 1 and a dir index 0
// means empty dir.
- assert(FileIndex > 0 && FileIndex <= FileNames.size() &&
- "FileIndex out of range for the compilation unit.");
StringRef Dir = "";
- if (FileNames[FileIndex - 1].DirIdx != 0) {
+ if (FileNameEntry.DirIdx != 0) {
if (std::optional<const char *> DirName = dwarf::toString(
- LineTable->Prologue
- .IncludeDirectories[FileNames[FileIndex - 1].DirIdx - 1])) {
+ LineTable->Prologue.IncludeDirectories[FileNameEntry.DirIdx - 1])) {
Dir = *DirName;
}
}
StringRef FileName = "";
- if (std::optional<const char *> FName =
- dwarf::toString(FileNames[FileIndex - 1].Name))
+ if (std::optional<const char *> FName = dwarf::toString(FileNameEntry.Name))
FileName = *FName;
assert(FileName != "");
DWARFCompileUnit *DstUnit = DwCtx->getCompileUnitForOffset(DestCUID);
@@ -1925,7 +1921,7 @@ static void printDebugInfo(raw_ostream &OS, const MCInst &Instruction,
const DWARFDebugLine::Row &Row = LineTable->Rows[RowRef.RowIndex - 1];
StringRef FileName = "";
if (std::optional<const char *> FName =
- dwarf::toString(LineTable->Prologue.FileNames[Row.File - 1].Name))
+ dwarf::toString(LineTable->Prologue.getFileNameEntry(Row.File).Name))
FileName = *FName;
OS << " # debug line " << FileName << ":" << Row.Line;
if (Row.Column)