Skip to content

Commit f607111

Browse files
committedAug 3, 2015
[SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.
Differential Revision: http://reviews.llvm.org/D11581 llvm-svn: 243878
1 parent 17376c4 commit f607111

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed
 

‎clang/lib/Driver/Tools.cpp

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9482,26 +9482,21 @@ void tools::SHAVE::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
94829482
assert(II.getType() == types::TY_C || II.getType() == types::TY_CXX);
94839483
assert(Output.getType() == types::TY_PP_Asm); // Require preprocessed asm.
94849484

9485-
// Append all -I, -iquote, -isystem paths, and defines/undefines.
9486-
// These are spelled the same way in clang and moviCompile.
9487-
Args.AddAllArgs(CmdArgs,
9488-
{options::OPT_clang_i_Group, options::OPT_D, options::OPT_U});
9489-
94909485
CmdArgs.push_back("-DMYRIAD2");
94919486
CmdArgs.push_back("-mcpu=myriad2");
94929487
CmdArgs.push_back("-S");
94939488

9494-
// Any -O option passes through without translation. What about -Ofast ?
9495-
if (Arg *A = Args.getLastArg(options::OPT_O_Group))
9496-
A->render(Args, CmdArgs);
9497-
9498-
if (Args.hasFlag(options::OPT_ffunction_sections,
9499-
options::OPT_fno_function_sections)) {
9500-
CmdArgs.push_back("-ffunction-sections");
9501-
}
9502-
if (Args.hasArg(options::OPT_fno_inline_functions))
9503-
CmdArgs.push_back("-fno-inline-functions");
9504-
9489+
// Append all -I, -iquote, -isystem paths, defines/undefines,
9490+
// 'f' flags, optimize flags, and warning options.
9491+
// These are spelled the same way in clang and moviCompile.
9492+
Args.AddAllArgs(CmdArgs,
9493+
{options::OPT_I_Group, options::OPT_clang_i_Group,
9494+
options::OPT_D, options::OPT_U,
9495+
options::OPT_f_Group,
9496+
options::OPT_f_clang_Group,
9497+
options::OPT_g_Group,
9498+
options::OPT_O_Group,
9499+
options::OPT_W_Group});
95059500
CmdArgs.push_back("-fno-exceptions"); // Always do this even if unspecified.
95069501

95079502
CmdArgs.push_back(II.getFilename());

‎clang/test/Driver/shave-toolchain.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// RUN: %clang -target shave -c -### %s -Icommon 2>&1 \
1212
// RUN: | FileCheck %s -check-prefix=movicompile
13-
// movicompile: moviCompile" "-DMYRIAD2"
13+
// movicompile: moviCompile" "-DMYRIAD2" "-mcpu=myriad2" "-S" "-I" "common"
1414
// movicompile: moviAsm" "-no6thSlotCompression" "-cv:myriad2" "-noSPrefixing" "-a" "-i:common" "-elf"
1515

1616
// RUN: %clang -target shave -c -### %s -DEFINE_ME -UNDEFINE_ME 2>&1 \
@@ -20,3 +20,9 @@
2020
// RUN: %clang -target shave -c -### %s -Icommon -iquote quotepath -isystem syspath 2>&1 \
2121
// RUN: | FileCheck %s -check-prefix=includes
2222
// includes: "-iquote" "quotepath" "-isystem" "syspath"
23+
24+
// RUN: %clang -target shave -c -### %s -g -fno-inline-functions \
25+
// RUN: -fno-inline-functions-called-once -Os -Wall \
26+
// RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=F_G_O_W_OPTIONS
27+
// F_G_O_W_OPTIONS: "-g" "-fno-inline-functions" "-fno-inline-functions-called-once"
28+
// F_G_O_W_OPTIONS: "-Os" "-Wall" "-ffunction-sections"

0 commit comments

Comments
 (0)
Please sign in to comment.