aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/SourceMgr.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-30 00:49:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-30 00:49:23 +0000
commitc9dc78ae4075af8f081b90edc7f372ca5b513b21 (patch)
tree574ed24e0d22a15ba2816f697235877a2d9cbf84 /llvm/lib/Support/SourceMgr.cpp
parent8e66e0bab4c14b79ae7dcff7a447c5d3f6a4eae4 (diff)
downloadllvm-c9dc78ae4075af8f081b90edc7f372ca5b513b21.zip
llvm-c9dc78ae4075af8f081b90edc7f372ca5b513b21.tar.gz
llvm-c9dc78ae4075af8f081b90edc7f372ca5b513b21.tar.bz2
Normalize SourceMgr messages.
- Don't print "Parsing" in front of every message. - Take additional "type" argument which is prepended to the message (with ": ") if given. - Update clients to print errors (warnings) as: <filename>:<line number>: error(warning): ... llvm-svn: 74489
Diffstat (limited to 'llvm/lib/Support/SourceMgr.cpp')
-rw-r--r--llvm/lib/Support/SourceMgr.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp
index d789f10..6232265 100644
--- a/llvm/lib/Support/SourceMgr.cpp
+++ b/llvm/lib/Support/SourceMgr.cpp
@@ -90,7 +90,8 @@ void SourceMgr::PrintIncludeStack(SMLoc IncludeLoc) const {
}
-void SourceMgr::PrintMessage(SMLoc Loc, const std::string &Msg) const {
+void SourceMgr::PrintMessage(SMLoc Loc, const std::string &Msg,
+ const char *Type) const {
raw_ostream &OS = errs();
// First thing to do: find the current buffer containing the specified
@@ -103,9 +104,12 @@ void SourceMgr::PrintMessage(SMLoc Loc, const std::string &Msg) const {
MemoryBuffer *CurMB = getBufferInfo(CurBuf).Buffer;
- OS << "Parsing " << CurMB->getBufferIdentifier() << ":"
+ OS << CurMB->getBufferIdentifier() << ":"
<< FindLineNumber(Loc, CurBuf) << ": ";
-
+
+ if (Type)
+ OS << Type << ": ";
+
OS << Msg << "\n";
// Scan backward to find the start of the line.