r215706 - Const-correctness, return-after-else, and formatting updates. NFC.

Aaron Ballman aaron at aaronballman.com
Fri Aug 15 05:38:17 PDT 2014


Author: aaronballman
Date: Fri Aug 15 07:38:17 2014
New Revision: 215706

URL: http://llvm.org/viewvc/llvm-project?rev=215706&view=rev
Log:
Const-correctness, return-after-else, and formatting updates. NFC.

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

Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=215706&r1=215705&r2=215706&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Fri Aug 15 07:38:17 2014
@@ -1454,22 +1454,22 @@ class ThreadSafetyReporter : public clan
   const FunctionDecl *CurrentFunction;
   bool Verbose;
 
-  OptionalNotes getNotes() {
+  OptionalNotes getNotes() const {
     if (Verbose && CurrentFunction) {
       PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(),
-        S.PDiag(diag::note_thread_warning_in_fun)
-        << CurrentFunction->getNameAsString());
+                                S.PDiag(diag::note_thread_warning_in_fun)
+                                    << CurrentFunction->getNameAsString());
       return OptionalNotes(1, FNote);
     }
-    else return OptionalNotes();
+    return OptionalNotes();
   }
 
-  OptionalNotes getNotes(const PartialDiagnosticAt &Note) {
+  OptionalNotes getNotes(const PartialDiagnosticAt &Note) const {
     OptionalNotes ONS(1, Note);
     if (Verbose && CurrentFunction) {
       PartialDiagnosticAt FNote(CurrentFunction->getBody()->getLocStart(),
-        S.PDiag(diag::note_thread_warning_in_fun)
-        << CurrentFunction->getNameAsString());
+                                S.PDiag(diag::note_thread_warning_in_fun)
+                                    << CurrentFunction->getNameAsString());
       ONS.push_back(FNote);
     }
     return ONS;
@@ -1629,13 +1629,11 @@ class ThreadSafetyReporter : public clan
                                                        << LockName << LK);
       if (Verbose && POK == POK_VarAccess) {
         PartialDiagnosticAt Note(D->getLocation(),
-          S.PDiag(diag::note_guarded_by_declared_here) <<
-          D->getNameAsString());
+                                 S.PDiag(diag::note_guarded_by_declared_here)
+                                     << D->getNameAsString());
         Warnings.push_back(DelayedDiag(Warning, getNotes(Note)));
-      }
-      else {
+      } else
         Warnings.push_back(DelayedDiag(Warning, getNotes()));
-      }
     }
   }
 





More information about the cfe-commits mailing list