From: Lei Zhang Date: Tue, 7 May 2019 21:03:15 +0000 (-0700) Subject: Inline a string used in lambda function to fix capture error X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=323e1bf7f8ea434e6fac6ae868daf5c9af96cc61;p=platform%2Fupstream%2Fllvm.git Inline a string used in lambda function to fix capture error The string was referenced but not captured in the lambda, which causes a failure when compiling with MSVC. This issue was discovered by @loic-joly-sonarsource with a proposed fix in https://github.com/tensorflow/mlir/pull/22. -- PiperOrigin-RevId: 247085897 --- diff --git a/mlir/lib/Transforms/Vectorization/VectorizerTestPass.cpp b/mlir/lib/Transforms/Vectorization/VectorizerTestPass.cpp index ecb391c..753f7cf 100644 --- a/mlir/lib/Transforms/Vectorization/VectorizerTestPass.cpp +++ b/mlir/lib/Transforms/Vectorization/VectorizerTestPass.cpp @@ -145,13 +145,12 @@ static std::string toString(Operation *op) { } static NestedPattern patternTestSlicingOps() { - // Just use a custom op name for this test, it makes life easier. - constexpr auto kTestSlicingOpName = "slicing-test-op"; using functional::map; using matcher::Op; // Match all operations with the kTestSlicingOpName name. auto filter = [](Operation &op) { - return op.getName().getStringRef() == kTestSlicingOpName; + // Just use a custom op name for this test, it makes life easier. + return op.getName().getStringRef() == "slicing-test-op"; }; return Op(filter); }