diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-04-24 19:32:54 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-04-24 19:32:54 +0000 |
commit | 445e3fbc549257aefa741fec9f008453ae7f8863 (patch) | |
tree | de79f3e31a721ddad81e87c91e4b61fda6cfe828 /llvm/lib/AsmParser/LLParser.cpp | |
parent | 5d41a6992d6cef2f8bfc45847345937bc1d17ad7 (diff) | |
download | bcm5719-llvm-445e3fbc549257aefa741fec9f008453ae7f8863.tar.gz bcm5719-llvm-445e3fbc549257aefa741fec9f008453ae7f8863.zip |
[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').
llvm-svn: 235755
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 64bf7cdc919..441d36cb21d 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -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; |