Use default instead of a specific case to fix the MSVC warning in sysinfo.cc#149159
Use default instead of a specific case to fix the MSVC warning in sysinfo.cc#149159dpaoliello merged 1 commit intollvm:mainfrom
Conversation
|
@llvm/pr-subscribers-third-party-benchmark Author: Daniel Paoliello (dpaoliello) Changes#147357 attempted to fix an MSVC in sysinfo.cc by adding a However, this resulted in CI failures: The root cause is that the enum being switched on is defined in the Windows SDK, so depending on which version of the SDK you are using The correct fix here is to use a Full diff: https://github.com/llvm/llvm-project/pull/149159.diff 1 Files Affected:
diff --git a/third-party/benchmark/src/sysinfo.cc b/third-party/benchmark/src/sysinfo.cc
index 837be8f9cf891..d1ae6cc82b943 100644
--- a/third-party/benchmark/src/sysinfo.cc
+++ b/third-party/benchmark/src/sysinfo.cc
@@ -371,7 +371,7 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizesWindows() {
case CacheTrace:
C.type = "Trace";
break;
- case CacheUnknown:
+ default:
C.type = "Unknown";
break;
}
|
|
If this will fix the Windows build, can we get this in soon? My Windows bot is still failing and I'd like to get it green again: https://lab.llvm.org/buildbot/#/builders/46 |
|
Thank you for the quick fix! |
#147357 attempted to fix an MSVC in sysinfo.cc by adding a
caseblock for a missing enum value.However, this resulted in CI failures:
The root cause is that the enum being switched on is defined in the Windows SDK, so depending on which version of the SDK you are using
CacheUnknownmay or may not be defined.The correct fix here is to use a
defaultblock in the switch statement instead.