@@ -1788,20 +1788,21 @@ llvm::Triple Driver::MakeSYCLDeviceTriple(StringRef TargetArch) const {
1788
1788
// Print the help from any of the given tools which are used for AOT
1789
1789
// compilation for SYCL
1790
1790
void Driver::PrintSYCLToolHelp (const Compilation &C) const {
1791
- SmallVector<std::tuple<llvm::Triple, StringRef, StringRef>, 4 > HelpArgs;
1791
+ SmallVector<std::tuple<llvm::Triple, StringRef, StringRef, StringRef>, 4 >
1792
+ HelpArgs;
1792
1793
// Populate the vector with the tools and help options
1793
1794
if (Arg *A = C.getArgs ().getLastArg (options::OPT_fsycl_help_EQ)) {
1794
1795
StringRef AV (A->getValue ());
1795
1796
llvm::Triple T;
1796
1797
if (AV == " gen" || AV == " all" )
1797
1798
HelpArgs.push_back (std::make_tuple (MakeSYCLDeviceTriple (" spir64_gen" ),
1798
- " ocloc" , " --help" ));
1799
+ " ocloc" , " --help" , " " ));
1799
1800
if (AV == " fpga" || AV == " all" )
1800
- HelpArgs.push_back (
1801
- std::make_tuple ( MakeSYCLDeviceTriple ( " spir64_fpga " ) , " aoc " , " -help " ));
1801
+ HelpArgs.push_back (std::make_tuple ( MakeSYCLDeviceTriple ( " spir64_fpga " ),
1802
+ " aoc " , " -help " , " -sycl " ));
1802
1803
if (AV == " x86_64" || AV == " all" )
1803
1804
HelpArgs.push_back (std::make_tuple (MakeSYCLDeviceTriple (" spir64_x86_64" ),
1804
- " opencl-aot" , " --help" ));
1805
+ " opencl-aot" , " --help" , " " ));
1805
1806
if (HelpArgs.empty ()) {
1806
1807
C.getDriver ().Diag (diag::err_drv_unsupported_option_argument)
1807
1808
<< A->getOption ().getName () << AV;
@@ -1814,7 +1815,8 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
1814
1815
llvm::outs () << " Emitting help information for " << std::get<1 >(HA) << ' \n '
1815
1816
<< " Use triple of '" << std::get<0 >(HA).normalize () <<
1816
1817
" ' to enable ahead of time compilation\n " ;
1817
- std::vector<StringRef> ToolArgs = { std::get<1 >(HA), std::get<2 >(HA) };
1818
+ std::vector<StringRef> ToolArgs = {std::get<1 >(HA), std::get<2 >(HA),
1819
+ std::get<3 >(HA)};
1818
1820
SmallString<128 > ExecPath (
1819
1821
C.getDefaultToolChain ().GetProgramPath (std::get<1 >(HA).data ()));
1820
1822
auto ToolBinary = llvm::sys::findProgramByName (ExecPath);
@@ -1824,7 +1826,10 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
1824
1826
}
1825
1827
// do not run the tools with -###.
1826
1828
if (C.getArgs ().hasArg (options::OPT__HASH_HASH_HASH)) {
1827
- llvm::errs () << " \" " << ExecPath << " \" \" " << ToolArgs[1 ] << " \"\n " ;
1829
+ llvm::errs () << " \" " << ExecPath << " \" \" " << ToolArgs[1 ] << " \" " ;
1830
+ if (!ToolArgs[2 ].empty ())
1831
+ llvm::errs () << " \" " << ToolArgs[2 ] << " \" " ;
1832
+ llvm::errs () << " \n " ;
1828
1833
continue ;
1829
1834
}
1830
1835
// Run the Tool.
0 commit comments