]> granicus.if.org Git - clang/commitdiff
introduce the one true Diag method for Sema. Next up: kill all the others off.
authorChris Lattner <sabre@nondot.org>
Tue, 18 Nov 2008 21:53:24 +0000 (21:53 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Nov 2008 21:53:24 +0000 (21:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59556 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp
lib/Sema/Sema.h

index c064e2448b2cf678aed61379785c1cac1a7d99c7..00ad949fb05936083561f9b8637c5a1929f22818 100644 (file)
@@ -168,9 +168,9 @@ void Sema::ActOnEndOfTranslationUnit() {
 // 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) {
index 66c01386147a4cbd9bcf3f333d5536eb14420bcf..014565dea4a061d22f0760a407445a0bf2955105 100644 (file)
@@ -237,9 +237,8 @@ public:
   
   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);