steveire created this revision.
Herald added a subscriber: cfe-commits.

Repository:
  rC Clang

https://reviews.llvm.org/D50662

Files:
  include/clang/Basic/SourceLocation.h
  lib/Basic/SourceLocation.cpp


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
 
//===----------------------------------------------------------------------===//
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
 //===----------------------------------------------------------------------===//
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.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to