OSDN Git Service

Removing default case statement from covered switch.
authorKeith Wyss <wyssman@gmail.com>
Fri, 13 Oct 2017 00:06:35 +0000 (00:06 +0000)
committerKeith Wyss <wyssman@gmail.com>
Fri, 13 Oct 2017 00:06:35 +0000 (00:06 +0000)
Previous patch did not count on the llvm command line parser to restrict the
inputs, but it is safe to do so.

Fix forward for patch with details:
-- https://reviews.llvm.org/D38650 and
-- https://llvm.org/svn/llvm-project/llvm/trunk@315635 91177308-0d34-0410-b5e6-96231b3b80d8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315644 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-xray/xray-stacks.cc

index be3d9d5..fd5df82 100644 (file)
@@ -798,10 +798,6 @@ static CommandRegistration Unused(&Stack, []() -> Error {
         ST.printAllAggregatingThreads<AggregationType::INVOCATION_COUNT>(
             outs(), FuncIdHelper, StacksOutputFormat);
         break;
-      default:
-        return make_error<StringError>(
-            "Illegal value for aggregation-type.",
-            make_error_code(errc::result_out_of_range));
       }
     } else {
       switch (RequestedAggregation) {
@@ -813,10 +809,6 @@ static CommandRegistration Unused(&Stack, []() -> Error {
         ST.printAllPerThread<AggregationType::INVOCATION_COUNT>(
             outs(), FuncIdHelper, StacksOutputFormat);
         break;
-      default:
-        return make_error<StringError>(
-            "Illegal value for aggregation-type.",
-            make_error_code(errc::result_out_of_range));
       }
     }
     return Error::success();