[PATCH] D11581: [SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.
Douglas Katzman
dougk at google.com
Mon Aug 3 07:35:09 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL243878: [SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile. (authored by dougk).
Changed prior to commit:
http://reviews.llvm.org/D11581?vs=31029&id=31230#toc
Repository:
rL LLVM
http://reviews.llvm.org/D11581
Files:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/shave-toolchain.c
Index: cfe/trunk/lib/Driver/Tools.cpp
===================================================================
--- cfe/trunk/lib/Driver/Tools.cpp
+++ cfe/trunk/lib/Driver/Tools.cpp
@@ -9482,26 +9482,21 @@
assert(II.getType() == types::TY_C || II.getType() == types::TY_CXX);
assert(Output.getType() == types::TY_PP_Asm); // Require preprocessed asm.
- // Append all -I, -iquote, -isystem paths, and defines/undefines.
- // These are spelled the same way in clang and moviCompile.
- Args.AddAllArgs(CmdArgs,
- {options::OPT_clang_i_Group, options::OPT_D, options::OPT_U});
-
CmdArgs.push_back("-DMYRIAD2");
CmdArgs.push_back("-mcpu=myriad2");
CmdArgs.push_back("-S");
- // Any -O option passes through without translation. What about -Ofast ?
- if (Arg *A = Args.getLastArg(options::OPT_O_Group))
- A->render(Args, CmdArgs);
-
- if (Args.hasFlag(options::OPT_ffunction_sections,
- options::OPT_fno_function_sections)) {
- CmdArgs.push_back("-ffunction-sections");
- }
- if (Args.hasArg(options::OPT_fno_inline_functions))
- CmdArgs.push_back("-fno-inline-functions");
-
+ // Append all -I, -iquote, -isystem paths, defines/undefines,
+ // 'f' flags, optimize flags, and warning options.
+ // These are spelled the same way in clang and moviCompile.
+ Args.AddAllArgs(CmdArgs,
+ {options::OPT_I_Group, options::OPT_clang_i_Group,
+ options::OPT_D, options::OPT_U,
+ options::OPT_f_Group,
+ options::OPT_f_clang_Group,
+ options::OPT_g_Group,
+ options::OPT_O_Group,
+ options::OPT_W_Group});
CmdArgs.push_back("-fno-exceptions"); // Always do this even if unspecified.
CmdArgs.push_back(II.getFilename());
Index: cfe/trunk/test/Driver/shave-toolchain.c
===================================================================
--- cfe/trunk/test/Driver/shave-toolchain.c
+++ cfe/trunk/test/Driver/shave-toolchain.c
@@ -10,7 +10,7 @@
// RUN: %clang -target shave -c -### %s -Icommon 2>&1 \
// RUN: | FileCheck %s -check-prefix=movicompile
-// movicompile: moviCompile" "-DMYRIAD2"
+// movicompile: moviCompile" "-DMYRIAD2" "-mcpu=myriad2" "-S" "-I" "common"
// movicompile: moviAsm" "-no6thSlotCompression" "-cv:myriad2" "-noSPrefixing" "-a" "-i:common" "-elf"
// RUN: %clang -target shave -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
@@ -20,3 +20,9 @@
// RUN: %clang -target shave -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
// RUN: | FileCheck %s -check-prefix=includes
// includes: "-iquote" "quotepath" "-isystem" "syspath"
+
+// RUN: %clang -target shave -c -### %s -g -fno-inline-functions \
+// RUN: -fno-inline-functions-called-once -Os -Wall \
+// RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=F_G_O_W_OPTIONS
+// F_G_O_W_OPTIONS: "-g" "-fno-inline-functions" "-fno-inline-functions-called-once"
+// F_G_O_W_OPTIONS: "-Os" "-Wall" "-ffunction-sections"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11581.31230.patch
Type: text/x-patch
Size: 2999 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150803/b8c4d712/attachment.bin>
More information about the cfe-commits
mailing list