Add DeclarationName::dump().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88876 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h
index ed4ac6b..a30f6e8 100644
--- a/include/clang/AST/DeclarationName.h
+++ b/include/clang/AST/DeclarationName.h
@@ -176,7 +176,6 @@
/// getNameKind - Determine what kind of name this is.
NameKind getNameKind() const;
-
/// getName - Retrieve the human-readable string for this name.
std::string getAsString() const;
@@ -249,6 +248,8 @@
static DeclarationName getTombstoneMarker() {
return DeclarationName(uintptr_t(-2));
}
+
+ void dump() const;
};
/// Ordering on two declaration names. If both names are identifiers,
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp
index 8664c50..d003594 100644
--- a/lib/AST/DeclarationName.cpp
+++ b/lib/AST/DeclarationName.cpp
@@ -310,6 +310,10 @@
return DeclarationName(Ptr);
}
+void DeclarationName::dump() const {
+ fprintf(stderr, "%s\n", getAsString().c_str());
+}
+
DeclarationNameTable::DeclarationNameTable() {
CXXSpecialNamesImpl = new llvm::FoldingSet<CXXSpecialName>;