Author: yrnkrn Date: Fri Jan 29 07:46:15 2016 New Revision: 259192 URL: http://llvm.org/viewvc/llvm-project?rev=259192&view=rev Log: Implement TemplateArgument::dump() method for debugging, patterned after TemplateName::dump().
Modified: cfe/trunk/include/clang/AST/TemplateBase.h cfe/trunk/lib/AST/TemplateBase.cpp Modified: cfe/trunk/include/clang/AST/TemplateBase.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TemplateBase.h?rev=259192&r1=259191&r2=259192&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/TemplateBase.h (original) +++ cfe/trunk/include/clang/AST/TemplateBase.h Fri Jan 29 07:46:15 2016 @@ -354,6 +354,12 @@ public: /// \brief Print this template argument to the given output stream. void print(const PrintingPolicy &Policy, raw_ostream &Out) const; + /// \brief Debugging aid that dumps the template argument. + void dump(raw_ostream &Out) const; + + /// \brief Debugging aid that dumps the template argument to standard error. + void dump() const; + /// \brief Used to insert TemplateArguments into FoldingSets. void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const; }; Modified: cfe/trunk/lib/AST/TemplateBase.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TemplateBase.cpp?rev=259192&r1=259191&r2=259192&view=diff ============================================================================== --- cfe/trunk/lib/AST/TemplateBase.cpp (original) +++ cfe/trunk/lib/AST/TemplateBase.cpp Fri Jan 29 07:46:15 2016 @@ -415,6 +415,15 @@ void TemplateArgument::print(const Print } } +void TemplateArgument::dump(raw_ostream &Out) const { + LangOptions LO; // FIXME! see also TemplateName::dump(). + LO.CPlusPlus = true; + LO.Bool = true; + print(PrintingPolicy(LO), Out); +} + +void TemplateArgument::dump() const { dump(llvm::errs()); } + //===----------------------------------------------------------------------===// // TemplateArgumentLoc Implementation //===----------------------------------------------------------------------===// _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits