Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Demangle/ItaniumDemangle.cpp
Line
Count
Source (jump to first uncovered line)
1
//===------------------------- ItaniumDemangle.cpp ------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
// FIXME: (possibly) incomplete list of features that clang mangles that this
10
// file does not yet support:
11
//   - C++ modules TS
12
13
#include "llvm/Demangle/Demangle.h"
14
#include "llvm/Demangle/ItaniumDemangle.h"
15
16
#include <cassert>
17
#include <cctype>
18
#include <cstdio>
19
#include <cstdlib>
20
#include <cstring>
21
#include <functional>
22
#include <numeric>
23
#include <utility>
24
#include <vector>
25
26
using namespace llvm;
27
using namespace llvm::itanium_demangle;
28
29
constexpr const char *itanium_demangle::FloatData<float>::spec;
30
constexpr const char *itanium_demangle::FloatData<double>::spec;
31
constexpr const char *itanium_demangle::FloatData<long double>::spec;
32
33
// <discriminator> := _ <non-negative number>      # when number < 10
34
//                 := __ <non-negative number> _   # when number >= 10
35
//  extension      := decimal-digit+               # at the end of string
36
const char *itanium_demangle::parse_discriminator(const char *first,
37
9
                                                  const char *last) {
38
9
  // parse but ignore discriminator
39
9
  if (first != last) {
40
4
    if (*first == '_') {
41
0
      const char *t1 = first + 1;
42
0
      if (t1 != last) {
43
0
        if (std::isdigit(*t1))
44
0
          first = t1 + 1;
45
0
        else if (*t1 == '_') {
46
0
          for (++t1; t1 != last && std::isdigit(*t1); ++t1)
47
0
            ;
48
0
          if (t1 != last && *t1 == '_')
49
0
            first = t1 + 1;
50
0
        }
51
0
      }
52
4
    } else if (std::isdigit(*first)) {
53
0
      const char *t1 = first + 1;
54
0
      for (; t1 != last && std::isdigit(*t1); ++t1)
55
0
        ;
56
0
      if (t1 == last)
57
0
        first = last;
58
0
    }
59
4
  }
60
9
  return first;
61
9
}
62
63
#ifndef NDEBUG
64
namespace {
65
struct DumpVisitor {
66
  unsigned Depth = 0;
67
  bool PendingNewline = false;
68
69
  template<typename NodeT> static constexpr bool wantsNewline(const NodeT *) {
70
    return true;
71
  }
72
  static bool wantsNewline(NodeArray A) { return !A.empty(); }
73
  static constexpr bool wantsNewline(...) { return false; }
74
75
  template<typename ...Ts> static bool anyWantNewline(Ts ...Vs) {
76
    for (bool B : {wantsNewline(Vs)...})
77
      if (B)
78
        return true;
79
    return false;
80
  }
81
82
  void printStr(const char *S) { fprintf(stderr, "%s", S); }
83
  void print(StringView SV) {
84
    fprintf(stderr, "\"%.*s\"", (int)SV.size(), SV.begin());
85
  }
86
  void print(const Node *N) {
87
    if (N)
88
      N->visit(std::ref(*this));
89
    else
90
      printStr("<null>");
91
  }
92
  void print(NodeOrString NS) {
93
    if (NS.isNode())
94
      print(NS.asNode());
95
    else if (NS.isString())
96
      print(NS.asString());
97
    else
98
      printStr("NodeOrString()");
99
  }
100
  void print(NodeArray A) {
101
    ++Depth;
102
    printStr("{");
103
    bool First = true;
104
    for (const Node *N : A) {
105
      if (First)
106
        print(N);
107
      else
108
        printWithComma(N);
109
      First = false;
110
    }
111
    printStr("}");
112
    --Depth;
113
  }
114
115
  // Overload used when T is exactly 'bool', not merely convertible to 'bool'.
116
  void print(bool B) { printStr(B ? "true" : "false"); }
117
118
  template <class T>
119
  typename std::enable_if<std::is_unsigned<T>::value>::type print(T N) {
120
    fprintf(stderr, "%llu", (unsigned long long)N);
121
  }
122
123
  template <class T>
124
  typename std::enable_if<std::is_signed<T>::value>::type print(T N) {
125
    fprintf(stderr, "%lld", (long long)N);
126
  }
127
128
  void print(ReferenceKind RK) {
129
    switch (RK) {
130
    case ReferenceKind::LValue:
131
      return printStr("ReferenceKind::LValue");
132
    case ReferenceKind::RValue:
133
      return printStr("ReferenceKind::RValue");
134
    }
135
  }
136
  void print(FunctionRefQual RQ) {
137
    switch (RQ) {
138
    case FunctionRefQual::FrefQualNone:
139
      return printStr("FunctionRefQual::FrefQualNone");
140
    case FunctionRefQual::FrefQualLValue:
141
      return printStr("FunctionRefQual::FrefQualLValue");
142
    case FunctionRefQual::FrefQualRValue:
143
      return printStr("FunctionRefQual::FrefQualRValue");
144
    }
145
  }
146
  void print(Qualifiers Qs) {
147
    if (!Qs) return printStr("QualNone");
148
    struct QualName { Qualifiers Q; const char *Name; } Names[] = {
149
      {QualConst, "QualConst"},
150
      {QualVolatile, "QualVolatile"},
151
      {QualRestrict, "QualRestrict"},
152
    };
153
    for (QualName Name : Names) {
154
      if (Qs & Name.Q) {
155
        printStr(Name.Name);
156
        Qs = Qualifiers(Qs & ~Name.Q);
157
        if (Qs) printStr(" | ");
158
      }
159
    }
160
  }
161
  void print(SpecialSubKind SSK) {
162
    switch (SSK) {
163
    case SpecialSubKind::allocator:
164
      return printStr("SpecialSubKind::allocator");
165
    case SpecialSubKind::basic_string:
166
      return printStr("SpecialSubKind::basic_string");
167
    case SpecialSubKind::string:
168
      return printStr("SpecialSubKind::string");
169
    case SpecialSubKind::istream:
170
      return printStr("SpecialSubKind::istream");
171
    case SpecialSubKind::ostream:
172
      return printStr("SpecialSubKind::ostream");
173
    case SpecialSubKind::iostream:
174
      return printStr("SpecialSubKind::iostream");
175
    }
176
  }
177
178
  void newLine() {
179
    printStr("\n");
180
    for (unsigned I = 0; I != Depth; ++I)
181
      printStr(" ");
182
    PendingNewline = false;
183
  }
184
185
  template<typename T> void printWithPendingNewline(T V) {
186
    print(V);
187
    if (wantsNewline(V))
188
      PendingNewline = true;
189
  }
190
191
  template<typename T> void printWithComma(T V) {
192
    if (PendingNewline || wantsNewline(V)) {
193
      printStr(",");
194
      newLine();
195
    } else {
196
      printStr(", ");
197
    }
198
199
    printWithPendingNewline(V);
200
  }
201
202
  struct CtorArgPrinter {
203
    DumpVisitor &Visitor;
204
205
    template<typename T, typename ...Rest> void operator()(T V, Rest ...Vs) {
206
      if (Visitor.anyWantNewline(V, Vs...))
207
        Visitor.newLine();
208
      Visitor.printWithPendingNewline(V);
209
      int PrintInOrder[] = { (Visitor.printWithComma(Vs), 0)..., 0 };
210
      (void)PrintInOrder;
211
    }
212
  };
213
214
  template<typename NodeT> void operator()(const NodeT *Node) {
215
    Depth += 2;
216
    fprintf(stderr, "%s(", itanium_demangle::NodeKind<NodeT>::name());
217
    Node->match(CtorArgPrinter{*this});
218
    fprintf(stderr, ")");
219
    Depth -= 2;
220
  }
221
222
  void operator()(const ForwardTemplateReference *Node) {
223
    Depth += 2;
224
    fprintf(stderr, "ForwardTemplateReference(");
225
    if (Node->Ref && !Node->Printing) {
226
      Node->Printing = true;
227
      CtorArgPrinter{*this}(Node->Ref);
228
      Node->Printing = false;
229
    } else {
230
      CtorArgPrinter{*this}(Node->Index);
231
    }
232
    fprintf(stderr, ")");
233
    Depth -= 2;
234
  }
235
};
236
}
237
238
void itanium_demangle::Node::dump() const {
239
  DumpVisitor V;
240
  visit(std::ref(V));
241
  V.newLine();
242
}
243
#endif
244
245
namespace {
246
class BumpPointerAllocator {
247
  struct BlockMeta {
248
    BlockMeta* Next;
249
    size_t Current;
250
  };
251
252
  static constexpr size_t AllocSize = 4096;
253
  static constexpr size_t UsableAllocSize = AllocSize - sizeof(BlockMeta);
254
255
  alignas(long double) char InitialBuffer[AllocSize];
256
  BlockMeta* BlockList = nullptr;
257
258
0
  void grow() {
259
0
    char* NewMeta = static_cast<char *>(std::malloc(AllocSize));
260
0
    if (NewMeta == nullptr)
261
0
      std::terminate();
262
0
    BlockList = new (NewMeta) BlockMeta{BlockList, 0};
263
0
  }
264
265
0
  void* allocateMassive(size_t NBytes) {
266
0
    NBytes += sizeof(BlockMeta);
267
0
    BlockMeta* NewMeta = reinterpret_cast<BlockMeta*>(std::malloc(NBytes));
268
0
    if (NewMeta == nullptr)
269
0
      std::terminate();
270
0
    BlockList->Next = new (NewMeta) BlockMeta{BlockList->Next, 0};
271
0
    return static_cast<void*>(NewMeta + 1);
272
0
  }
273
274
public:
275
  BumpPointerAllocator()
276
2.01k
      : BlockList(new (InitialBuffer) BlockMeta{nullptr, 0}) {}
277
278
10.3k
  void* allocate(size_t N) {
279
10.3k
    N = (N + 15u) & ~15u;
280
10.3k
    if (N + BlockList->Current >= UsableAllocSize) {
281
0
      if (N > UsableAllocSize)
282
0
        return allocateMassive(N);
283
0
      grow();
284
0
    }
285
10.3k
    BlockList->Current += N;
286
10.3k
    return static_cast<void*>(reinterpret_cast<char*>(BlockList + 1) +
287
10.3k
                              BlockList->Current - N);
288
10.3k
  }
289
290
2.05k
  void reset() {
291
4.11k
    while (BlockList) {
292
2.05k
      BlockMeta* Tmp = BlockList;
293
2.05k
      BlockList = BlockList->Next;
294
2.05k
      if (reinterpret_cast<char*>(Tmp) != InitialBuffer)
295
0
        std::free(Tmp);
296
2.05k
    }
297
2.05k
    BlockList = new (InitialBuffer) BlockMeta{nullptr, 0};
298
2.05k
  }
299
300
2.01k
  ~BumpPointerAllocator() { reset(); }
301
};
302
303
class DefaultAllocator {
304
  BumpPointerAllocator Alloc;
305
306
public:
307
39
  void reset() { Alloc.reset(); }
308
309
8.37k
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
8.37k
    return new (Alloc.allocate(sizeof(T)))
311
8.37k
        T(std::forward<Args>(args)...);
312
8.37k
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [12], llvm::itanium_demangle::Node*&>(char const (&&&) [12], llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
3
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
3
    return new (Alloc.allocate(sizeof(T)))
311
3
        T(std::forward<Args>(args)...);
312
3
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [9], llvm::itanium_demangle::Node*&>(char const (&&&) [9], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [14], llvm::itanium_demangle::Node*&>(char const (&&&) [14], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [19], llvm::itanium_demangle::Node*&>(char const (&&&) [19], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [27], llvm::itanium_demangle::Node*&>(char const (&&&) [27], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::CtorVtableSpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CtorVtableSpecialName, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [41], llvm::itanium_demangle::Node*&>(char const (&&&) [41], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [18], llvm::itanium_demangle::Node*&>(char const (&&&) [18], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [22], llvm::itanium_demangle::Node*&>(char const (&&&) [22], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [20], llvm::itanium_demangle::Node*&>(char const (&&&) [20], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [25], llvm::itanium_demangle::Node*&>(char const (&&&) [25], llvm::itanium_demangle::Node*&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [4]>(char const (&&&) [4])
Line
Count
Source
309
270
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
270
    return new (Alloc.allocate(sizeof(T)))
311
270
        T(std::forward<Args>(args)...);
312
270
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NestedName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NestedName, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
57
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
57
    return new (Alloc.allocate(sizeof(T)))
311
57
        T(std::forward<Args>(args)...);
312
57
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [5]>(char const (&&&) [5])
Line
Count
Source
309
96
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
96
    return new (Alloc.allocate(sizeof(T)))
311
96
        T(std::forward<Args>(args)...);
312
96
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::ForwardTemplateReference* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ForwardTemplateReference, unsigned long&>(unsigned long&&&)
Line
Count
Source
309
1
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1
    return new (Alloc.allocate(sizeof(T)))
311
1
        T(std::forward<Args>(args)...);
312
1
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::IntegerLiteral* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::IntegerLiteral, llvm::itanium_demangle::StringView&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&, llvm::itanium_demangle::StringView&&&)
Line
Count
Source
309
2
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2
    return new (Alloc.allocate(sizeof(T)))
311
2
        T(std::forward<Args>(args)...);
312
2
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::BoolExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::BoolExpr, int>(int&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::FloatLiteralImpl<float>* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FloatLiteralImpl<float>, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::FloatLiteralImpl<double>* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FloatLiteralImpl<double>, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::FloatLiteralImpl<long double>* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FloatLiteralImpl<long double>, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::IntegerCastExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::IntegerCastExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::FunctionParam* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FunctionParam, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
Line
Count
Source
309
2
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2
    return new (Alloc.allocate(sizeof(T)))
311
2
        T(std::forward<Args>(args)...);
312
2
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::FoldExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FoldExpr, bool&, llvm::itanium_demangle::StringView&, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(bool&&&, llvm::itanium_demangle::StringView&&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::BinaryExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::BinaryExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&&, llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
2
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2
    return new (Alloc.allocate(sizeof(T)))
311
2
        T(std::forward<Args>(args)...);
312
2
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::PrefixExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PrefixExpr, llvm::itanium_demangle::StringView&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::StringView&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::CastExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CastExpr, char const (&) [11], llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(char const (&&&) [11], llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::CallExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CallExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ConversionExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ConversionExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ConversionExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ConversionExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::DeleteExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::DeleteExpr, llvm::itanium_demangle::Node*&, bool&, bool>(llvm::itanium_demangle::Node*&&&, bool&&&, bool&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::CastExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CastExpr, char const (&) [13], llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(char const (&&&) [13], llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [22]>(char const (&&&) [22])
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
Line
Count
Source
309
2.05k
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2.05k
    return new (Alloc.allocate(sizeof(T)))
311
2.05k
        T(std::forward<Args>(args)...);
312
2.05k
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::QualifiedName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::QualifiedName, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::DtorName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::DtorName, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [11]>(char const (&&&) [11])
Line
Count
Source
309
5
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
5
    return new (Alloc.allocate(sizeof(T)))
311
5
        T(std::forward<Args>(args)...);
312
5
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [10]>(char const (&&&) [10])
Line
Count
Source
309
84
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
84
    return new (Alloc.allocate(sizeof(T)))
311
84
        T(std::forward<Args>(args)...);
312
84
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::ConversionOperatorType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ConversionOperatorType, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
1
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1
    return new (Alloc.allocate(sizeof(T)))
311
1
        T(std::forward<Args>(args)...);
312
1
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [18]>(char const (&&&) [18])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [16]>(char const (&&&) [16])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::LiteralOperator* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::LiteralOperator, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [12]>(char const (&&&) [12])
Line
Count
Source
309
94
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
94
    return new (Alloc.allocate(sizeof(T)))
311
94
        T(std::forward<Args>(args)...);
312
94
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [15]>(char const (&&&) [15])
Line
Count
Source
309
179
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
179
    return new (Alloc.allocate(sizeof(T)))
311
179
        T(std::forward<Args>(args)...);
312
179
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [13]>(char const (&&&) [13])
Line
Count
Source
309
297
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
297
    return new (Alloc.allocate(sizeof(T)))
311
297
        T(std::forward<Args>(args)...);
312
297
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::GlobalQualifiedName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::GlobalQualifiedName, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::MemberExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::MemberExpr, llvm::itanium_demangle::Node*&, char const (&) [3], llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, char const (&&&) [3], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::MemberExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::MemberExpr, llvm::itanium_demangle::Node*&, char const (&) [2], llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, char const (&&&) [2], llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ArraySubscriptExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ArraySubscriptExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::BracedExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::BracedExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&, bool>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&, bool&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::BracedRangeExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::BracedRangeExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::InitListExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::InitListExpr, std::nullptr_t, llvm::itanium_demangle::NodeArray>(std::nullptr_t&&, llvm::itanium_demangle::NodeArray&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::PostfixExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PostfixExpr, llvm::itanium_demangle::Node*&, char const (&) [3]>(llvm::itanium_demangle::Node*&&&, char const (&&&) [3])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NewExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NewExpr, llvm::itanium_demangle::NodeArray&, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray&, bool&, bool&>(llvm::itanium_demangle::NodeArray&&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&&, bool&&&, bool&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NewExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NewExpr, llvm::itanium_demangle::NodeArray&, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray, bool&, bool&>(llvm::itanium_demangle::NodeArray&&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&, bool&&&, bool&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::EnclosingExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::EnclosingExpr, char const (&) [11], llvm::itanium_demangle::Node*&, char const (&) [2]>(char const (&&&) [11], llvm::itanium_demangle::Node*&&&, char const (&&&) [2])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ConditionalExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ConditionalExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::CastExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CastExpr, char const (&) [17], llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(char const (&&&) [17], llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::CastExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CastExpr, char const (&) [12], llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(char const (&&&) [12], llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::ParameterPackExpansion* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ParameterPackExpansion, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
2
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2
    return new (Alloc.allocate(sizeof(T)))
311
2
        T(std::forward<Args>(args)...);
312
2
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::EnclosingExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::EnclosingExpr, char const (&) [9], llvm::itanium_demangle::Node*&, char const (&) [2]>(char const (&&&) [9], llvm::itanium_demangle::Node*&&&, char const (&&&) [2])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::SizeofParamPackExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SizeofParamPackExpr, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::EnclosingExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::EnclosingExpr, char const (&) [12], llvm::itanium_demangle::Node*&, char const (&) [2]>(char const (&&&) [12], llvm::itanium_demangle::Node*&&&, char const (&&&) [2])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NodeArrayNode* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NodeArrayNode, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::NodeArray&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::InitListExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::InitListExpr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [6]>(char const (&&&) [6])
Line
Count
Source
309
518
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
518
    return new (Alloc.allocate(sizeof(T)))
311
518
        T(std::forward<Args>(args)...);
312
518
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ThrowExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ThrowExpr, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::UUIDOfExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::UUIDOfExpr, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::EnclosingExpr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::EnclosingExpr, char const (&) [10], llvm::itanium_demangle::Node*&, char const (&) [2]>(char const (&&&) [10], llvm::itanium_demangle::Node*&&&, char const (&&&) [2])
ItaniumDemangle.cpp:llvm::itanium_demangle::ExpandedSpecialSubstitution* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ExpandedSpecialSubstitution, llvm::itanium_demangle::SpecialSubKind&>(llvm::itanium_demangle::SpecialSubKind&&&)
Line
Count
Source
309
1
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1
    return new (Alloc.allocate(sizeof(T)))
311
1
        T(std::forward<Args>(args)...);
312
1
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::CtorDtorName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::CtorDtorName, llvm::itanium_demangle::Node*&, bool, int&>(llvm::itanium_demangle::Node*&&&, bool&&, int&&&)
Line
Count
Source
309
23
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
23
    return new (Alloc.allocate(sizeof(T)))
311
23
        T(std::forward<Args>(args)...);
312
23
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::AbiTagAttr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::AbiTagAttr, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&&)
Line
Count
Source
309
6
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
6
    return new (Alloc.allocate(sizeof(T)))
311
6
        T(std::forward<Args>(args)...);
312
6
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::UnnamedTypeName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::UnnamedTypeName, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::ClosureTypeName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ClosureTypeName, llvm::itanium_demangle::NodeArray&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::NodeArray&&&, llvm::itanium_demangle::StringView&&&)
Line
Count
Source
309
2
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2
    return new (Alloc.allocate(sizeof(T)))
311
2
        T(std::forward<Args>(args)...);
312
2
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::StructuredBindingName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::StructuredBindingName, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::NodeArray&&)
Line
Count
Source
309
1
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1
    return new (Alloc.allocate(sizeof(T)))
311
1
        T(std::forward<Args>(args)...);
312
1
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::LocalName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::LocalName, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
5
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
5
    return new (Alloc.allocate(sizeof(T)))
311
5
        T(std::forward<Args>(args)...);
312
5
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialSubstitution* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialSubstitution, llvm::itanium_demangle::SpecialSubKind>(llvm::itanium_demangle::SpecialSubKind&&)
Line
Count
Source
309
11
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
11
    return new (Alloc.allocate(sizeof(T)))
311
11
        T(std::forward<Args>(args)...);
312
11
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::ParameterPack* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ParameterPack, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::NodeArray&&)
Line
Count
Source
309
3
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
3
    return new (Alloc.allocate(sizeof(T)))
311
3
        T(std::forward<Args>(args)...);
312
3
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::TemplateArgs* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::TemplateArgs, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::NodeArray&&)
Line
Count
Source
309
34
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
34
    return new (Alloc.allocate(sizeof(T)))
311
34
        T(std::forward<Args>(args)...);
312
34
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameWithTemplateArgs* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameWithTemplateArgs, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
34
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
34
    return new (Alloc.allocate(sizeof(T)))
311
34
        T(std::forward<Args>(args)...);
312
34
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::StdQualifiedName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::StdQualifiedName, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
6
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
6
    return new (Alloc.allocate(sizeof(T)))
311
6
        T(std::forward<Args>(args)...);
312
6
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::TemplateArgumentPack* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::TemplateArgumentPack, llvm::itanium_demangle::NodeArray&>(llvm::itanium_demangle::NodeArray&&&)
Line
Count
Source
309
4
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
4
    return new (Alloc.allocate(sizeof(T)))
311
4
        T(std::forward<Args>(args)...);
312
4
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::EnableIfAttr* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::EnableIfAttr, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::NodeArray&&)
Line
Count
Source
309
1
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1
    return new (Alloc.allocate(sizeof(T)))
311
1
        T(std::forward<Args>(args)...);
312
1
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::FunctionEncoding* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FunctionEncoding, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Qualifiers&, llvm::itanium_demangle::FunctionRefQual&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&, llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Qualifiers&&&, llvm::itanium_demangle::FunctionRefQual&&&)
Line
Count
Source
309
1.98k
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1.98k
    return new (Alloc.allocate(sizeof(T)))
311
1.98k
        T(std::forward<Args>(args)...);
312
1.98k
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::DotSuffix* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::DotSuffix, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::SpecialName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::SpecialName, char const (&) [34], llvm::itanium_demangle::Node*&>(char const (&&&) [34], llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
3
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
3
    return new (Alloc.allocate(sizeof(T)))
311
3
        T(std::forward<Args>(args)...);
312
3
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NoexceptSpec* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NoexceptSpec, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::DynamicExceptionSpec* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::DynamicExceptionSpec, llvm::itanium_demangle::NodeArray>(llvm::itanium_demangle::NodeArray&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::FunctionType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::FunctionType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeArray&, llvm::itanium_demangle::Qualifiers&, llvm::itanium_demangle::FunctionRefQual&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeArray&&&, llvm::itanium_demangle::Qualifiers&&&, llvm::itanium_demangle::FunctionRefQual&&&, llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
4
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
4
    return new (Alloc.allocate(sizeof(T)))
311
4
        T(std::forward<Args>(args)...);
312
4
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ObjCProtoName* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ObjCProtoName, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::VendorExtQualType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::VendorExtQualType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::QualType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::QualType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Qualifiers&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Qualifiers&&&)
Line
Count
Source
309
24
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
24
    return new (Alloc.allocate(sizeof(T)))
311
24
        T(std::forward<Args>(args)...);
312
24
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [8]>(char const (&&&) [8])
Line
Count
Source
309
8
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
8
    return new (Alloc.allocate(sizeof(T)))
311
8
        T(std::forward<Args>(args)...);
312
8
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [14]>(char const (&&&) [14])
Line
Count
Source
309
337
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
337
    return new (Alloc.allocate(sizeof(T)))
311
337
        T(std::forward<Args>(args)...);
312
337
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [19]>(char const (&&&) [19])
Line
Count
Source
309
308
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
308
    return new (Alloc.allocate(sizeof(T)))
311
308
        T(std::forward<Args>(args)...);
312
308
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [9]>(char const (&&&) [9])
ItaniumDemangle.cpp:llvm::itanium_demangle::NameType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::NameType, char const (&) [7]>(char const (&&&) [7])
Line
Count
Source
309
214
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
214
    return new (Alloc.allocate(sizeof(T)))
311
214
        T(std::forward<Args>(args)...);
312
214
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::PixelVectorType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PixelVectorType, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::StringView&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::VectorType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::VectorType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&&)
Line
Count
Source
309
1.64k
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1.64k
    return new (Alloc.allocate(sizeof(T)))
311
1.64k
        T(std::forward<Args>(args)...);
312
1.64k
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::VectorType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::VectorType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::VectorType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::VectorType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::StringView>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::StringView&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::ArrayType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ArrayType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::NodeOrString&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::NodeOrString&&&)
Line
Count
Source
309
1
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
1
    return new (Alloc.allocate(sizeof(T)))
311
1
        T(std::forward<Args>(args)...);
312
1
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::PointerToMemberType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PointerToMemberType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::Node*&&&)
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::ElaboratedTypeSpefType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ElaboratedTypeSpefType, llvm::itanium_demangle::StringView&, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::StringView&&&, llvm::itanium_demangle::Node*&&&)
ItaniumDemangle.cpp:llvm::itanium_demangle::PointerType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PointerType, llvm::itanium_demangle::Node*&>(llvm::itanium_demangle::Node*&&&)
Line
Count
Source
309
46
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
46
    return new (Alloc.allocate(sizeof(T)))
311
46
        T(std::forward<Args>(args)...);
312
46
  }
ItaniumDemangle.cpp:llvm::itanium_demangle::ReferenceType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::ReferenceType, llvm::itanium_demangle::Node*&, llvm::itanium_demangle::ReferenceKind>(llvm::itanium_demangle::Node*&&&, llvm::itanium_demangle::ReferenceKind&&)
Line
Count
Source
309
2
  template<typename T, typename ...Args> T *makeNode(Args &&...args) {
310
2
    return new (Alloc.allocate(sizeof(T)))
311
2
        T(std::forward<Args>(args)...);
312
2
  }
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::PostfixQualifiedType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PostfixQualifiedType, llvm::itanium_demangle::Node*&, char const (&) [9]>(llvm::itanium_demangle::Node*&&&, char const (&&&) [9])
Unexecuted instantiation: ItaniumDemangle.cpp:llvm::itanium_demangle::PostfixQualifiedType* (anonymous namespace)::DefaultAllocator::makeNode<llvm::itanium_demangle::PostfixQualifiedType, llvm::itanium_demangle::Node*&, char const (&) [11]>(llvm::itanium_demangle::Node*&&&, char const (&&&) [11])
313
314
1.94k
  void *allocateNodeArray(size_t sz) {
315
1.94k
    return Alloc.allocate(sizeof(Node *) * sz);
316
1.94k
  }
317
};
318
}  // unnamed namespace
319
320
//===----------------------------------------------------------------------===//
321
// Code beyond this point should not be synchronized with libc++abi.
322
//===----------------------------------------------------------------------===//
323
324
using Demangler = itanium_demangle::ManglingParser<DefaultAllocator>;
325
326
char *llvm::itaniumDemangle(const char *MangledName, char *Buf,
327
2.01k
                            size_t *N, int *Status) {
328
2.01k
  if (MangledName == nullptr || (Buf != nullptr && 
N == nullptr0
)) {
329
0
    if (Status)
330
0
      *Status = demangle_invalid_args;
331
0
    return nullptr;
332
0
  }
333
2.01k
334
2.01k
  int InternalStatus = demangle_success;
335
2.01k
  Demangler Parser(MangledName, MangledName + std::strlen(MangledName));
336
2.01k
  OutputStream S;
337
2.01k
338
2.01k
  Node *AST = Parser.parse();
339
2.01k
340
2.01k
  if (AST == nullptr)
341
17
    InternalStatus = demangle_invalid_mangled_name;
342
1.99k
  else if (!initializeOutputStream(Buf, N, S, 1024))
343
0
    InternalStatus = demangle_memory_alloc_failure;
344
1.99k
  else {
345
1.99k
    assert(Parser.ForwardTemplateRefs.empty());
346
1.99k
    AST->print(S);
347
1.99k
    S += '\0';
348
1.99k
    if (N != nullptr)
349
0
      *N = S.getCurrentPosition();
350
1.99k
    Buf = S.getBuffer();
351
1.99k
  }
352
2.01k
353
2.01k
  if (Status)
354
1.88k
    *Status = InternalStatus;
355
2.01k
  return InternalStatus == demangle_success ? 
Buf1.99k
:
nullptr17
;
356
2.01k
}
357
358
ItaniumPartialDemangler::ItaniumPartialDemangler()
359
6
    : RootNode(nullptr), Context(new Demangler{nullptr, nullptr}) {}
360
361
7
ItaniumPartialDemangler::~ItaniumPartialDemangler() {
362
7
  delete static_cast<Demangler *>(Context);
363
7
}
364
365
ItaniumPartialDemangler::ItaniumPartialDemangler(
366
    ItaniumPartialDemangler &&Other)
367
1
    : RootNode(Other.RootNode), Context(Other.Context) {
368
1
  Other.Context = Other.RootNode = nullptr;
369
1
}
370
371
ItaniumPartialDemangler &ItaniumPartialDemangler::
372
2
operator=(ItaniumPartialDemangler &&Other) {
373
2
  std::swap(RootNode, Other.RootNode);
374
2
  std::swap(Context, Other.Context);
375
2
  return *this;
376
2
}
377
378
// Demangle MangledName into an AST, storing it into this->RootNode.
379
39
bool ItaniumPartialDemangler::partialDemangle(const char *MangledName) {
380
39
  Demangler *Parser = static_cast<Demangler *>(Context);
381
39
  size_t Len = std::strlen(MangledName);
382
39
  Parser->reset(MangledName, MangledName + Len);
383
39
  RootNode = Parser->parse();
384
39
  return RootNode == nullptr;
385
39
}
386
387
21
static char *printNode(const Node *RootNode, char *Buf, size_t *N) {
388
21
  OutputStream S;
389
21
  if (!initializeOutputStream(Buf, N, S, 128))
390
0
    return nullptr;
391
21
  RootNode->print(S);
392
21
  S += '\0';
393
21
  if (N != nullptr)
394
21
    *N = S.getCurrentPosition();
395
21
  return S.getBuffer();
396
21
}
397
398
20
char *ItaniumPartialDemangler::getFunctionBaseName(char *Buf, size_t *N) const {
399
20
  if (!isFunction())
400
0
    return nullptr;
401
20
402
20
  const Node *Name = static_cast<const FunctionEncoding *>(RootNode)->getName();
403
20
404
51
  while (true) {
405
51
    switch (Name->getKind()) {
406
51
    case Node::KAbiTagAttr:
407
2
      Name = static_cast<const AbiTagAttr *>(Name)->Base;
408
2
      continue;
409
51
    case Node::KStdQualifiedName:
410
1
      Name = static_cast<const StdQualifiedName *>(Name)->Child;
411
1
      continue;
412
51
    case Node::KNestedName:
413
17
      Name = static_cast<const NestedName *>(Name)->Name;
414
17
      continue;
415
51
    case Node::KLocalName:
416
4
      Name = static_cast<const LocalName *>(Name)->Entity;
417
4
      continue;
418
51
    case Node::KNameWithTemplateArgs:
419
7
      Name = static_cast<const NameWithTemplateArgs *>(Name)->Name;
420
7
      continue;
421
51
    default:
422
20
      return printNode(Name, Buf, N);
423
51
    }
424
51
  }
425
20
}
426
427
char *ItaniumPartialDemangler::getFunctionDeclContextName(char *Buf,
428
21
                                                          size_t *N) const {
429
21
  if (!isFunction())
430
0
    return nullptr;
431
21
  const Node *Name = static_cast<const FunctionEncoding *>(RootNode)->getName();
432
21
433
21
  OutputStream S;
434
21
  if (!initializeOutputStream(Buf, N, S, 128))
435
0
    return nullptr;
436
25
437
25
 KeepGoingLocalFunction:
438
33
  while (true) {
439
33
    if (Name->getKind() == Node::KAbiTagAttr) {
440
1
      Name = static_cast<const AbiTagAttr *>(Name)->Base;
441
1
      continue;
442
1
    }
443
32
    if (Name->getKind() == Node::KNameWithTemplateArgs) {
444
7
      Name = static_cast<const NameWithTemplateArgs *>(Name)->Name;
445
7
      continue;
446
7
    }
447
25
    break;
448
25
  }
449
25
450
25
  switch (Name->getKind()) {
451
25
  case Node::KStdQualifiedName:
452
1
    S += "std";
453
1
    break;
454
25
  case Node::KNestedName:
455
18
    static_cast<const NestedName *>(Name)->Qual->print(S);
456
18
    break;
457
25
  case Node::KLocalName: {
458
4
    auto *LN = static_cast<const LocalName *>(Name);
459
4
    LN->Encoding->print(S);
460
4
    S += "::";
461
4
    Name = LN->Entity;
462
4
    goto KeepGoingLocalFunction;
463
25
  }
464
25
  default:
465
2
    break;
466
21
  }
467
21
  S += '\0';
468
21
  if (N != nullptr)
469
21
    *N = S.getCurrentPosition();
470
21
  return S.getBuffer();
471
21
}
472
473
1
char *ItaniumPartialDemangler::getFunctionName(char *Buf, size_t *N) const {
474
1
  if (!isFunction())
475
1
    return nullptr;
476
0
  auto *Name = static_cast<FunctionEncoding *>(RootNode)->getName();
477
0
  return printNode(Name, Buf, N);
478
0
}
479
480
char *ItaniumPartialDemangler::getFunctionParameters(char *Buf,
481
20
                                                     size_t *N) const {
482
20
  if (!isFunction())
483
0
    return nullptr;
484
20
  NodeArray Params = static_cast<FunctionEncoding *>(RootNode)->getParams();
485
20
486
20
  OutputStream S;
487
20
  if (!initializeOutputStream(Buf, N, S, 128))
488
0
    return nullptr;
489
20
490
20
  S += '(';
491
20
  Params.printWithComma(S);
492
20
  S += ')';
493
20
  S += '\0';
494
20
  if (N != nullptr)
495
20
    *N = S.getCurrentPosition();
496
20
  return S.getBuffer();
497
20
}
498
499
char *ItaniumPartialDemangler::getFunctionReturnType(
500
20
    char *Buf, size_t *N) const {
501
20
  if (!isFunction())
502
0
    return nullptr;
503
20
504
20
  OutputStream S;
505
20
  if (!initializeOutputStream(Buf, N, S, 128))
506
0
    return nullptr;
507
20
508
20
  if (const Node *Ret =
509
6
          static_cast<const FunctionEncoding *>(RootNode)->getReturnType())
510
6
    Ret->print(S);
511
20
512
20
  S += '\0';
513
20
  if (N != nullptr)
514
20
    *N = S.getCurrentPosition();
515
20
  return S.getBuffer();
516
20
}
517
518
1
char *ItaniumPartialDemangler::finishDemangle(char *Buf, size_t *N) const {
519
1
  assert(RootNode != nullptr && "must call partialDemangle()");
520
1
  return printNode(static_cast<Node *>(RootNode), Buf, N);
521
1
}
522
523
2
bool ItaniumPartialDemangler::hasFunctionQualifiers() const {
524
2
  assert(RootNode != nullptr && "must call partialDemangle()");
525
2
  if (!isFunction())
526
0
    return false;
527
2
  auto *E = static_cast<const FunctionEncoding *>(RootNode);
528
2
  return E->getCVQuals() != QualNone || 
E->getRefQual() != FrefQualNone1
;
529
2
}
530
531
9
bool ItaniumPartialDemangler::isCtorOrDtor() const {
532
9
  const Node *N = static_cast<const Node *>(RootNode);
533
30
  while (N) {
534
30
    switch (N->getKind()) {
535
30
    default:
536
2
      return false;
537
30
    case Node::KCtorDtorName:
538
7
      return true;
539
30
540
30
    case Node::KAbiTagAttr:
541
1
      N = static_cast<const AbiTagAttr *>(N)->Base;
542
1
      break;
543
30
    case Node::KFunctionEncoding:
544
9
      N = static_cast<const FunctionEncoding *>(N)->getName();
545
9
      break;
546
30
    case Node::KLocalName:
547
0
      N = static_cast<const LocalName *>(N)->Entity;
548
0
      break;
549
30
    case Node::KNameWithTemplateArgs:
550
3
      N = static_cast<const NameWithTemplateArgs *>(N)->Name;
551
3
      break;
552
30
    case Node::KNestedName:
553
8
      N = static_cast<const NestedName *>(N)->Name;
554
8
      break;
555
30
    case Node::KStdQualifiedName:
556
0
      N = static_cast<const StdQualifiedName *>(N)->Child;
557
0
      break;
558
30
    }
559
30
  }
560
9
  
return false0
;
561
9
}
562
563
132
bool ItaniumPartialDemangler::isFunction() const {
564
132
  assert(RootNode != nullptr && "must call partialDemangle()");
565
132
  return static_cast<const Node *>(RootNode)->getKind() ==
566
132
         Node::KFunctionEncoding;
567
132
}
568
569
25
bool ItaniumPartialDemangler::isSpecialName() const {
570
25
  assert(RootNode != nullptr && "must call partialDemangle()");
571
25
  auto K = static_cast<const Node *>(RootNode)->getKind();
572
25
  return K == Node::KSpecialName || 
K == Node::KCtorVtableSpecialName23
;
573
25
}
574
575
23
bool ItaniumPartialDemangler::isData() const {
576
23
  return !isFunction() && 
!isSpecialName()2
;
577
23
}