[llvm] r348486 - Fix -Wcovered-switch-default warning. NFCI.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 10:38:30 PST 2018


On Thu, Dec 6, 2018 at 6:04 AM Simon Pilgrim via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rksimon
> Date: Thu Dec  6 06:02:02 2018
> New Revision: 348486
>
> URL: http://llvm.org/viewvc/llvm-project?rev=348486&view=rev
> Log:
> Fix -Wcovered-switch-default warning. NFCI.
>
> Modified:
>     llvm/trunk/utils/benchmark/src/sysinfo.cc
>
> Modified: llvm/trunk/utils/benchmark/src/sysinfo.cc
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/benchmark/src/sysinfo.cc?rev=348486&r1=348485&r2=348486&view=diff
>
> ==============================================================================
> --- llvm/trunk/utils/benchmark/src/sysinfo.cc (original)
> +++ llvm/trunk/utils/benchmark/src/sysinfo.cc Thu Dec  6 06:02:02 2018
> @@ -333,6 +333,7 @@ std::vector<CPUInfo::CacheInfo> GetCache
>      C.num_sharing = static_cast<int>(B.count());
>      C.level = Cache->Level;
>      C.size = Cache->Size;
> +    C.type = "Unknown";
>

Is this ^ necessary, given that all the cases assign a value to C.type in
the end anyway? Looks like this assignment is a dead store, perhaps?


>      switch (Cache->Type) {
>        case CacheUnified:
>          C.type = "Unified";
> @@ -346,9 +347,6 @@ std::vector<CPUInfo::CacheInfo> GetCache
>        case CacheTrace:
>          C.type = "Trace";
>          break;
> -      default:
> -        C.type = "Unknown";
> -        break;
>      }
>      res.push_back(C);
>    }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181210/d7cbc498/attachment.html>


More information about the llvm-commits mailing list