mirror of https://github.com/microsoft/clang.git
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
This commit is contained in:
parent
d032410f8e
commit
8601e55c98
|
@ -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) {
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue