]> granicus.if.org Git - clang/commitdiff
Const-correctness, return-after-else, and formatting updates. NFC.
authorAaron Ballman <aaron@aaronballman.com>
Fri, 15 Aug 2014 12:38:17 +0000 (12:38 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 15 Aug 2014 12:38:17 +0000 (12:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215706 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/AnalysisBasedWarnings.cpp

index 93ee16b4c52df428c4f78279d7e56b76c2a0e7cf..20b7a0240dbf58ddcdac2737954f2f20d5e3deeb 100644 (file)
@@ -1454,22 +1454,22 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {
   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 clang::threadSafety::ThreadSafetyHandler {
                                                        << 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()));
-      }
     }
   }