Minor renaming as suggested in review [NFC]

See D59455.

llvm-svn: 356430
This commit is contained in:
Aaron Puchert 2019-03-19 00:14:46 +00:00
parent 0f8041b6e2
commit dc087de14c
2 changed files with 16 additions and 15 deletions

View File

@ -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:

View File

@ -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));
}