Class MethodType

Inheritance Relationships

Base Type

Class Documentation

class seq::types::MethodType : public seq::types::RecordType

Public Functions

MethodType(MethodType const&) = delete
void operator=(MethodType const&) = delete
llvm::Value *call(BaseFunc *base, llvm::Value *self, const std::vector<llvm::Value*> &args, llvm::BasicBlock *block, llvm::BasicBlock *normal, llvm::BasicBlock *unwind) override

Calls this type. Usually a call to this method should be preceded by a call to getCallType() to validate types and determine the output type.


value resulting from call

  • base: the function containing block

  • self: a value of this type

  • args: vector of argument values

  • block: where to codegen this call in

  • normal: if in a try, block to branch to if call succeeds, or null otherwise

  • unwind: if in a try, block to branch to if call raises an exception, or null otherwise

bool is(types::Type *type) const override

Checks whether this type “is” another type.

unsigned numBaseTypes() const override

Returns the number of “base types” of this type. E.g., int.numBaseTypes() would return 0, whereas array[str].numBaseTypes() would return 1, and (int,float,str).numBaseTypes() would return 3.

Type *getBaseType(unsigned idx) const override

Obtain the base type at index idx. idx should be less than numBaseTypes().

Type *getCallType(const std::vector<Type*> &inTypes) override

Returns the result of calling this type with the given argument types.

llvm::Value *make(llvm::Value *self, llvm::Value *func, llvm::BasicBlock *block)
MethodType *clone(Generic *ref) override

Clones this type and all of its methods. ref is used internally to keep track of cloned objects, and to make sure we don’t clone certain objects twice.


cloned type

  • ref: generic object that is being cloned

Public Static Functions

MethodType *get(Type *self, FuncType *func)