Normalize SourceMgr messages.
[oota-llvm.git] / include / llvm / Support / SourceMgr.h
index 25775cb74419d514201fa16d43071a11e83e747e..23044a8bd032b822c82d99b39954add0f6e6cb42 100644 (file)
@@ -30,6 +30,8 @@ public:
   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; }
 
@@ -109,7 +111,10 @@ public:
   
   /// PrintMessage - Emit a message about the specified location with the
   /// specified string.
-  void PrintMessage(SMLoc Loc, 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;