@@ -271,19 +271,20 @@ void SYCL::fpga::BackendCompiler::ConstructJob(Compilation &C,
271
271
} else {
272
272
// Output directory is based off of the first object name
273
273
for (Arg * Cur : Args) {
274
- SmallString<128 > AN = Cur->getSpelling ();
275
- StringRef Ext (llvm::sys::path::extension (AN));
276
- if (!Ext.empty ()) {
277
- types::ID Ty = getToolChain ().LookupTypeForExtension (Ext.drop_front ());
278
- if (Ty == types::TY_INVALID)
279
- continue ;
280
- if (types::isSrcFile (Ty) || Ty == types::TY_Object) {
281
- // Output is based on the filename only so strip off any directory
282
- // information if provided with the source/object file.
283
- AN = llvm::sys::path::filename (AN);
284
- if (!AN.empty ()) {
285
- llvm::sys::path::replace_extension (AN, " prj" );
286
- ReportOptArg += Args.MakeArgString (AN);
274
+ if (Cur->getOption ().getKind () == Option::InputClass) {
275
+ SmallString<128 > ArgName = Cur->getSpelling ();
276
+ StringRef Ext (llvm::sys::path::extension (ArgName));
277
+ if (!Ext.empty ()) {
278
+ types::ID Ty =
279
+ getToolChain ().LookupTypeForExtension (Ext.drop_front ());
280
+ if (Ty == types::TY_INVALID)
281
+ continue ;
282
+ if (types::isSrcFile (Ty) || Ty == types::TY_Object) {
283
+ // Project report should be saved into CWD, so strip off any
284
+ // directory information if provided with the input file.
285
+ ArgName = llvm::sys::path::filename (ArgName);
286
+ llvm::sys::path::replace_extension (ArgName, " prj" );
287
+ ReportOptArg += Args.MakeArgString (ArgName);
287
288
break ;
288
289
}
289
290
}
0 commit comments