Skip to content

Commit 6f660e2

Browse files
authored
Fix MSVC warning in benchmark (#147357)
Building LLVM with MSVC is raising the following warning: ``` llvm\third-party\benchmark\src\sysinfo.cc(375): warning C4062: enumerator 'CacheUnknown' in switch of enum '_PROCESSOR_CACHE_TYPE' is not handled ``` This change resolves the warning by moving the `Unknown` type into a case block for `CacheUnknown`. Not sure how this code flows back into the original source.
1 parent b470ac4 commit 6f660e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

third-party/benchmark/src/sysinfo.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizesWindows() {
358358
C.num_sharing = static_cast<int>(b.count());
359359
C.level = cache.Level;
360360
C.size = cache.Size;
361-
C.type = "Unknown";
362361
switch (cache.Type) {
363362
case CacheUnified:
364363
C.type = "Unified";
@@ -372,6 +371,9 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizesWindows() {
372371
case CacheTrace:
373372
C.type = "Trace";
374373
break;
374+
case CacheUnknown:
375+
C.type = "Unknown";
376+
break;
375377
}
376378
res.push_back(C);
377379
}

0 commit comments

Comments
 (0)