Created
June 12, 2017 03:33
-
-
Save rui314/f82e5e42a79d86b3e273abf8e911314d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Compute the desired OpenMP runtime from the flags provided. | |
Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const { | |
- StringRef RuntimeName(CLANG_DEFAULT_OPENMP_RUNTIME); | |
+ OptValue RuntimeName = CLANG_DEFAULT_OPENMP_RUNTIME; | |
const Arg *A = Args.getLastArg(options::OPT_fopenmp_EQ); | |
if (A) | |
- RuntimeName = A->getValue(); | |
- | |
- auto RT = llvm::StringSwitch<OpenMPRuntimeKind>(RuntimeName) | |
- .Case("libomp", OMPRT_OMP) | |
- .Case("libgomp", OMPRT_GOMP) | |
- .Case("libiomp5", OMPRT_IOMP5) | |
- .Default(OMPRT_Unknown); | |
- | |
- if (RT == OMPRT_Unknown) { | |
+ RuntimeName = A->getEnumValue(); | |
+ | |
+ switch (RuntimeName) { | |
+ case options::VALUE_fopenmp_EQ::libomp: | |
+ return OMPRT_OMP; | |
+ case options::VALUE_fopenmp_EQ::libgomp: | |
+ return OMPRT_GOMP; | |
+ case options::VALUE_fopenmp_EQ::libiomp5: | |
+ return OMPRT_IOMP5 | |
+ default: | |
if (A) | |
Diag(diag::err_drv_unsupported_option_argument) | |
<< A->getOption().getName() << A->getValue(); | |
else | |
// FIXME: We could use a nicer diagnostic here. | |
Diag(diag::err_drv_unsupported_opt) << "-fopenmp"; | |
+ return RT; | |
} | |
- | |
- return RT; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment