author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 05 Aug 2016 17:12:05 +0100 | |
changeset 72 | 2c876bd46960 |
parent 69 | 98f4cfe5d041 |
permissions | -rw-r--r-- |
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
Copyright (C) 2015-now Jan Vrany |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
This code is not an open-source (yet). You may use this code |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
for your own experiments and projects, given that: |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
* all modification to the code will be sent to the |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
original author for inclusion in future releases |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
* this is not used in any commercial software |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
This license is provisional and may (will) change in |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
12 |
a future. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
"{ Package: 'jv:llvm_s' }" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
"{ NameSpace: Smalltalk }" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
Object subclass:#LLVMConstant |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
instanceVariableNames:'' |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
classVariableNames:'' |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
poolDictionaries:'' |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
category:'LLVM-S-Core' |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
!LLVMConstant class methodsFor:'documentation'! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
copyright |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
Copyright (C) 2015-now Jan Vrany |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
31 |
This code is not an open-source (yet). You may use this code |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
32 |
for your own experiments and projects, given that: |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
33 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
* all modification to the code will be sent to the |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
original author for inclusion in future releases |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
36 |
* this is not used in any commercial software |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
37 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
38 |
This license is provisional and may (will) change in |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
39 |
a future. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
42 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
43 |
documentation |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
44 |
" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
45 |
A simple factory for creating constant values. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
46 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
47 |
LLVMConstant sint16: 10. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
LLVMConstant string: 'Hello World!!'. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
50 |
[author:] |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
51 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
52 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
[instance variables:] |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
[class variables:] |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
[see also:] |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
! ! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
|
50
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
62 |
!LLVMConstant class methodsFor:'assertions'! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
63 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
64 |
assertIsType: type |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
65 |
<resource: #skipInDebuggersWalkBack> |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
66 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
67 |
self assert: type isLLVMType message: 'value is not an LLVMType'. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
68 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
69 |
"Created: / 10-08-2015 / 06:26:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
70 |
"Modified: / 14-09-2015 / 11:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
71 |
"Modified (format): / 17-09-2015 / 16:51:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
72 |
! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
73 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
74 |
assertIsValue: value |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
75 |
<resource: #skipInDebuggersWalkBack> |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
76 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
77 |
self assert: value isLLVMValue message: 'value is not an LLVMValue'. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
78 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
79 |
"Created: / 08-08-2015 / 03:11:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
80 |
"Modified: / 14-09-2015 / 11:09:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
81 |
! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
82 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
83 |
assertIsValue: value ofKind: kind |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
84 |
<resource: #skipInDebuggersWalkBack> |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
85 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
86 |
self assert: value isLLVMValue message: 'value is not an LLVMValue'. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
87 |
self assert: value type kind = kind message: 'value has incorrect kind' |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
88 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
89 |
"Created: / 10-08-2015 / 17:40:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
90 |
"Modified: / 14-09-2015 / 11:09:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
91 |
! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
92 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
93 |
assertIsValue: value ofType: type |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
94 |
<resource: #skipInDebuggersWalkBack> |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
95 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
96 |
self assert: value isLLVMValue message: 'value is not an LLVMValue'. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
97 |
self assert: value type = type message: 'value has incorrect type' |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
98 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
99 |
"Created: / 08-08-2015 / 02:49:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
100 |
"Modified: / 14-09-2015 / 11:09:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
101 |
! ! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
102 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
103 |
!LLVMConstant class methodsFor:'constants - construction'! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
104 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
105 |
bitcast: value to: type |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
106 |
self assertIsValue: value. |
68
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
107 |
self assert: value type isPointerType description: 'Value is not a pointer type. Use #int:toPtr: to conver int to pointer'. |
50
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
108 |
self assertIsType: type. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
109 |
^ LLVM ConstBitCast: value _: type. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
110 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
111 |
"Created: / 12-10-2015 / 16:11:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
68
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
112 |
"Modified: / 20-06-2016 / 20:33:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
113 |
! |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
114 |
|
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
115 |
int: value toPtr: type |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
116 |
self assertIsValue: value. |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
117 |
self assert: value type isIntegerType description: 'Value is not an integer. Use #bitcast:to:'. |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
118 |
self assertIsType: type. |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
119 |
|
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
120 |
^ LLVM ConstIntToPtr: value _: type. |
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
121 |
|
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
122 |
"Created: / 20-06-2016 / 20:32:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
50
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
123 |
! ! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
124 |
|
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
125 |
!LLVMConstant class methodsFor:'constants - int - signed'! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
126 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
127 |
sint16:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
128 |
^ self sint:value type:LLVMType int16 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
129 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
130 |
"Created: / 11-07-2015 / 16:43:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
131 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
132 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
133 |
sint1:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
134 |
^ self sint:value type:LLVMType int1 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
135 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
136 |
"Created: / 11-07-2015 / 16:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
137 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
138 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
139 |
sint32:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
140 |
^ self sint:value type:LLVMType int32 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
141 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
142 |
"Created: / 03-08-2015 / 15:59:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
143 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
144 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
145 |
sint64:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
146 |
^ self sint:value type:LLVMType int64 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
147 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
148 |
"Created: / 03-08-2015 / 15:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
149 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
150 |
|
69
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
151 |
sint8:value |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
152 |
^ self sint:value type:LLVMType int8 |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
153 |
|
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
154 |
"Created: / 26-06-2016 / 06:50:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
155 |
! |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
156 |
|
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
157 |
sint:value type:type |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
158 |
self assert:type isIntegerType. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
159 |
self assert:value isInteger. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
160 |
^ LLVM ConstInt:type _:value _:1 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
161 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
162 |
"Created: / 11-07-2015 / 16:41:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
163 |
"Modified (format): / 03-08-2015 / 17:08:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
164 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
165 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
166 |
sintptr:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
167 |
^ self sint:value type:LLVMType intptr |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
168 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
169 |
"Created: / 03-08-2015 / 15:59:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
170 |
! ! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
171 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
172 |
!LLVMConstant class methodsFor:'constants - int - unsigned'! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
173 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
174 |
uint16:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
175 |
^ self uint:value type:LLVMType int16 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
176 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
177 |
"Created: / 03-08-2015 / 16:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
178 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
179 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
180 |
uint1:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
181 |
^ self uint:value type:LLVMType int1 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
182 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
183 |
"Created: / 03-08-2015 / 16:01:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
184 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
185 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
186 |
uint32:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
187 |
^ self uint:value type:LLVMType int32 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
188 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
189 |
"Created: / 03-08-2015 / 16:01:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
190 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
191 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
192 |
uint64:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
193 |
^ self uint:value type:LLVMType int64 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
194 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
195 |
"Created: / 03-08-2015 / 16:01:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
196 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
197 |
|
69
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
198 |
uint8:value |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
199 |
^ self uint:value type:LLVMType int8 |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
200 |
|
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
201 |
"Created: / 26-06-2016 / 06:50:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
202 |
! |
98f4cfe5d041
Added #sint8: and #unit8: constructors to `LLVMConstant` class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
68
diff
changeset
|
203 |
|
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
204 |
uint:value type:type |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
205 |
self assert:type isIntegerType. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
206 |
self assert:value isInteger. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
207 |
^ LLVM |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
208 |
ConstInt:type |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
209 |
_:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
210 |
_:0 |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
211 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
212 |
"Created: / 11-07-2015 / 16:41:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
213 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
214 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
215 |
uintptr:value |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
216 |
^ self uint:value type:LLVMType intptr |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
217 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
218 |
"Created: / 03-08-2015 / 16:01:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
219 |
! ! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
220 |
|
67
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
221 |
!LLVMConstant class methodsFor:'constants - pointer'! |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
222 |
|
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
223 |
null: type |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
224 |
^ self pointer: 0 type: type |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
225 |
|
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
226 |
"Created: / 19-06-2016 / 18:06:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
227 |
! |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
228 |
|
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
229 |
pointer: value type: type |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
230 |
self assert: value isInteger. |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
231 |
self assert: type isLLVMType. |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
232 |
self assert: type isPointerType. |
68
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
233 |
^ self int: (self uintptr: value) toPtr: type |
67
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
234 |
|
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
235 |
"Created: / 19-06-2016 / 18:06:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
68
a760b8536631
Added LLVMValue>>initilizer: to allow constanv value fixups.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
67
diff
changeset
|
236 |
"Modified: / 20-06-2016 / 20:33:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
237 |
! ! |
996474cb0fe7
New utility methods to create constant pointers
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
55
diff
changeset
|
238 |
|
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
239 |
!LLVMConstant class methodsFor:'constants - strings'! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
240 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
241 |
string:aString |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
242 |
^ self string:aString nullTerminate:true |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
243 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
244 |
"Created: / 03-08-2015 / 16:18:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
245 |
! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
246 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
247 |
string:aString nullTerminate:nullTerminate |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
248 |
self assert:aString isSingleByteString. |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
249 |
^ LLVM |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
250 |
ConstString:aString |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
251 |
_:aString size |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
252 |
_:((nullTerminate == true) ifTrue:[ 1 ] ifFalse:[ 0 ]) |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
253 |
"Created: / 03-08-2015 / 16:17:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
254 |
! ! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
255 |
|
55
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
256 |
!LLVMConstant class methodsFor:'documentation'! |
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
257 |
|
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
258 |
version_HG |
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
259 |
|
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
260 |
^ '$Changeset: <not expanded> $' |
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
261 |
! ! |
41b3437f1fc7
LLVM C API Extensions: Updated Smalltalk API to reflect LLVM 3.9 API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
262 |