summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-08-11 23:22:59 +0000
committerAdrian Prantl <aprantl@apple.com>2014-08-11 23:22:59 +0000
commit76502d84179e52d6ab1c657b4baf0e92ee27f912 (patch)
treeb8be1fefa103b14eda9b6c212a0a255ae87acb49 /llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
parent5f79ee53ec9797294205f191799e1bb6a9ef4633 (diff)
downloadbcm5719-llvm-76502d84179e52d6ab1c657b4baf0e92ee27f912.tar.gz
bcm5719-llvm-76502d84179e52d6ab1c657b4baf0e92ee27f912.zip
Add a couple of convenience accessors to DebugLocEntry::Value to further
simplify common usage patterns. llvm-svn: 215407
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
index c60a958c073..a4e37e13841 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h
@@ -67,7 +67,9 @@ public:
const ConstantFP *getConstantFP() const { return Constant.CFP; }
const ConstantInt *getConstantInt() const { return Constant.CIP; }
MachineLocation getLoc() const { return Loc; }
- const MDNode *getVariable() const { return Variable; }
+ const MDNode *getVariableNode() const { return Variable; }
+ DIVariable getVariable() const { return DIVariable(Variable); }
+ bool isVariablePiece() const { return getVariable().isVariablePiece(); }
friend bool operator==(const Value &, const Value &);
friend bool operator<(const Value &, const Value &);
};
@@ -121,7 +123,7 @@ public:
Values.append(Vals.begin(), Vals.end());
sortUniqueValues();
assert(std::all_of(Values.begin(), Values.end(), [](DebugLocEntry::Value V){
- return DIVariable(V.Variable).isVariablePiece();
+ return V.isVariablePiece();
}) && "value must be a piece");
}
@@ -158,9 +160,7 @@ inline bool operator==(const DebugLocEntry::Value &A,
/// Compare two pieces based on their offset.
inline bool operator<(const DebugLocEntry::Value &A,
const DebugLocEntry::Value &B) {
- DIVariable Var(A.getVariable());
- DIVariable OtherVar(B.getVariable());
- return Var.getPieceOffset() < OtherVar.getPieceOffset();
+ return A.getVariable().getPieceOffset() < B.getVariable().getPieceOffset();
}
}
OpenPOWER on IntegriCloud