diff options
author | Pavel Labath <pavel@labath.sk> | 2019-11-20 15:13:34 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-11-20 15:15:22 +0100 |
commit | 72d2929c52a9b691a2ed10c28a0a27fec8282519 (patch) | |
tree | 2d61b0011ba2af2fe6dbc629d23e9b3ccb57c675 /llvm/lib | |
parent | e7cc833ddafdca10be4ef1322ab96ffee774045b (diff) | |
download | bcm5719-llvm-72d2929c52a9b691a2ed10c28a0a27fec8282519.tar.gz bcm5719-llvm-72d2929c52a9b691a2ed10c28a0a27fec8282519.zip |
Revert "[DWARF] Add an api to get "interpreted" location lists"
The test fails on big endian machines.
This reverts commit 089c0f581492cd6e2a3d2927be3fbf60ea2d7e62 and the
subsequent attempt to fix in 82dc32e2d456c75d08bc9ffe97def409ee5a03cd.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 15 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 21 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 24 | ||||
-rw-r--r-- | llvm/lib/ObjectYAML/DWARFEmitter.cpp | 5 |
4 files changed, 1 insertions, 64 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index 8b84822914d..1af51a85d18 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -151,21 +151,6 @@ bool DWARFLocationTable::dumpLocationList(uint64_t *Offset, raw_ostream &OS, return true; } -Error DWARFLocationTable::visitAbsoluteLocationList( - uint64_t Offset, Optional<SectionedAddress> BaseAddr, - std::function<Optional<SectionedAddress>(uint32_t)> LookupAddr, - function_ref<bool(Expected<DWARFLocationExpression>)> Callback) const { - DWARFLocationInterpreter Interp(BaseAddr, std::move(LookupAddr)); - return visitLocationList(&Offset, [&](const DWARFLocationEntry &E) { - Expected<Optional<DWARFLocationExpression>> Loc = Interp.Interpret(E); - if (!Loc) - return Callback(Loc.takeError()); - if (*Loc) - return Callback(**Loc); - return true; - }); -} - DWARFDebugLoc::LocationList const * DWARFDebugLoc::getLocationListAtOffset(uint64_t Offset) const { auto It = partition_point( diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index 6cf30270539..a11865e048c 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -486,27 +486,6 @@ bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const { return false; } -Expected<DWARFLocationExpressionsVector> -DWARFDie::getLocations(dwarf::Attribute Attr) const { - Optional<DWARFFormValue> Location = find(Attr); - if (!Location) - return createStringError(inconvertibleErrorCode(), "No %s", - dwarf::AttributeString(Attr).data()); - - if (Optional<uint64_t> Off = Location->getAsSectionOffset()) - return U->findLoclistFromOffset(*Off); - - if (Optional<ArrayRef<uint8_t>> Expr = Location->getAsBlock()) { - return DWARFLocationExpressionsVector{ - DWARFLocationExpression{None, to_vector<4>(*Expr)}}; - } - - return createStringError( - inconvertibleErrorCode(), "Unsupported %s encoding: %s", - dwarf::AttributeString(Attr).data(), - dwarf::FormEncodingString(Location->getForm()).data()); -} - const char *DWARFDie::getSubroutineName(DINameKind Kind) const { if (!isSubroutineDIE()) return nullptr; diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp index e5d33e13644..2eb7d2f945a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -637,30 +637,6 @@ Expected<DWARFAddressRangesVector> DWARFUnit::collectAddressRanges() { return *CUDIERangesOrError; } -Expected<DWARFLocationExpressionsVector> -DWARFUnit::findLoclistFromOffset(uint64_t Offset) { - DWARFLocationExpressionsVector Result; - - Error InterpretationError = Error::success(); - - Error ParseError = getLocationTable().visitAbsoluteLocationList( - Offset, getBaseAddress(), - [this](uint32_t Index) { return getAddrOffsetSectionItem(Index); }, - [&](Expected<DWARFLocationExpression> L) { - if (L) - Result.push_back(std::move(*L)); - else - InterpretationError = - joinErrors(L.takeError(), std::move(InterpretationError)); - return !InterpretationError; - }); - - if (ParseError || InterpretationError) - return joinErrors(std::move(ParseError), std::move(InterpretationError)); - - return Result; -} - void DWARFUnit::updateAddressDieMap(DWARFDie Die) { if (Die.isSubroutineDIE()) { auto DIERangesOrError = Die.getAddressRanges(); diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp index b410fed16f0..2ae66997cf5 100644 --- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp +++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp @@ -314,10 +314,7 @@ public: DIEFixupVisitor(DWARFYAML::Data &DI) : DWARFYAML::Visitor(DI){}; private: - virtual void onStartCompileUnit(DWARFYAML::Unit &CU) { - // Size of the unit header, excluding the length field itself. - Length = CU.Version >= 5 ? 8 : 7; - } + virtual void onStartCompileUnit(DWARFYAML::Unit &CU) { Length = 7; } virtual void onEndCompileUnit(DWARFYAML::Unit &CU) { CU.Length.setLength(Length); |