summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-08-05 06:33:52 +0000
committerFangrui Song <maskray@google.com>2019-08-05 06:33:52 +0000
commitdb26488bf9263f62ec9938d7e6ea3acf8cae6725 (patch)
tree64f242a805a5d2079cc9eef4664721026d9ab7fa
parentd9b948b6eb7362f36264b71795dab179906e36be (diff)
downloadbcm5719-llvm-db26488bf9263f62ec9938d7e6ea3acf8cae6725.tar.gz
bcm5719-llvm-db26488bf9263f62ec9938d7e6ea3acf8cae6725.zip
[DWARF] Change DWARFDebugLoc::Entry::Loc from SmallVector<char, 4> to SmallString<4>
SmallString has a conversion to StringRef, which can be leveraged to simplify two use sites. llvm-svn: 367801
-rw-r--r--llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h2
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
index cced6048e81..3e7cc35d2ce 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
+++ b/llvm/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<char, 4> Loc;
+ SmallString<4> Loc;
};
/// A list of locations that contain one variable.
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index bc36d32ef19..4fc9d841d65 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud