mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-27 14:24:40 +00:00
tighten up return type check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -161,12 +161,10 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
|
|||||||
const std::string &name, Module *ParentModule)
|
const std::string &name, Module *ParentModule)
|
||||||
: GlobalValue(PointerType::getUnqual(Ty),
|
: GlobalValue(PointerType::getUnqual(Ty),
|
||||||
Value::FunctionVal, 0, 0, Linkage, name) {
|
Value::FunctionVal, 0, 0, Linkage, name) {
|
||||||
|
assert(FunctionType::isValidReturnType(getReturnType()) &&
|
||||||
|
!isa<OpaqueType>(getReturnType()) && "invalid return type");
|
||||||
SymTab = new ValueSymbolTable();
|
SymTab = new ValueSymbolTable();
|
||||||
|
|
||||||
assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy
|
|
||||||
|| isa<StructType>(getReturnType()))
|
|
||||||
&& "LLVM functions cannot return aggregate values!");
|
|
||||||
|
|
||||||
// If the function has arguments, mark them as lazily built.
|
// If the function has arguments, mark them as lazily built.
|
||||||
if (Ty->getNumParams())
|
if (Ty->getNumParams())
|
||||||
SubclassData = 1; // Set the "has lazy arguments" bit.
|
SubclassData = 1; // Set the "has lazy arguments" bit.
|
||||||
|
Reference in New Issue
Block a user