aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/DiagnosticDriverKinds.td2
-rw-r--r--include/clang/Driver/Options.td5
-rw-r--r--lib/Driver/Tools.cpp14
3 files changed, 19 insertions, 2 deletions
diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td
index dd11b70014..52b69bab76 100644
--- a/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/include/clang/Basic/DiagnosticDriverKinds.td
@@ -53,6 +53,8 @@ def err_drv_no_ast_support : Error<
"'%0': unable to use AST files with this tool">;
def err_drv_clang_unsupported : Error<
"the clang compiler does not support '%0'">;
+def err_drv_clang_unsupported_per_platform : Error<
+ "the clang compiler does not support '%0' on this platform">;
def err_drv_clang_unsupported_opt_cxx_darwin_i386 : Error<
"the clang compiler does not support '%0' for C++ on Darwin/i386">;
def err_drv_command_failed : Error<
diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index fea77725a6..b029b6e257 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -237,7 +237,10 @@ def faccess_control : Flag<"-faccess-control">, Group<f_Group>;
def fallow_unsupported : Flag<"-fallow-unsupported">, Group<f_Group>;
def fapple_kext : Flag<"-fapple-kext">, Group<f_Group>;
def fasm : Flag<"-fasm">, Group<f_Group>;
-def fasm_blocks : Flag<"-fasm-blocks">, Group<clang_ignored_f_Group>;
+
+def fasm_blocks : Flag<"-fasm-blocks">, Group<f_Group>;
+def fno_asm_blocks : Flag<"-fno-asm-blocks">, Group<f_Group>;
+
def fassume_sane_operator_new : Flag<"-fassume-sane-operator-new">, Group<f_Group>;
def fastcp : Flag<"-fastcp">, Group<f_Group>;
def fastf : Flag<"-fastf">, Group<f_Group>;
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 6e221b4c83..7924a034df 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1469,6 +1469,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_spell_checking))
CmdArgs.push_back("-fno-spell-checking");
+
+ // -fasm-blocks is disallowed except on X86, where we just ignore it.
+ if (Args.hasFlag(options::OPT_fasm_blocks, options::OPT_fno_asm_blocks,
+ false)) {
+ if (getToolChain().getTriple().getArch() != llvm::Triple::x86 &&
+ getToolChain().getTriple().getArch() != llvm::Triple::x86_64)
+ D.Diag(clang::diag::err_drv_clang_unsupported_per_platform)
+ << "-fasm-blocks";
+ }
+
+ // -fasm-blocks is disallowed except on X86, where we just ignore it.
+
if (Arg *A = Args.getLastArg(options::OPT_fshow_overloads_EQ))
A->render(Args, CmdArgs);
@@ -1577,7 +1589,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(*it)->claim();
D.Diag(clang::diag::warn_drv_clang_unsupported) << (*it)->getAsString(Args);
}
-
+
// Claim some arguments which clang supports automatically.
// -fpch-preprocess is used with gcc to add a special marker in the output to