mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
[opaque pointer type] Add textual IR support for explicit type parameter to the invoke instruction
Same as r235145 for the call instruction - the justification, tradeoffs, etc are all the same. The conversion script worked the same without any false negatives (after replacing 'call' with 'invoke'). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235755 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -4741,10 +4741,8 @@ bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
// If RetType is a non-function pointer type, then this is the short syntax
|
||||
// for the call, which means that RetType is just the return type. Infer the
|
||||
// rest of the function argument types from the arguments that are present.
|
||||
PointerType *PFTy = nullptr;
|
||||
FunctionType *Ty = nullptr;
|
||||
if (!(PFTy = dyn_cast<PointerType>(RetType)) ||
|
||||
!(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
|
||||
FunctionType *Ty = dyn_cast<FunctionType>(RetType);
|
||||
if (!Ty) {
|
||||
// Pull out the types of all of the arguments...
|
||||
std::vector<Type*> ParamTypes;
|
||||
for (unsigned i = 0, e = ArgList.size(); i != e; ++i)
|
||||
@@ -4754,12 +4752,12 @@ bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
return Error(RetTypeLoc, "Invalid result type for LLVM function");
|
||||
|
||||
Ty = FunctionType::get(RetType, ParamTypes, false);
|
||||
PFTy = PointerType::getUnqual(Ty);
|
||||
}
|
||||
|
||||
// Look up the callee.
|
||||
Value *Callee;
|
||||
if (ConvertValIDToValue(PFTy, CalleeID, Callee, &PFS)) return true;
|
||||
if (ConvertValIDToValue(PointerType::getUnqual(Ty), CalleeID, Callee, &PFS))
|
||||
return true;
|
||||
|
||||
// Set up the Attribute for the function.
|
||||
SmallVector<AttributeSet, 8> Attrs;
|
||||
|
||||
Reference in New Issue
Block a user