index 57dda88b0021b11a1602cf651f6a045bde5ac0dd..5fd27e10eaa02e48119b0f5357fe74270e288705 100644 (file)
// If this piece overlaps with any open ranges, truncate them.
DIVariable DIVar = Begin->getDebugVariable();
auto Last = std::remove_if(OpenRanges.begin(), OpenRanges.end(),
- [&](DebugLocEntry::Value R) {
- return piecesOverlap(DIVar, DIVariable(R.getVariable()));
- });
+ [&](DebugLocEntry::Value R) {
+ return piecesOverlap(DIVar, R.getVariable());
+ });
OpenRanges.erase(Last, OpenRanges.end());
const MCSymbol *StartLabel = getLabelBeforeInsn(Begin);
if (!couldMerge) {
// Need to add a new DebugLocEntry. Add all values from still
// valid non-overlapping pieces.
- for (auto Range : OpenRanges)
- Loc.addValue(Range.second);
+ if (OpenRanges.size())
+ Loc.addValues(OpenRanges);
+
DebugLoc.push_back(std::move(Loc));
}
const DITypeIdentifierMap &Map,
ArrayRef<DebugLocEntry::Value> Values) {
assert(std::all_of(Values.begin(), Values.end(), [](DebugLocEntry::Value P) {
- return DIVariable(P.getVariable()).isVariablePiece();
+ return P.isVariablePiece();
}) && "all values are expected to be pieces");
assert(std::is_sorted(Values.begin(), Values.end()) &&
"pieces are expected to be sorted");
unsigned Offset = 0;
for (auto Piece : Values) {
- DIVariable Var(Piece.getVariable());
+ DIVariable Var = Piece.getVariable();
unsigned PieceOffset = Var.getPieceOffset();
unsigned PieceSize = Var.getPieceSize();
assert(Offset <= PieceOffset && "overlapping or duplicate pieces");
void DwarfDebug::emitDebugLocEntry(ByteStreamer &Streamer,
const DebugLocEntry &Entry) {
const DebugLocEntry::Value Value = Entry.getValues()[0];
- DIVariable DV(Value.getVariable());
- if (DV.isVariablePiece())
+ if (Value.isVariablePiece())
// Emit all pieces that belong to the same variable and range.
return emitLocPieces(Streamer, TypeIdentifierMap, Entry.getValues());
void DwarfDebug::emitDebugLocValue(ByteStreamer &Streamer,
const DebugLocEntry::Value &Value) {
- DIVariable DV(Value.getVariable());
+ DIVariable DV = Value.getVariable();
// Regular entry.
if (Value.isInt()) {
DIBasicType BTy(resolve(DV.getType()));