mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-30 20:21:46 +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:
1 parent
c9c3d228d6
commit
561a157233
2 files changed
+4
-5
No files matched your search
@@ -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");
|
||||
|
||||
|
||||
Reference in new issue
Block a user