[llvm] r276661 - Revert "StringSwitch cannot be copied or moved."
Jordan Rose via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 25 10:28:33 PDT 2016
Author: jrose
Date: Mon Jul 25 12:28:33 2016
New Revision: 276661
URL: http://llvm.org/viewvc/llvm-project?rev=276661&view=rev
Log:
Revert "StringSwitch cannot be copied or moved."
This reverts commit r276652. The clang-query tool is currently
relying on this behavior. I'll try again later.
Modified:
llvm/trunk/include/llvm/ADT/StringSwitch.h
llvm/trunk/lib/Passes/PassBuilder.cpp
Modified: llvm/trunk/include/llvm/ADT/StringSwitch.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringSwitch.h?rev=276661&r1=276660&r2=276661&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringSwitch.h (original)
+++ llvm/trunk/include/llvm/ADT/StringSwitch.h Mon Jul 25 12:28:33 2016
@@ -53,13 +53,6 @@ public:
explicit StringSwitch(StringRef S)
: Str(S), Result(nullptr) { }
- // StringSwitch is neither copyable nor movable.
- StringSwitch(const StringSwitch &) = delete;
- StringSwitch(StringSwitch &&) = delete;
- void operator=(const StringSwitch &) = delete;
- void operator=(StringSwitch &&) = delete;
- ~StringSwitch() = default;
-
template<unsigned N>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch& Case(const char (&S)[N], const T& Value) {
Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=276661&r1=276660&r2=276661&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Mon Jul 25 12:28:33 2016
@@ -334,13 +334,13 @@ bool PassBuilder::parseModulePassName(Mo
return false;
assert(Matches.size() == 3 && "Must capture two matched strings!");
- OptimizationLevel L = StringSwitch<OptimizationLevel>(Matches[2])
- .Case("O0", O0)
- .Case("O1", O1)
- .Case("O2", O2)
- .Case("O3", O3)
- .Case("Os", Os)
- .Case("Oz", Oz);
+ auto L = StringSwitch<OptimizationLevel>(Matches[2])
+ .Case("O0", O0)
+ .Case("O1", O1)
+ .Case("O2", O2)
+ .Case("O3", O3)
+ .Case("Os", Os)
+ .Case("Oz", Oz);
if (Matches[1] == "default") {
addPerModuleDefaultPipeline(MPM, L, DebugLogging);
More information about the llvm-commits
mailing list