aturetsk created this revision. aturetsk added a reviewer: rsmith. aturetsk added subscribers: cfe-commits, mkuper, DavidKreitzer, anadolskiy, zansari.
Add initial support of -miamcu option which triggers MCU ABI. http://reviews.llvm.org/D14146 Files: include/clang/Driver/Options.td lib/Driver/Tools.cpp test/Driver/iamcu-abi.c Index: test/Driver/iamcu-abi.c =================================================================== --- /dev/null +++ test/Driver/iamcu-abi.c @@ -0,0 +1,5 @@ +// RUN: %clang -target i386-unknown-linux -m32 -miamcu %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck %s + +// CHECK: "-mfloat-abi" "soft" +// CHECK: "-mstack-alignment=4" Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -1907,6 +1907,16 @@ << A->getOption().getName() << Value; } } + + // If -miamcu is set then set flags to support MCU ABI. + if (Args.getLastArg(options::OPT_miamcu)) { + if (getToolChain().getArch() != llvm::Triple::x86) + getToolChain().getDriver().Diag(diag::err_drv_unsupported_opt) + << "-miamcu"; + CmdArgs.push_back("-mfloat-abi"); + CmdArgs.push_back("soft"); + CmdArgs.push_back("-mstack-alignment=4"); + } } void Clang::AddHexagonTargetArgs(const ArgList &Args, Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1223,6 +1223,8 @@ def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[DriverOption, CoreOption]>; def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[DriverOption, CoreOption]>; def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>; +def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[DriverOption, CoreOption]>, + HelpText<"Use Intel MCU ABI.">; def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>; def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>; def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;
Index: test/Driver/iamcu-abi.c =================================================================== --- /dev/null +++ test/Driver/iamcu-abi.c @@ -0,0 +1,5 @@ +// RUN: %clang -target i386-unknown-linux -m32 -miamcu %s -### -o %t.o 2>&1 \ +// RUN: | FileCheck %s + +// CHECK: "-mfloat-abi" "soft" +// CHECK: "-mstack-alignment=4" Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -1907,6 +1907,16 @@ << A->getOption().getName() << Value; } } + + // If -miamcu is set then set flags to support MCU ABI. + if (Args.getLastArg(options::OPT_miamcu)) { + if (getToolChain().getArch() != llvm::Triple::x86) + getToolChain().getDriver().Diag(diag::err_drv_unsupported_opt) + << "-miamcu"; + CmdArgs.push_back("-mfloat-abi"); + CmdArgs.push_back("soft"); + CmdArgs.push_back("-mstack-alignment=4"); + } } void Clang::AddHexagonTargetArgs(const ArgList &Args, Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1223,6 +1223,8 @@ def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[DriverOption, CoreOption]>; def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[DriverOption, CoreOption]>; def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>; +def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[DriverOption, CoreOption]>, + HelpText<"Use Intel MCU ABI.">; def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>; def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>; def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits