Skip to content

Commit 18ac172

Browse files
authored
[Driver][SYCL] Keep the option value of -o option as the output directory name (#3912)
When enabling FPGA AOT, the name of the output project report is not correct when using -o. Only when user does not use "-o" option, the output directory name is from the source file and the original extension is replaced with ".prj". However, if user uses "-o" option, the output directory name should be the value of the option with extension ".prj". Signed-off-by: Qichao Gu <[email protected]>
1 parent 0548ed5 commit 18ac172

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ void SYCL::fpga::BackendCompiler::ConstructJob(
494494
if (Arg *FinalOutput = Args.getLastArg(options::OPT_o, options::OPT__SLASH_o,
495495
options::OPT__SLASH_Fe)) {
496496
SmallString<128> FN(FinalOutput->getValue());
497-
llvm::sys::path::replace_extension(FN, "prj");
497+
FN.append(".prj");
498498
const char *FolderName = Args.MakeArgString(FN);
499499
ReportOptArg += FolderName;
500500
} else {

clang/test/Driver/sycl-offload-intelfpga.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
// RUN: | FileCheck -DOUTDIR=%t_dir -check-prefix=CHK-FPGA-REPORT-OPT %s
367367
// RUN: %clang_cl -### -fsycl -fintelfpga -Xshardware %s -Fe%t_dir/file.out 2>&1 \
368368
// RUN: | FileCheck -DOUTDIR=%t_dir -check-prefix=CHK-FPGA-REPORT-OPT %s
369-
// CHK-FPGA-REPORT-OPT: aoc{{.*}} "-sycl" {{.*}} "-output-report-folder={{.*}}{{(/|\\\\)}}file.prj"
369+
// CHK-FPGA-REPORT-OPT: aoc{{.*}} "-sycl" {{.*}} "-output-report-folder={{.*}}{{(/|\\\\)}}file.out.prj"
370370

371371
/// -fintelfpga output report file from dir/source
372372
/// check dependency file from dir/source

0 commit comments

Comments
 (0)