diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-06 23:27:40 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-06 23:27:40 +0000 |
commit | e686f1591fde0d3394dd3be40d06281252f108fa (patch) | |
tree | 6f5e3ce7d39e4509af379d4bbe238e79e27ce2d6 /llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | |
parent | 6186fb2cd008ea9445ebc1dddced644cdbaeead5 (diff) | |
download | bcm5719-llvm-e686f1591fde0d3394dd3be40d06281252f108fa.tar.gz bcm5719-llvm-e686f1591fde0d3394dd3be40d06281252f108fa.zip |
CodeGen: Stop using DIDescriptor::is*() and auto-casting
Same as r234255, but for lib/CodeGen and lib/Target.
llvm-svn: 234258
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h index 0b5b8580cd8..f50ebae7ba6 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -43,7 +43,7 @@ public: Value(const MDNode *Var, const MDNode *Expr, MachineLocation Loc) : Variable(Var), Expression(Expr), EntryKind(E_Location), Loc(Loc) { assert(isa<MDLocalVariable>(Var)); - assert(DIExpression(Expr)->isValid()); + assert(cast<MDExpression>(Expr)->isValid()); } /// The variable to which this location entry corresponds. @@ -75,9 +75,11 @@ public: const ConstantInt *getConstantInt() const { return Constant.CIP; } MachineLocation getLoc() const { return Loc; } const MDNode *getVariableNode() const { return Variable; } - DIVariable getVariable() const { return DIVariable(Variable); } + DIVariable getVariable() const { return cast<MDLocalVariable>(Variable); } bool isBitPiece() const { return getExpression().isBitPiece(); } - DIExpression getExpression() const { return DIExpression(Expression); } + DIExpression getExpression() const { + return cast_or_null<MDExpression>(Expression); + } friend bool operator==(const Value &, const Value &); friend bool operator<(const Value &, const Value &); }; @@ -101,10 +103,11 @@ public: /// Return true if the merge was successful. bool MergeValues(const DebugLocEntry &Next) { if (Begin == Next.Begin) { - DIExpression Expr(Values[0].Expression); - DIVariable Var(Values[0].Variable); - DIExpression NextExpr(Next.Values[0].Expression); - DIVariable NextVar(Next.Values[0].Variable); + DIExpression Expr = cast_or_null<MDExpression>(Values[0].Expression); + DIVariable Var = cast_or_null<MDLocalVariable>(Values[0].Variable); + DIExpression NextExpr = + cast_or_null<MDExpression>(Next.Values[0].Expression); + DIVariable NextVar = cast_or_null<MDLocalVariable>(Next.Values[0].Variable); if (Var == NextVar && Expr.isBitPiece() && NextExpr.isBitPiece()) { addValues(Next.Values); |