File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
llvm/lib/Target/NVPTX/SYCL Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -342,8 +342,10 @@ class GlobalOffset : public ModulePass {
342
342
continue ;
343
343
344
344
// Get a pointer to the entry point function from the metadata.
345
- auto FuncConstant =
346
- dyn_cast<ConstantAsMetadata>(MetadataNode->getOperand (0 ));
345
+ const auto &FuncOperand = MetadataNode->getOperand (0 );
346
+ if (!FuncOperand)
347
+ continue ;
348
+ auto FuncConstant = dyn_cast<ConstantAsMetadata>(FuncOperand);
347
349
if (!FuncConstant)
348
350
continue ;
349
351
auto Func = dyn_cast<Function>(FuncConstant->getValue ());
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ class LocalAccessorToSharedMemory : public ModulePass {
65
65
66
66
// Get a pointer to the entry point function from the metadata.
67
67
const MDOperand &FuncOperand = MetadataNode->getOperand (0 );
68
+ if (!FuncOperand)
69
+ continue ;
68
70
auto FuncConstant = dyn_cast<ConstantAsMetadata>(FuncOperand);
69
71
if (!FuncConstant)
70
72
continue ;
You can’t perform that action at this time.
0 commit comments