llvm.org GIT mirror llvm / b5b9823
[IR] Don't print "!DIExpression() = !DIExpression()" when dumping Now that we print DIExpressions inline everywhere, we don't need to print them once as an operand and again as a value. This is only really visible when calling dump() or print() directly on a DIExpression during debugging. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312168 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 2 years ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
35913591 /* FromValue */ true);
35923592
35933593 auto *N = dyn_cast(&MD);
3594 if (OnlyAsOperand || !N)
3594 if (OnlyAsOperand || !N || isa(MD))
35953595 return;
35963596
35973597 OS << " = ";
55 // License. See LICENSE.TXT for details.
66 //
77 //===----------------------------------------------------------------------===//
8 #include "llvm/BinaryFormat/Dwarf.h"
9 #include "llvm/IR/DebugInfoMetadata.h"
810 #include "llvm/IR/Function.h"
911 #include "llvm/IR/IRBuilder.h"
1012 #include "llvm/IR/LLVMContext.h"
3335 EXPECT_TRUE(r != std::string::npos);
3436 }
3537
38 TEST(AsmWriterTest, DumpDIExpression) {
39 LLVMContext Ctx;
40 uint64_t Ops[] = {
41 dwarf::DW_OP_constu, 4,
42 dwarf::DW_OP_minus,
43 dwarf::DW_OP_deref,
44 };
45 DIExpression *Expr = DIExpression::get(Ctx, Ops);
46 std::string S;
47 raw_string_ostream OS(S);
48 Expr->print(OS);
49 EXPECT_EQ("!DIExpression(DW_OP_constu, 4, DW_OP_minus, DW_OP_deref)",
50 OS.str());
3651 }
52
53 }