]> granicus.if.org Git - clang/commitdiff
[Myriad] Pass -Xclang and -mllvm flags to moviCompile
authorJames Y Knight <jyknight@google.com>
Wed, 10 May 2017 21:48:13 +0000 (21:48 +0000)
committerJames Y Knight <jyknight@google.com>
Wed, 10 May 2017 21:48:13 +0000 (21:48 +0000)
Patch by Walter Lee.

Differential Revision: https://reviews.llvm.org/D33020

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302738 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Myriad.cpp
test/Driver/myriad-toolchain.c

index 2935755c12be93f221ebf2711b51b3634e8fecef..f70ce93c45ce5a1229b2fdfd6dcb2eef40ddadfc 100644 (file)
@@ -43,15 +43,17 @@ void tools::SHAVE::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
   }
   CmdArgs.push_back("-DMYRIAD2");
 
-  // Append all -I, -iquote, -isystem paths, defines/undefines,
-  // 'f' flags, optimize flags, and warning options.
+  // Append all -I, -iquote, -isystem paths, defines/undefines, 'f'
+  // flags, 'g' flags, 'M' flags, optimize flags, warning options,
+  // mcpu flags, mllvm flags, and Xclang flags.
   // These are spelled the same way in clang and moviCompile.
   Args.AddAllArgsExcept(
       CmdArgs,
       {options::OPT_I_Group, options::OPT_clang_i_Group, options::OPT_std_EQ,
        options::OPT_D, options::OPT_U, options::OPT_f_Group,
        options::OPT_f_clang_Group, options::OPT_g_Group, options::OPT_M_Group,
-       options::OPT_O_Group, options::OPT_W_Group, options::OPT_mcpu_EQ},
+       options::OPT_O_Group, options::OPT_W_Group, options::OPT_mcpu_EQ,
+       options::OPT_mllvm, options::OPT_Xclang},
       {options::OPT_fno_split_dwarf_inlining});
   Args.hasArg(options::OPT_fno_split_dwarf_inlining); // Claim it if present.
 
index 971e5d3e6961db77665f039280cee1cfd428c675..7bd215bf1a485b4759b49cf87b982602b3a59ea6 100644 (file)
 // -fno-split-dwarf-inlining is consumed but not passed to moviCompile.
 // RUN: %clang -target shave-myriad -c -### %s -g -fno-inline-functions \
 // RUN: -fno-inline-functions-called-once -Os -Wall -MF dep.d -fno-split-dwarf-inlining \
-// RUN: -ffunction-sections 2>&1 | FileCheck %s -check-prefix=PASSTHRU_OPTIONS
+// RUN: -ffunction-sections -Xclang -xclangflag -mllvm -llvm-flag 2>&1 \
+// RUN:   | FileCheck %s -check-prefix=PASSTHRU_OPTIONS
 // PASSTHRU_OPTIONS: "-g" "-fno-inline-functions" "-fno-inline-functions-called-once"
 // PASSTHRU_OPTIONS: "-Os" "-Wall" "-MF" "dep.d" "-ffunction-sections"
+// PASSTHRU_OPTIONS: "-Xclang" "-xclangflag" "-mllvm" "-llvm-flag"
 
 // RUN: %clang -target shave-myriad -c %s -o foo.o -### -MD -MF dep.d 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=MDMF