Constify NestedNameSpecifier::dump and add a no-argument dump function suitable for calling from a debugger.

llvm-svn: 256472
This commit is contained in:
Yaron Keren 2015-12-27 14:34:22 +00:00
parent 7574241053
commit 015e6c8a6a
2 changed files with 8 additions and 2 deletions

View File

@ -217,7 +217,8 @@ public:
/// \brief Dump the nested name specifier to standard output to aid /// \brief Dump the nested name specifier to standard output to aid
/// in debugging. /// in debugging.
void dump(const LangOptions &LO); void dump(const LangOptions &LO) const;
void dump() const;
}; };
/// \brief A C++ nested-name-specifier augmented with source location /// \brief A C++ nested-name-specifier augmented with source location

View File

@ -318,7 +318,12 @@ NestedNameSpecifier::print(raw_ostream &OS,
OS << "::"; OS << "::";
} }
void NestedNameSpecifier::dump(const LangOptions &LO) { void NestedNameSpecifier::dump(const LangOptions &LO) const {
print(llvm::errs(), PrintingPolicy(LO));
}
void NestedNameSpecifier::dump() const {
LangOptions LO;
print(llvm::errs(), PrintingPolicy(LO)); print(llvm::errs(), PrintingPolicy(LO));
} }