[Driver] Don't crash on invalid values of -mrelocation-model=.
This is handled in a similar way we handle invalid -mcode-model.
PR: 31840
llvm-svn: 299315
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 874fd14..855d679 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -323,7 +323,8 @@
}
static llvm::Reloc::Model getRelocModel(const CodeGenOptions &CodeGenOpts) {
- // Keep this synced with the equivalent code in tools/driver/cc1as_main.cpp.
+ // Keep this synced with the equivalent code in
+ // lib/Frontend/CompilerInvocation.cpp
llvm::Optional<llvm::Reloc::Model> RM;
RM = llvm::StringSwitch<llvm::Reloc::Model>(CodeGenOpts.RelocationModel)
.Case("static", llvm::Reloc::Static)