Author: lattner
Date: Tue Nov 18 15:53:24 2008
New Revision: 59556

URL: http://llvm.org/viewvc/llvm-project?rev=59556&view=rev
Log:
introduce the one true Diag method for Sema.  Next up: kill all the others off.

Modified:
    cfe/trunk/lib/Sema/Sema.cpp
    cfe/trunk/lib/Sema/Sema.h

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=59556&r1=59555&r2=59556&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Tue Nov 18 15:53:24 2008
@@ -168,9 +168,9 @@
 // Helper functions.
 
//===----------------------------------------------------------------------===//
 
-bool Sema::Diag(SourceLocation Loc, unsigned DiagID) {
-  PP.getDiagnostics().Report(PP.getFullLoc(Loc), DiagID);
-  return true;
+DiagnosticInfo Sema::Diag(SourceLocation Loc, unsigned DiagID) {
+  return PP.getDiagnostics().Report(FullSourceLoc(Loc, PP.getSourceManager()),
+                                    DiagID);
 }
 
 bool Sema::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg) {

Modified: cfe/trunk/lib/Sema/Sema.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=59556&r1=59555&r2=59556&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Tue Nov 18 15:53:24 2008
@@ -237,9 +237,8 @@
   
   const LangOptions &getLangOptions() const;
   
-  /// The primitive diagnostic helpers - always returns true, which simplifies 
-  /// error handling (i.e. less code).
-  bool Diag(SourceLocation Loc, unsigned DiagID);
+  /// The primitive diagnostic helpers.
+  DiagnosticInfo Diag(SourceLocation Loc, unsigned DiagID);
   bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg);
   bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg1,
             const std::string &Msg2);


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to