projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Normalize SourceMgr messages.
[oota-llvm.git]
/
include
/
llvm
/
Support
/
SourceMgr.h
diff --git
a/include/llvm/Support/SourceMgr.h
b/include/llvm/Support/SourceMgr.h
index 53e7dd8dfbc24b0c9d1f448846361a7a3efe0f0b..23044a8bd032b822c82d99b39954add0f6e6cb42 100644
(file)
--- a/
include/llvm/Support/SourceMgr.h
+++ b/
include/llvm/Support/SourceMgr.h
@@
-30,6
+30,8
@@
public:
SMLoc() : Ptr(0) {}
SMLoc(const SMLoc &RHS) : Ptr(RHS.Ptr) {}
SMLoc() : Ptr(0) {}
SMLoc(const SMLoc &RHS) : Ptr(RHS.Ptr) {}
+ bool isValid() const { return Ptr != 0; }
+
bool operator==(const SMLoc &RHS) const { return RHS.Ptr == Ptr; }
bool operator!=(const SMLoc &RHS) const { return RHS.Ptr != Ptr; }
bool operator==(const SMLoc &RHS) const { return RHS.Ptr == Ptr; }
bool operator!=(const SMLoc &RHS) const { return RHS.Ptr != Ptr; }
@@
-107,10
+109,12
@@
public:
/// specified file. This is not a fast method.
unsigned FindLineNumber(SMLoc Loc, int BufferID = -1) const;
/// specified file. This is not a fast method.
unsigned FindLineNumber(SMLoc Loc, int BufferID = -1) const;
-
- /// PrintError - Emit an error message about the specified location with the
+ /// PrintMessage - Emit a message about the specified location with the
/// specified string.
/// specified string.
- void PrintError(SMLoc ErrorLoc, const std::string &Msg) const;
+ ///
+ /// @param Type - If non-null, the kind of message (e.g., "error") which is
+ /// prefixed to the message.
+ void PrintMessage(SMLoc Loc, const std::string &Msg, const char *Type) const;
private:
void PrintIncludeStack(SMLoc IncludeLoc) const;
private:
void PrintIncludeStack(SMLoc IncludeLoc) const;