llvm.org GIT mirror llvm / 28b12d7
[llvm-opt-report] Use -no-demangle to disable demangling As this is intended to be a user-facing option, -no-demangle seems much better than -demangle=0. Add testing for the option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283516 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 2 years ago
2 changed file(s) with 25 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
0 RUN: llvm-opt-report -r %p %p/Inputs/qx.yaml | FileCheck -strict-whitespace %s
1 RUN: llvm-opt-report -no-demangle -r %p %p/Inputs/qx.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-NODEM %s
12 RUN: llvm-opt-report -s -r %p %p/Inputs/qx.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-SUCCINCT %s
23
34 ; CHECK: < {{.*[/\]}}q.cpp
2122 ; CHECK-NEXT: 13 | }
2223 ; CHECK-NEXT: 14 |
2324
25 ; CHECK-NODEM: < {{.*[/\]}}q.cpp
26 ; CHECK-NODEM-NEXT: 1 | void bar();
27 ; CHECK-NODEM-NEXT: 2 | void foo(int n) {
28 ; CHECK-NODEM-NEXT: {{\[\[}}
29 ; CHECK-NODEM-NEXT: > _Z3fooi:
30 ; CHECK-NODEM-NEXT: 3 | for (int i = 0; i < n; ++i)
31 ; CHECK-NODEM-NEXT: > _Z5quackv, _Z6quack2v:
32 ; CHECK-NODEM-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
33 ; CHECK-NODEM-NEXT: {{\]\]}}
34 ; CHECK-NODEM-NEXT: 4 | bar();
35 ; CHECK-NODEM-NEXT: 5 | }
36 ; CHECK-NODEM-NEXT: 6 |
37 ; CHECK-NODEM-NEXT: 7 | void quack() {
38 ; CHECK-NODEM-NEXT: 8 I | foo(4);
39 ; CHECK-NODEM-NEXT: 9 | }
40 ; CHECK-NODEM-NEXT: 10 |
41 ; CHECK-NODEM-NEXT: 11 | void quack2() {
42 ; CHECK-NODEM-NEXT: 12 I | foo(4);
43 ; CHECK-NODEM-NEXT: 13 | }
44 ; CHECK-NODEM-NEXT: 14 |
45
2446 ; CHECK-SUCCINCT: < {{.*[/\]}}q.cpp
2547 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
2648 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
5858 cl::init(false), cl::cat(OptReportCategory));
5959
6060 static cl::opt
61 Demangle("demangle", cl::desc("Demangle function names"), cl::init(true),
62 cl::cat(OptReportCategory));
61 NoDemangle("no-demangle", cl::desc("Don't demangle function names"),
62 cl::init(false), cl::cat(OptReportCategory));
6363
6464 namespace {
6565 // For each location in the source file, the common per-transformation state
377377 OS << ", ";
378378
379379 bool Printed = false;
380 if (Demangle) {
380 if (!NoDemangle) {
381381 int Status = 0;
382382 char *Demangled =
383383 itaniumDemangle(FuncName.c_str(), nullptr, nullptr, &Status);