From e686f1591fde0d3394dd3be40d06281252f108fa Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 6 Apr 2015 23:27:40 +0000 Subject: CodeGen: Stop using DIDescriptor::is*() and auto-casting Same as r234255, but for lib/CodeGen and lib/Target. llvm-svn: 234258 --- llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h') 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(Var)); - assert(DIExpression(Expr)->isValid()); + assert(cast(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(Variable); } bool isBitPiece() const { return getExpression().isBitPiece(); } - DIExpression getExpression() const { return DIExpression(Expression); } + DIExpression getExpression() const { + return cast_or_null(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(Values[0].Expression); + DIVariable Var = cast_or_null(Values[0].Variable); + DIExpression NextExpr = + cast_or_null(Next.Values[0].Expression); + DIVariable NextVar = cast_or_null(Next.Values[0].Variable); if (Var == NextVar && Expr.isBitPiece() && NextExpr.isBitPiece()) { addValues(Next.Values); -- cgit v1.2.3