Permalink
Browse files

Changed the argument order of addFunction and added a new overload.

  • Loading branch information...
1 parent 44eb13d commit 28c1a12e70510f93a7d54b4974598d433f6bdee1 Scott Olson committed Aug 13, 2010
Showing with 15 additions and 1 deletion.
  1. +15 −1 llvm/Core.ooc
View
@@ -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

0 comments on commit 28c1a12

Please sign in to comment.