diff options
author | David Stenberg <david.stenberg@ericsson.com> | 2019-04-09 10:08:26 +0000 |
---|---|---|
committer | David Stenberg <david.stenberg@ericsson.com> | 2019-04-09 10:08:26 +0000 |
commit | 2028ae975c6aa65df3d89c10c95bf9b7baa5e0ab (patch) | |
tree | 179bf5622bdf3dfcc03db4a5be9e1706fccb14c2 /llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | |
parent | a30ba452c6725068c3f73175ee9938985f088d56 (diff) | |
download | bcm5719-llvm-2028ae975c6aa65df3d89c10c95bf9b7baa5e0ab.tar.gz bcm5719-llvm-2028ae975c6aa65df3d89c10c95bf9b7baa5e0ab.zip |
[DebugInfo] Pass all values in DebugLocEntry's constructor, NFC
Summary:
With MergeValues() removed, amend DebugLocEntry's constructor so that it
takes multiple values rather than a single, and keep non-fragment values
in OpenRanges, as this allows some cleanup of the code in
buildLocationList().
Reviewers: aprantl, dblaikie, loladiro
Reviewed By: aprantl
Subscribers: hiraditya, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D59303
llvm-svn: 357988
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h index 5011c84d7f7..24eefe4f092 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -100,9 +100,13 @@ private: SmallVector<Value, 1> Values; public: - DebugLocEntry(const MCSymbol *B, const MCSymbol *E, Value Val) - : Begin(B), End(E) { - Values.push_back(std::move(Val)); + /// Create a location list entry for the range [\p Begin, \p End). + /// + /// \param Vals One or more values describing (parts of) the variable. + DebugLocEntry(const MCSymbol *Begin, const MCSymbol *End, + ArrayRef<Value> Vals) + : Begin(Begin), End(End) { + addValues(Vals); } /// Attempt to merge this DebugLocEntry with Next and return @@ -124,9 +128,10 @@ public: void addValues(ArrayRef<DebugLocEntry::Value> Vals) { Values.append(Vals.begin(), Vals.end()); sortUniqueValues(); - assert(all_of(Values, [](DebugLocEntry::Value V) { - return V.isFragment(); - }) && "value must be a piece"); + assert((Values.size() == 1 || + all_of(Values, + [](DebugLocEntry::Value V) { return V.isFragment(); })) && + "must either have a single value or multiple pieces"); } // Sort the pieces by offset. |