[PATCH] D50661: Add a newline to SourceLocation dump output

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 13:32:48 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL339810: Add a newline to SourceLocation dump output (authored by steveire, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D50661

Files:
  cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
  cfe/trunk/lib/AST/CommentLexer.cpp
  cfe/trunk/lib/Analysis/LiveVariables.cpp
  cfe/trunk/lib/Basic/Diagnostic.cpp
  cfe/trunk/lib/Basic/SourceLocation.cpp
  cfe/trunk/lib/Lex/Preprocessor.cpp


Index: cfe/trunk/lib/Lex/Preprocessor.cpp
===================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp
+++ cfe/trunk/lib/Lex/Preprocessor.cpp
@@ -250,7 +250,7 @@
 }
 
 void Preprocessor::DumpLocation(SourceLocation Loc) const {
-  Loc.dump(SourceMgr);
+  Loc.print(llvm::errs(), SourceMgr);
 }
 
 void Preprocessor::DumpMacro(const MacroInfo &MI) const {
Index: cfe/trunk/lib/AST/CommentLexer.cpp
===================================================================
--- cfe/trunk/lib/AST/CommentLexer.cpp
+++ cfe/trunk/lib/AST/CommentLexer.cpp
@@ -21,7 +21,7 @@
 
 void Token::dump(const Lexer &L, const SourceManager &SM) const {
   llvm::errs() << "comments::Token Kind=" << Kind << " ";
-  Loc.dump(SM);
+  Loc.print(llvm::errs(), SM);
   llvm::errs() << " " << Length << " \"" << L.getSpelling(*this, SM) << "\"\n";
 }
 
Index: cfe/trunk/lib/Analysis/LiveVariables.cpp
===================================================================
--- cfe/trunk/lib/Analysis/LiveVariables.cpp
+++ cfe/trunk/lib/Analysis/LiveVariables.cpp
@@ -626,7 +626,7 @@
          de = declVec.end(); di != de; ++di) {
       llvm::errs() << " " << (*di)->getDeclName().getAsString()
                    << " <";
-      (*di)->getLocation().dump(M);
+      (*di)->getLocation().print(llvm::errs(), M);
       llvm::errs() << ">\n";
     }
   }
Index: cfe/trunk/lib/Basic/SourceLocation.cpp
===================================================================
--- cfe/trunk/lib/Basic/SourceLocation.cpp
+++ cfe/trunk/lib/Basic/SourceLocation.cpp
@@ -77,6 +77,7 @@
 
 LLVM_DUMP_METHOD void SourceLocation::dump(const SourceManager &SM) const {
   print(llvm::errs(), SM);
+  llvm::errs() << '\n';
 }
 
 //===----------------------------------------------------------------------===//
Index: cfe/trunk/lib/Basic/Diagnostic.cpp
===================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp
+++ cfe/trunk/lib/Basic/Diagnostic.cpp
@@ -239,7 +239,7 @@
 void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr,
                                            StringRef DiagName) const {
   llvm::errs() << "diagnostic state at ";
-  CurDiagStateLoc.dump(SrcMgr);
+  CurDiagStateLoc.print(llvm::errs(), SrcMgr);
   llvm::errs() << ": " << CurDiagState << "\n";
 
   for (auto &F : Files) {
@@ -261,7 +261,7 @@
                      << Decomp.first.getHashValue() << "> ";
         SrcMgr.getLocForStartOfFile(Decomp.first)
               .getLocWithOffset(Decomp.second)
-              .dump(SrcMgr);
+              .print(llvm::errs(), SrcMgr);
       }
       if (File.HasLocalTransitions)
         llvm::errs() << " has_local_transitions";
@@ -281,7 +281,7 @@
         llvm::errs() << "  ";
         SrcMgr.getLocForStartOfFile(ID)
               .getLocWithOffset(Transition.Offset)
-              .dump(SrcMgr);
+              .print(llvm::errs(), SrcMgr);
         llvm::errs() << ": state " << Transition.State << ":\n";
       };
 
Index: cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
===================================================================
--- cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
+++ cfe/trunk/lib/ARCMigrate/TransGCAttrs.cpp
@@ -340,7 +340,7 @@
     llvm::errs() << "KIND: "
         << (Attr.Kind == GCAttrOccurrence::Strong ? "strong" : "weak");
     llvm::errs() << "\nLOC: ";
-    Attr.Loc.dump(Pass.Ctx.getSourceManager());
+    Attr.Loc.print(llvm::errs(), Pass.Ctx.getSourceManager());
     llvm::errs() << "\nTYPE: ";
     Attr.ModifiedType.dump();
     if (Attr.Dcl) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50661.160910.patch
Type: text/x-patch
Size: 3567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180815/ce7342b9/attachment.bin>


More information about the cfe-commits mailing list