mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
[opaque pointer type] Serialize the type of an llvm::Function as a function type rather than a function pointer type
llvm-svn: 235200
This commit is contained in:
parent
ddc4c0a63d
commit
03f76e09ca
@ -2935,10 +2935,9 @@ std::error_code BitcodeReader::ParseModule(bool Resume,
|
||||
Type *Ty = getTypeByID(Record[0]);
|
||||
if (!Ty)
|
||||
return Error("Invalid record");
|
||||
if (!Ty->isPointerTy())
|
||||
return Error("Invalid type for value");
|
||||
FunctionType *FTy =
|
||||
dyn_cast<FunctionType>(cast<PointerType>(Ty)->getElementType());
|
||||
if (auto *PTy = dyn_cast<PointerType>(Ty))
|
||||
Ty = PTy->getElementType();
|
||||
auto *FTy = dyn_cast<FunctionType>(Ty);
|
||||
if (!FTy)
|
||||
return Error("Invalid type for value");
|
||||
|
||||
|
@ -690,7 +690,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
|
||||
// FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment,
|
||||
// section, visibility, gc, unnamed_addr, prologuedata,
|
||||
// dllstorageclass, comdat, prefixdata]
|
||||
Vals.push_back(VE.getTypeID(F.getType()));
|
||||
Vals.push_back(VE.getTypeID(F.getFunctionType()));
|
||||
Vals.push_back(F.getCallingConv());
|
||||
Vals.push_back(F.isDeclaration());
|
||||
Vals.push_back(getEncodedLinkage(F));
|
||||
|
Loading…
Reference in New Issue
Block a user