LLVMModule.st
changeset 24 7e7ddd55174c
parent 21 64c5f01be2b3
child 33 feabf14b6c1d
--- a/LLVMModule.st	Mon Aug 10 10:33:42 2015 +0100
+++ b/LLVMModule.st	Mon Aug 10 19:26:29 2015 +0100
@@ -59,25 +59,26 @@
 !LLVMModule methodsFor:'adding & removing'!
 
 addFunctionNamed: name type: type
-    self assert: name isSingleByteString.
+    self assertIsString: name.  
     self assert: type kind == LLVMFunctionTypeKind.
     ^ LLVM AddFunction: self _: name _: type.
 
     "Created: / 07-07-2015 / 21:59:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-08-2015 / 17:07:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addGlobalNamed: name type: type value: value
     | global |
-    self assert: name isSingleByteString.
-    self assert:(type isKindOf: LLVMType).
-    self assert:(value isKindOf: LLVMValue).
-    self assert:(value type kind == type kind).
+    self assertIsString: name.  
+    self assertIsType: type.  
+    self assertIsValue: value ofType: type.
 
     global := LLVM AddGlobal: self _: type _: name.
     LLVM SetInitializer: global _: value.
     ^ global
 
     "Created: / 03-08-2015 / 16:41:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-08-2015 / 17:07:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addGlobalNamed: name value: value
@@ -101,6 +102,14 @@
     ^ LLVM AddMethod: self _: name _: type.
 
     "Created: / 11-07-2015 / 09:37:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+getIntrinsicNamed: name types: types
+    self assertIsString: name.  
+    self assertIsTypeArray: types.
+    ^ LLVMCEXT GetIntrinsicByName: self _: name _: types size _: types asLLVMObjectArray.
+
+    "Created: / 10-08-2015 / 17:06:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !LLVMModule methodsFor:'debugging'!
@@ -151,11 +160,12 @@
 
     ^ (self newInspector2Tab)
         label:'Assembly';
-        priority:50;
+        priority:49;
         text: [ String streamContents:[:s | self writeAssemblyOn: s] ];
         yourself
 
     "Created: / 05-08-2015 / 23:47:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 10-08-2015 / 17:49:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 inspector2TabIR