summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/demangle/ItaniumDemangle.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxxabi/src/demangle/ItaniumDemangle.h')
-rw-r--r--libcxxabi/src/demangle/ItaniumDemangle.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h
index 9e9d183da7c..53107c9c8d9 100644
--- a/libcxxabi/src/demangle/ItaniumDemangle.h
+++ b/libcxxabi/src/demangle/ItaniumDemangle.h
@@ -7,22 +7,21 @@
//
//===----------------------------------------------------------------------===//
//
-// WARNING: This file defines its contents within an anonymous namespace. It
-// should not be included anywhere other than cxa_demangle.h.
+// Generic itanium demangler library. This file has two byte-per-byte identical
+// copies in the source tree, one in libcxxabi, and the other in llvm.
//
//===----------------------------------------------------------------------===//
-#ifndef LIBCXX_DEMANGLE_ITANIUMDEMANGLE_H
-#define LIBCXX_DEMANGLE_ITANIUMDEMANGLE_H
+#ifndef DEMANGLE_ITANIUMDEMANGLE_H
+#define DEMANGLE_ITANIUMDEMANGLE_H
// FIXME: (possibly) incomplete list of features that clang mangles that this
// file does not yet support:
// - C++ modules TS
-#include "Compiler.h"
+#include "DemangleConfig.h"
#include "StringView.h"
#include "Utility.h"
-
#include <cassert>
#include <cctype>
#include <cstdio>
@@ -100,8 +99,8 @@
X(BracedExpr) \
X(BracedRangeExpr)
-namespace {
-namespace itanium_demangle {
+DEMANGLE_NAMESPACE_BEGIN
+
// Base class of all AST nodes. The AST is built by the parser, then is
// traversed by the printLeft/Right functions to produce a demangled string.
class Node {
@@ -199,7 +198,7 @@ public:
virtual ~Node() = default;
#ifndef NDEBUG
- DUMP_METHOD void dump() const;
+ DEMANGLE_DUMP_METHOD void dump() const;
#endif
};
@@ -1283,7 +1282,7 @@ public:
case SpecialSubKind::iostream:
return StringView("basic_iostream");
}
- _LIBCPP_UNREACHABLE();
+ DEMANGLE_UNREACHABLE;
}
void printLeft(OutputStream &S) const override {
@@ -1335,7 +1334,7 @@ public:
case SpecialSubKind::iostream:
return StringView("iostream");
}
- _LIBCPP_UNREACHABLE();
+ DEMANGLE_UNREACHABLE;
}
void printLeft(OutputStream &S) const override {
@@ -3472,7 +3471,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
Result = getDerived().parseFunctionType();
break;
}
- _LIBCPP_FALLTHROUGH();
+ DEMANGLE_FALLTHROUGH;
}
case 'U': {
Result = getDerived().parseQualifiedType();
@@ -3759,7 +3758,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseType() {
// substitution table.
return Sub;
}
- _LIBCPP_FALLTHROUGH();
+ DEMANGLE_FALLTHROUGH;
}
// ::= <class-enum-type>
default: {
@@ -5183,7 +5182,6 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
Alloc>::AbstractManglingParser;
};
-} // namespace itanium_demangle
-} // namespace
+DEMANGLE_NAMESPACE_END
-#endif // LIBCXX_DEMANGLE_ITANIUMDEMANGLE_H
+#endif // DEMANGLE_ITANIUMDEMANGLE_H
OpenPOWER on IntegriCloud