Permalink
Browse files

Added shortcuts to get a Builder.

  • Loading branch information...
1 parent 394fd69 commit 44eb13d0cbcbb3468a020b58552a410cd025b476 Scott Olson committed Aug 13, 2010
Showing with 13 additions and 5 deletions.
  1. +13 −5 llvm/Core.ooc
View
@@ -94,7 +94,7 @@ Type: cover from LLVMTypeRef {
getVectorSize: extern(LLVMGetVectorSize) func -> UInt
// Other types
- void_: extern(LLVMVoidType) static func -> This
+ void_: extern(LLVMVoidType) static func -> This
label: extern(LLVMLabelType) static func -> This
opaque: extern(LLVMOpaqueType) static func -> This
}
@@ -106,11 +106,18 @@ Value: cover from LLVMValueRef {
dump: extern(LLVMDumpValue) func
}
+LLVMGetFirstParam: extern func (Function) -> Value
+LLVMGetNextParam: extern func (Value) -> Value
+
Function: cover from Value {
new: extern(LLVMAddFunction) static func (module: Module, name: String, functionType: Type) -> This
appendBasicBlock: extern(LLVMAppendBasicBlock) func (String) -> BasicBlock
+ builder: func -> Builder {
+ appendBasicBlock("entry") builder()
+ }
+
args: ArrayList<Value> {
get {
argsList := ArrayList<Value> new()
@@ -126,7 +133,11 @@ Function: cover from Value {
}
}
-BasicBlock: cover from LLVMBasicBlockRef
+BasicBlock: cover from LLVMBasicBlockRef {
+ builder: func -> Builder {
+ Builder new(this)
+ }
+}
Builder: cover from LLVMBuilderRef {
new: extern(LLVMCreateBuilder) static func -> This
@@ -254,9 +265,6 @@ ModuleProvider: cover from LLVMModuleProviderRef {
dispose: extern(LLVMDisposeModuleProvider) func
}
-LLVMGetFirstParam: extern func (Function) -> Value
-LLVMGetNextParam: extern func (Value) -> Value
-
// Enums
Attribute: extern(LLVMAttribute) enum {
zext: extern(LLVMZExtAttribute)

0 comments on commit 44eb13d

Please sign in to comment.