Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Changed the argument order of addFunction and added a new overload.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Olson committed Aug 13, 2010
1 parent 44eb13d commit 28c1a12
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion llvm/Core.ooc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,23 @@ Module: cover from LLVMModuleRef {

dump: extern(LLVMDumpModule) func

addFunction: func (functionType: Type, name: String) -> Function {
addFunction: func (name: String, functionType: Type) -> Function {
Function new(this, name, functionType)
}

addFunction: func ~withRetAndArgs (name: String, ret: Type, arguments: ArrayList<Type>) -> Function {
Function new(this, name, Type function(ret, arguments))
}

addFunction: func ~withRetAndArgsWithName (name: String, ret: Type,
arguments: ArrayList<Type>, argNames: ArrayList<String>) -> Function {
fn := Function new(this, name, Type function(ret, arguments))
fnArgs := fn args
for(i in 0..argNames size()) {
fnArgs[i] setName(argNames[i])
}
fn
}
}

// Types
Expand Down

0 comments on commit 28c1a12

Please sign in to comment.