[OpaquePtr] Support call instruction

Add support for call of opaque pointer, currently only possible for
indirect calls.

This requires a bit of special casing in LLParser, as calls do not
specify the callee operand type explicitly.

Differential Revision: https://reviews.llvm.org/D104740
This commit is contained in:
Nikita Popov
2021-06-22 22:00:40 +02:00
parent e3d24b45b8
commit f660af46e3
5 changed files with 28 additions and 8 deletions

View File

@@ -5266,7 +5266,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
cast<PointerType>(Callee->getType())->getElementType());
if (!FTy)
return error("Callee is not of pointer to function type");
} else if (cast<PointerType>(Callee->getType())->getElementType() != FTy)
} else if (!OpTy->isOpaqueOrPointeeTypeMatches(FTy))
return error("Explicit call type does not match pointee type of "
"callee operand");
if (Record.size() < FTy->getNumParams() + OpNum)