aboutsummaryrefslogtreecommitdiff
path: root/lib/DebugInfo
diff options
context:
space:
mode:
authorLuke Cheeseman <luke.cheeseman@arm.com>2018-11-23 17:13:06 +0000
committerLuke Cheeseman <luke.cheeseman@arm.com>2018-11-23 17:13:06 +0000
commitc8ecb42041221328d72bdb7d3c69b351c37ea352 (patch)
treef764072caf14168162cf4faa52f01e1d2d370f33 /lib/DebugInfo
parenta21de3bd5b6e990512cb72a841213bb96a2695d6 (diff)
downloadllvm-c8ecb42041221328d72bdb7d3c69b351c37ea352.tar.gz
Revert r347490 as it breaks address sanitizer builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARF/DWARFContext.cpp14
-rw-r--r--lib/DebugInfo/DWARF/DWARFDebugFrame.cpp13
2 files changed, 10 insertions, 17 deletions
diff --git a/lib/DebugInfo/DWARF/DWARFContext.cpp b/lib/DebugInfo/DWARF/DWARFContext.cpp
index 35c3f59b3f4..e330ce221b2 100644
--- a/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -767,7 +767,7 @@ const DWARFDebugFrame *DWARFContext::getDebugFrame() {
// http://lists.dwarfstd.org/htdig.cgi/dwarf-discuss-dwarfstd.org/2011-December/001173.html
DWARFDataExtractor debugFrameData(DObj->getDebugFrameSection(),
isLittleEndian(), DObj->getAddressSize());
- DebugFrame.reset(new DWARFDebugFrame(Arch, false /* IsEH */));
+ DebugFrame.reset(new DWARFDebugFrame(false /* IsEH */));
DebugFrame->parse(debugFrameData);
return DebugFrame.get();
}
@@ -778,7 +778,7 @@ const DWARFDebugFrame *DWARFContext::getEHFrame() {
DWARFDataExtractor debugFrameData(DObj->getEHFrameSection(), isLittleEndian(),
DObj->getAddressSize());
- DebugFrame.reset(new DWARFDebugFrame(Arch, true /* IsEH */));
+ DebugFrame.reset(new DWARFDebugFrame(true /* IsEH */));
DebugFrame->parse(debugFrameData);
return DebugFrame.get();
}
@@ -1644,11 +1644,7 @@ DWARFContext::create(const object::ObjectFile &Obj, const LoadedObjectInfo *L,
function_ref<ErrorPolicy(Error)> HandleError,
std::string DWPName) {
auto DObj = llvm::make_unique<DWARFObjInMemory>(Obj, L, HandleError);
- std::unique_ptr<DWARFContext> Ctx =
- llvm::make_unique<DWARFContext>(std::move(DObj), std::move(DWPName));
- logAllUnhandledErrors(Ctx->loadArchitectureInfo(Obj), errs(),
- Obj.getFileName() + ": ");
- return Ctx;
+ return llvm::make_unique<DWARFContext>(std::move(DObj), std::move(DWPName));
}
std::unique_ptr<DWARFContext>
@@ -1659,11 +1655,9 @@ DWARFContext::create(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
return llvm::make_unique<DWARFContext>(std::move(DObj), "");
}
-Error DWARFContext::loadArchitectureInfo(const object::ObjectFile &Obj) {
+Error DWARFContext::loadRegisterInfo(const object::ObjectFile &Obj) {
// Detect the architecture from the object file. We usually don't need OS
// info to lookup a target and create register info.
- Arch = Triple::ArchType(Obj.getArch());
-
Triple TT;
TT.setArch(Triple::ArchType(Obj.getArch()));
TT.setVendor(Triple::UnknownVendor);
diff --git a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
index d85ab6bd8a5..d725255fe4c 100644
--- a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
+++ b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
@@ -225,7 +225,7 @@ void CFIProgram::printOperand(raw_ostream &OS, const MCRegisterInfo *MRI,
switch (Type) {
case OT_Unset: {
OS << " Unsupported " << (OperandIdx ? "second" : "first") << " operand to";
- auto OpcodeName = CallFrameString(Opcode, Arch);
+ auto OpcodeName = CallFrameString(Opcode);
if (!OpcodeName.empty())
OS << " " << OpcodeName;
else
@@ -279,7 +279,7 @@ void CFIProgram::dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH,
if (Opcode & DWARF_CFI_PRIMARY_OPCODE_MASK)
Opcode &= DWARF_CFI_PRIMARY_OPCODE_MASK;
OS.indent(2 * IndentLevel);
- OS << CallFrameString(Opcode, Arch) << ":";
+ OS << CallFrameString(Opcode) << ":";
for (unsigned i = 0; i < Instr.Ops.size(); ++i)
printOperand(OS, MRI, IsEH, Instr, i, Instr.Ops[i]);
OS << '\n';
@@ -325,9 +325,8 @@ void FDE::dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH) const {
OS << "\n";
}
-DWARFDebugFrame::DWARFDebugFrame(Triple::ArchType Arch,
- bool IsEH, uint64_t EHFrameAddress)
- : Arch(Arch), IsEH(IsEH), EHFrameAddress(EHFrameAddress) {}
+DWARFDebugFrame::DWARFDebugFrame(bool IsEH, uint64_t EHFrameAddress)
+ : IsEH(IsEH), EHFrameAddress(EHFrameAddress) {}
DWARFDebugFrame::~DWARFDebugFrame() = default;
@@ -461,7 +460,7 @@ void DWARFDebugFrame::parse(DWARFDataExtractor Data) {
StartOffset, Length, Version, AugmentationString, AddressSize,
SegmentDescriptorSize, CodeAlignmentFactor, DataAlignmentFactor,
ReturnAddressRegister, AugmentationData, FDEPointerEncoding,
- LSDAPointerEncoding, Personality, PersonalityEncoding, Arch);
+ LSDAPointerEncoding, Personality, PersonalityEncoding);
CIEs[StartOffset] = Cie.get();
Entries.emplace_back(std::move(Cie));
} else {
@@ -513,7 +512,7 @@ void DWARFDebugFrame::parse(DWARFDataExtractor Data) {
Entries.emplace_back(new FDE(StartOffset, Length, CIEPointer,
InitialLocation, AddressRange,
- Cie, LSDAAddress, Arch));
+ Cie, LSDAAddress));
}
if (Error E =