From: Aaron Puchert Date: Tue, 19 Mar 2019 00:14:46 +0000 (+0000) Subject: Minor renaming as suggested in review [NFC] X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8478675074cc50d3534e966bd1c8488e6f8fcfef;p=clang Minor renaming as suggested in review [NFC] See D59455. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356430 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/Analyses/ThreadSafety.h b/include/clang/Analysis/Analyses/ThreadSafety.h index 79cdac2527..18659aa4e5 100644 --- a/include/clang/Analysis/Analyses/ThreadSafety.h +++ b/include/clang/Analysis/Analyses/ThreadSafety.h @@ -120,20 +120,21 @@ public: /// \param Expected -- the kind of lock expected. /// \param Received -- the kind of lock received. /// \param LocLocked -- The SourceLocation of the Lock. - /// \param Loc -- The SourceLocation of the Unlock. + /// \param LocUnlock -- The SourceLocation of the Unlock. virtual void handleIncorrectUnlockKind(StringRef Kind, Name LockName, LockKind Expected, LockKind Received, SourceLocation LocLocked, - SourceLocation Loc) {} + SourceLocation LocUnlock) {} /// Warn about lock function calls for locks which are already held. /// \param Kind -- the capability's name parameter (role, mutex, etc). /// \param LockName -- A StringRef name for the lock expression, to be printed /// in the error message. /// \param LocLocked -- The location of the first lock expression. - /// \param Loc -- The location of the second lock expression. + /// \param LocDoubleLock -- The location of the second lock expression. virtual void handleDoubleLock(StringRef Kind, Name LockName, - SourceLocation LocLocked, SourceLocation Loc) {} + SourceLocation LocLocked, + SourceLocation LocDoubleLock) {} /// Warn about situations where a mutex is sometimes held and sometimes not. /// The three situations are: diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 00fa33f960..d4aa701867 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -1687,22 +1687,22 @@ class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler { void handleIncorrectUnlockKind(StringRef Kind, Name LockName, LockKind Expected, LockKind Received, SourceLocation LocLocked, - SourceLocation Loc) override { - if (Loc.isInvalid()) - Loc = FunLocation; - PartialDiagnosticAt Warning(Loc, S.PDiag(diag::warn_unlock_kind_mismatch) - << Kind << LockName << Received - << Expected); + SourceLocation LocUnlock) override { + if (LocUnlock.isInvalid()) + LocUnlock = FunLocation; + PartialDiagnosticAt Warning( + LocUnlock, S.PDiag(diag::warn_unlock_kind_mismatch) + << Kind << LockName << Received << Expected); Warnings.emplace_back(std::move(Warning), makeLockedHereNote(LocLocked, Kind)); } void handleDoubleLock(StringRef Kind, Name LockName, SourceLocation LocLocked, - SourceLocation Loc) override { - if (Loc.isInvalid()) - Loc = FunLocation; - PartialDiagnosticAt Warning(Loc, S.PDiag(diag::warn_double_lock) - << Kind << LockName); + SourceLocation LocDoubleLock) override { + if (LocDoubleLock.isInvalid()) + LocDoubleLock = FunLocation; + PartialDiagnosticAt Warning(LocDoubleLock, S.PDiag(diag::warn_double_lock) + << Kind << LockName); Warnings.emplace_back(std::move(Warning), makeLockedHereNote(LocLocked, Kind)); }