LLVMModule.st
changeset 43 597181c496f0
parent 38 52be9bfdf7e1
child 65 9244f78bcf02
--- a/LLVMModule.st	Thu Sep 17 17:17:56 2015 +0100
+++ b/LLVMModule.st	Fri Sep 18 06:19:28 2015 +0100
@@ -72,17 +72,12 @@
 !
 
 getFunctionNamed: name 
-    | function |
+    self assertIsString: name. 
 
-    self assertIsString: name.  
-    function := LLVM GetNamedFunction: self  _: name.
-    function notNil ifTrue:[ 
-        "/ TODO: Certainly a hack. must find a better way to do this.
-        function changeClassTo: LLVMFunction.
-    ].
-    ^ function
+    ^ LLVM GetNamedFunction: self  _: name.
 
     "Created: / 02-09-2015 / 22:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 18-09-2015 / 06:15:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 getIntrinsicNamed: name 
@@ -93,18 +88,13 @@
 !
 
 getIntrinsicNamed: name types: types
-    | intrinsic |    
     self assertIsString: name.  
     self assertIsTypeArray: types.
-    intrinsic := LLVMCEXT GetIntrinsicByName: self _: name _: types size _: types asLLVMObjectArray.
-    intrinsic notNil ifTrue:[
-        "/ TODO: Certainly a hack. must find a better way to do this.
-        intrinsic changeClassTo: LLVMFunction.
-    ]. 
-    ^ intrinsic
+
+    ^ LLVMCEXT GetIntrinsicByName: self _: name _: types size _: types asLLVMObjectArray.
 
     "Created: / 10-08-2015 / 17:06:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 03-09-2015 / 06:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 18-09-2015 / 06:15:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !LLVMModule methodsFor:'adding & removing'!
@@ -121,17 +111,13 @@
 !
 
 addFunctionNamed: name type: type
-    | function |
     self assertIsString: name.  
     self assert: type kind == LLVMFunctionTypeKind.
 
-    function := LLVM AddFunction: self _: name _: type.
-    "/ TODO: Certainly a hack. must find a better way to do this.
-    function changeClassTo: LLVMFunction.
-    ^ function
+    ^ LLVM AddFunction: self _: name _: type.
 
     "Created: / 07-07-2015 / 21:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 14-08-2015 / 13:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 18-09-2015 / 06:15:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addGlobalNamed: name type: type value: value