diff options
author | Stephen Kelly <steveire@gmail.com> | 2018-08-15 20:32:06 +0000 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2018-08-15 20:32:06 +0000 |
commit | 8601e55c98b1dddab0ce64d58937b31f590390ca (patch) | |
tree | 9fe1d64ae3a3ecf573a26cd1c06f049f333a63af | |
parent | d032410f8ef9a4e1d3086ddd8211c4555bfef8f5 (diff) |
Add a newline to SourceLocation dump output
Summary:
Migrate callers to print().
dump() should be useful to downstreams and third parties as a debugging
aid. Everyone trips up on this and creates confusing output.
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D50661
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339810 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/ARCMigrate/TransGCAttrs.cpp | 2 | ||||
-rw-r--r-- | lib/AST/CommentLexer.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 2 | ||||
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 6 | ||||
-rw-r--r-- | lib/Basic/SourceLocation.cpp | 1 | ||||
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 2 |
6 files changed, 8 insertions, 7 deletions
diff --git a/lib/ARCMigrate/TransGCAttrs.cpp b/lib/ARCMigrate/TransGCAttrs.cpp index fb45cd92c1..ef36dcabb5 100644 --- a/lib/ARCMigrate/TransGCAttrs.cpp +++ b/lib/ARCMigrate/TransGCAttrs.cpp @@ -340,7 +340,7 @@ void MigrationContext::dumpGCAttrs() { 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) { diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp index 8d401ff5c7..c43275318d 100644 --- a/lib/AST/CommentLexer.cpp +++ b/lib/AST/CommentLexer.cpp @@ -21,7 +21,7 @@ namespace comments { 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"; } diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 4e063f4ca7..ca82515ffa 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -626,7 +626,7 @@ void LiveVariablesImpl::dumpBlockLiveness(const SourceManager &M) { de = declVec.end(); di != de; ++di) { llvm::errs() << " " << (*di)->getDeclName().getAsString() << " <"; - (*di)->getLocation().dump(M); + (*di)->getLocation().print(llvm::errs(), M); llvm::errs() << ">\n"; } } diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index f1ebd9d38b..88ee319b5c 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -239,7 +239,7 @@ DiagnosticsEngine::DiagStateMap::getFile(SourceManager &SrcMgr, 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 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr, << 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 @@ void DiagnosticsEngine::DiagStateMap::dump(SourceManager &SrcMgr, llvm::errs() << " "; SrcMgr.getLocForStartOfFile(ID) .getLocWithOffset(Transition.Offset) - .dump(SrcMgr); + .print(llvm::errs(), SrcMgr); llvm::errs() << ": state " << Transition.State << ":\n"; }; diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp index eb916ec76f..27eb1191fd 100644 --- a/lib/Basic/SourceLocation.cpp +++ b/lib/Basic/SourceLocation.cpp @@ -77,6 +77,7 @@ SourceLocation::printToString(const SourceManager &SM) const { LLVM_DUMP_METHOD void SourceLocation::dump(const SourceManager &SM) const { print(llvm::errs(), SM); + llvm::errs() << '\n'; } //===----------------------------------------------------------------------===// diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index bfeaa03d85..c7da41172f 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -250,7 +250,7 @@ void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const { } void Preprocessor::DumpLocation(SourceLocation Loc) const { - Loc.dump(SourceMgr); + Loc.print(llvm::errs(), SourceMgr); } void Preprocessor::DumpMacro(const MacroInfo &MI) const { |