[PPCGCodeGeneration] Look for function instead of function pointer type
What this code is actually interested in are references to functions. Use of a function pointer type is being used as an imprecise proxy for that.
This commit is contained in:
parent
880014b593
commit
dbe6d85b8b
|
@ -3443,13 +3443,11 @@ public:
|
|||
continue;
|
||||
|
||||
for (Value *Op : Inst.operands())
|
||||
// Look for (<func-type>*) among operands of Inst
|
||||
if (auto PtrTy = dyn_cast<PointerType>(Op->getType())) {
|
||||
if (isa<FunctionType>(PtrTy->getPointerElementType())) {
|
||||
LLVM_DEBUG(dbgs()
|
||||
<< Inst << " has illegal use of function in kernel.\n");
|
||||
return true;
|
||||
}
|
||||
// Look for functions among operands of Inst.
|
||||
if (isa<Function>(Op->stripPointerCasts())) {
|
||||
LLVM_DEBUG(dbgs()
|
||||
<< Inst << " has illegal use of function in kernel.\n");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue