mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-15 23:40:54 +00:00
Produce an error when trying to link with -emit-llvm.
llvm-svn: 189193
This commit is contained in:
parent
a4fe3a1259
commit
e8025644b2
@ -109,6 +109,8 @@ def err_drv_mg_requires_m_or_mm : Error<
|
||||
"option '-MG' requires '-M' or '-MM'">;
|
||||
def err_drv_unknown_objc_runtime : Error<
|
||||
"unknown or ill-formed Objective-C runtime '%0'">;
|
||||
def err_drv_emit_llvm_link : Error<
|
||||
"-emit-llvm cannot be used when linking">;
|
||||
|
||||
def warn_c_kext : Warning<
|
||||
"ignoring -fapple-kext which is valid for C++ and Objective-C++ only">;
|
||||
|
@ -1171,6 +1171,10 @@ void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args,
|
||||
Arg *FinalPhaseArg;
|
||||
phases::ID FinalPhase = getFinalPhase(Args, &FinalPhaseArg);
|
||||
|
||||
if (FinalPhase == phases::Link && Args.hasArg(options::OPT_emit_llvm)) {
|
||||
Diag(clang::diag::err_drv_emit_llvm_link);
|
||||
}
|
||||
|
||||
// Reject -Z* at the top level, these options should never have been exposed
|
||||
// by gcc.
|
||||
if (Arg *A = Args.getLastArg(options::OPT_Z_Joined))
|
||||
|
@ -18,3 +18,5 @@
|
||||
// RUN: %clang %s -flto -S -### 2> %t.log
|
||||
// RUN: grep '"-o" ".*lto\.s" "-x" "c" ".*lto\.c"' %t.log
|
||||
|
||||
// RUN: not %clang %s -emit-llvm 2>&1 | FileCheck --check-prefix=LLVM-LINK %s
|
||||
// LLVM-LINK: -emit-llvm cannot be used when linking
|
||||
|
Loading…
x
Reference in New Issue
Block a user