Index: include/clang/Basic/SourceLocation.h =================================================================== --- include/clang/Basic/SourceLocation.h +++ include/clang/Basic/SourceLocation.h @@ -220,6 +220,8 @@ bool operator!=(const SourceRange &X) const { return B != X.B || E != X.E; } + + void dump(const SourceManager &SM) const; }; /// Represents a character-granular source range. Index: lib/Basic/SourceLocation.cpp =================================================================== --- lib/Basic/SourceLocation.cpp +++ lib/Basic/SourceLocation.cpp @@ -80,6 +80,14 @@ llvm::errs() << '\n'; } +LLVM_DUMP_METHOD void SourceRange::dump(const SourceManager &SM) const { + llvm::errs() << '['; + B.print(llvm::errs(), SM); + llvm::errs() << ",\n "; + E.print(llvm::errs(), SM); + llvm::errs() << "]\n"; +} + //===----------------------------------------------------------------------===// // FullSourceLoc //===----------------------------------------------------------------------===//