[profile] Suppress spurious 'expected profile to require unlock' warning

In %c (continuous sync) mode, avoid attempting to unlock an
already-unlocked profile.

The profile is only locked when profile merging is enabled.
This commit is contained in:
Vedant Kumar 2020-10-26 16:23:06 -07:00
parent 5b3bf8b453
commit a77a739abc
2 changed files with 3 additions and 2 deletions

View File

@ -668,7 +668,8 @@ static void initializeProfileForContinuousMode(void) {
FileOffsetToCounters);
}
unlockProfile(&ProfileRequiresUnlock, File);
if (ProfileRequiresUnlock)
unlockProfile(&ProfileRequiresUnlock, File);
#endif // defined(__Fuchsia__) || defined(_WIN32)
}

View File

@ -5,7 +5,7 @@
// RUN: %clang_pgogen -dynamiclib -o %t.dso1.dylib %t.dso1.c
// RUN: %clang_pgogen -dynamiclib -o %t.dso2.dylib %t.dso2.c
// RUN: %clang_pgogen -o %t.exe %s %t.dso1.dylib %t.dso2.dylib
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 2>&1 | count 0
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s
// CHECK-LABEL: Counters: