From 6183bab46633394a7b02d295f90a8ac2af12a018 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 5 Aug 2019 06:33:52 +0000 Subject: [PATCH] [DWARF] Change DWARFDebugLoc::Entry::Loc from SmallVector to SmallString<4> SmallString has a conversion to StringRef, which can be leveraged to simplify two use sites. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367801 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h | 2 +- lib/DebugInfo/DWARF/DWARFVerifier.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h b/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h index cced6048e81..3e7cc35d2ce 100644 --- a/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h +++ b/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h @@ -29,7 +29,7 @@ public: /// The ending address of the instruction range. uint64_t End; /// The location of the variable within the specified range. - SmallVector Loc; + SmallString<4> Loc; }; /// A list of locations that contain one variable. diff --git a/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/lib/DebugInfo/DWARF/DWARFVerifier.cpp index bc36d32ef19..4fc9d841d65 100644 --- a/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ b/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -485,7 +485,7 @@ unsigned DWARFVerifier::verifyDebugInfoAttribute(const DWARFDie &Die, if (auto DebugLoc = DCtx.getDebugLoc()) if (auto LocList = DebugLoc->getLocationListAtOffset(*LocOffset)) for (const auto &Entry : LocList->Entries) - VerifyLocationExpr({Entry.Loc.data(), Entry.Loc.size()}); + VerifyLocationExpr(Entry.Loc); } break; } @@ -1297,7 +1297,7 @@ static bool isVariableIndexable(const DWARFDie &Die, DWARFContext &DCtx) { if (const DWARFDebugLoc::LocationList *LocList = DebugLoc->getLocationListAtOffset(*Offset)) { if (any_of(LocList->Entries, [&](const DWARFDebugLoc::Entry &E) { - return ContainsInterestingOperators({E.Loc.data(), E.Loc.size()}); + return ContainsInterestingOperators(E.Loc); })) return true; } -- 2.40.0