r324915 - Further cleanup to Driver mode code, as suggested by dblaikie [NFC]
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 12 09:47:01 PST 2018
Author: erichkeane
Date: Mon Feb 12 09:47:01 2018
New Revision: 324915
URL: http://llvm.org/viewvc/llvm-project?rev=324915&view=rev
Log:
Further cleanup to Driver mode code, as suggested by dblaikie [NFC]
Modified:
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=324915&r1=324914&r2=324915&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Feb 12 09:47:01 2018
@@ -148,15 +148,13 @@ void Driver::setDriverModeFromOption(Str
return;
StringRef Value = Opt.drop_front(OptName.size());
- auto M = llvm::StringSwitch<llvm::Optional<DriverMode>>(Value)
- .Case("gcc", GCCMode)
- .Case("g++", GXXMode)
- .Case("cpp", CPPMode)
- .Case("cl", CLMode)
- .Default(None);
-
- if (M)
- Mode = M.getValue();
+ if (auto M = llvm::StringSwitch<llvm::Optional<DriverMode>>(Value)
+ .Case("gcc", GCCMode)
+ .Case("g++", GXXMode)
+ .Case("cpp", CPPMode)
+ .Case("cl", CLMode)
+ .Default(None))
+ Mode = *M;
else
Diag(diag::err_drv_unsupported_option_argument) << OptName << Value;
}
More information about the cfe-commits
mailing list