Skip to content

Commit 3f2403b

Browse files
authored
[SYCL][NFC] Remove unnecessary NULL check for 'Fn' (#6726)
Klocwork thinks that it is possible for 'Fn' to be a nullptr due to this check but there's already an assert at the beginning of CodeGenFunction::GenerateCode to avoid that possibility.
1 parent 24937ea commit 3f2403b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
16001600
StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin());
16011601
if (!getLangOpts().OptRecordFile.empty()) {
16021602
SyclOptReportHandler &SyclOptReport = CGM.getDiags().getSYCLOptReport();
1603-
if (Fn && SyclOptReport.HasOptReportInfo(FD)) {
1603+
if (SyclOptReport.HasOptReportInfo(FD)) {
16041604
llvm::OptimizationRemarkEmitter ORE(Fn);
16051605
for (auto ORI : llvm::enumerate(SyclOptReport.GetInfo(FD))) {
16061606
llvm::DiagnosticLocation DL =

0 commit comments

Comments
 (0)