author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 21 Apr 2016 08:42:39 +0100 | |
changeset 59 | e6ff053f430c |
parent 53 | bbf3a88e2358 |
child 71 | ab03b0a6d037 |
permissions | -rw-r--r-- |
14
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
1 |
" |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
2 |
Copyright (C) 2015-now Jan Vrany |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
3 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
4 |
This code is not an open-source (yet). You may use this code |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
5 |
for your own experiments and projects, given that: |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
6 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
7 |
* all modification to the code will be sent to the |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
8 |
original author for inclusion in future releases |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
9 |
* this is not used in any commercial software |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
10 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
11 |
This license is provisional and may (will) change in |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
12 |
a future. |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
13 |
" |
12
f98e97fd02ef
Package renamed from jv:libllvms to jv:llvm_s
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5
diff
changeset
|
14 |
"{ Package: 'jv:llvm_s' }" |
0 | 15 |
|
16 |
"{ NameSpace: Smalltalk }" |
|
17 |
||
1
e3dcb6272f0b
Introduced abstract superclasses LLVMObject and LLVMDisposableObject
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
18 |
LLVMObject subclass:#LLVMType |
0 | 19 |
instanceVariableNames:'' |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
20 |
classVariableNames:'Int1 Int8 Int16 Int32 Int64 IntPtr Void Half Float Double X86FP80 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
21 |
FP128 PPCFP128 X86MMX KindToClassMapping' |
4 | 22 |
poolDictionaries:'LLVMTypeKind' |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
23 |
category:'LLVM-S-Core-Types' |
0 | 24 |
! |
25 |
||
14
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
26 |
!LLVMType class methodsFor:'documentation'! |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
27 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
28 |
copyright |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
29 |
" |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
30 |
Copyright (C) 2015-now Jan Vrany |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
31 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
32 |
This code is not an open-source (yet). You may use this code |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
33 |
for your own experiments and projects, given that: |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
34 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
35 |
* all modification to the code will be sent to the |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
36 |
original author for inclusion in future releases |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
37 |
* this is not used in any commercial software |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
38 |
|
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
39 |
This license is provisional and may (will) change in |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
40 |
a future. |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
41 |
" |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
42 |
! ! |
c7dea3fcc5a7
Added short README, license.txt and updated copyright information
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13
diff
changeset
|
43 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
44 |
!LLVMType class methodsFor:'initialization'! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
45 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
46 |
initialize |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
47 |
"Invoked at system start or when the class is dynamically loaded." |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
48 |
|
28
97013ae2abae
Renamed LLVMBuilder to LLVMIRBuilder
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
27
diff
changeset
|
49 |
LLVMTypeKind initialize. |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
50 |
KindToClassMapping := Dictionary withKeysAndValues: { |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
51 |
LLVMHalfTypeKind . LLVMTypeHalt . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
52 |
LLVMFloatTypeKind . LLVMTypeFloat . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
53 |
LLVMDoubleTypeKind . LLVMTypeDouble . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
54 |
LLVMX86_FP80TypeKind . LLVMTypeX86_FP80 . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
55 |
LLVMFP128TypeKind . LLVMTypeFP128. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
56 |
LLVMPPC_FP128TypeKind . LLVMTypePPC_FP128 . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
57 |
LLVMIntegerTypeKind . LLVMTypeInteger . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
58 |
LLVMVectorTypeKind . LLVMTypeVector . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
59 |
LLVMArrayTypeKind . LLVMTypeArray . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
60 |
LLVMStructTypeKind . LLVMTypeStruct . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
61 |
LLVMPointerTypeKind . LLVMTypePointer . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
62 |
LLVMFunctionTypeKind . LLVMTypeFunction . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
63 |
LLVMMetadataTypeKind . LLVMTypeMetadata . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
64 |
LLVMVoidTypeKind . LLVMTypeVoid . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
65 |
LLVMLabelTypeKind . LLVMTypeLabel . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
66 |
LLVMX86_MMXTypeKind . LLVMTypeX86_MMX . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
67 |
} |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
68 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
69 |
"Modified: / 13-08-2015 / 17:00:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
70 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
71 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
72 |
!LLVMType class methodsFor:'instance creation'! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
73 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
74 |
newAddress:addr |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
75 |
^ (super newAddress: addr) |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
76 |
initialize; |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
77 |
yourself |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
78 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
79 |
"Created: / 13-08-2015 / 17:14:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
80 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
81 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
82 |
!LLVMType class methodsFor:'queries'! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
83 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
84 |
isAbstract |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
85 |
"Return if this class is an abstract class. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
86 |
True is returned here for myself only; false for subclasses. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
87 |
Abstract subclasses must redefine again." |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
88 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
89 |
^ self == LLVMType. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
90 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
91 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
92 |
!LLVMType class methodsFor:'types - C'! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
93 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
94 |
char |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
95 |
^ self int8 |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
96 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
97 |
"Created: / 04-08-2015 / 19:32:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
98 |
! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
99 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
100 |
void |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
101 |
Void isNil ifTrue:[ Void := LLVM VoidType ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
102 |
^ Void |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
103 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
104 |
"Created: / 13-08-2015 / 17:20:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
105 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
106 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
107 |
wchar |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
108 |
^ self int16 |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
109 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
110 |
"Created: / 04-08-2015 / 19:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
111 |
! ! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
112 |
|
59
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
113 |
!LLVMType class methodsFor:'types - arrays / vectors'! |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
114 |
|
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
115 |
arrayOf: elementType size: elementCount |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
116 |
self assert: elementType isLLVMType. |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
117 |
self assert: elementCount isInteger. |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
118 |
self assert: elementCount >= 0. |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
119 |
|
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
120 |
^ LLVM ArrayType: elementType _: elementCount |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
121 |
|
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
122 |
"Created: / 21-04-2016 / 08:36:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
123 |
! |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
124 |
|
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
125 |
vectorOf: elementType size: elementCount |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
126 |
self assert: elementType isLLVMType. |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
127 |
self assert: elementCount isInteger. |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
128 |
self assert: elementCount >= 0. |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
129 |
|
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
130 |
^ LLVM ArrayType: elementType _: elementCount |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
131 |
|
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
132 |
"Created: / 21-04-2016 / 08:38:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
133 |
! ! |
e6ff053f430c
Added support for array and vector types.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
53
diff
changeset
|
134 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
135 |
!LLVMType class methodsFor:'types - floating points'! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
136 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
137 |
double |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
138 |
Double isNil ifTrue:[ Double := LLVM DoubleType ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
139 |
^ Double |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
140 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
141 |
"Created: / 13-08-2015 / 17:24:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
142 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
143 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
144 |
float |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
145 |
Float isNil ifTrue:[ Float := LLVM FloatType ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
146 |
^ Float |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
147 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
148 |
"Created: / 13-08-2015 / 17:24:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
149 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
150 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
151 |
fp128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
152 |
FP128 isNil ifTrue:[ FP128 := LLVM FP128Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
153 |
^ FP128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
154 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
155 |
"Created: / 13-08-2015 / 17:26:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
156 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
157 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
158 |
half |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
159 |
Half isNil ifTrue:[ Half := LLVM HalfType ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
160 |
^ Half |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
161 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
162 |
"Created: / 13-08-2015 / 17:24:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
163 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
164 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
165 |
ppcfp128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
166 |
PPCFP128 isNil ifTrue:[ PPCFP128 := LLVM PPCFP128Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
167 |
^ PPCFP128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
168 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
169 |
"Created: / 13-08-2015 / 17:26:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
170 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
171 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
172 |
x86fp80 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
173 |
X86FP80 isNil ifTrue:[ X86FP80 := LLVM X86FP80Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
174 |
^ X86FP80 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
175 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
176 |
"Created: / 13-08-2015 / 17:25:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
177 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
178 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
179 |
x86mmx |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
180 |
X86MMX isNil ifTrue:[ X86MMX := LLVM X86MMXType ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
181 |
^ X86MMX |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
182 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
183 |
"Created: / 13-08-2015 / 17:26:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
184 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
185 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
186 |
!LLVMType class methodsFor:'types - functions'! |
0 | 187 |
|
188 |
function: argumentTypes returning: returnType |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
189 |
^ self function: argumentTypes varargs: false returning: returnType |
0 | 190 |
|
191 |
"Created: / 07-07-2015 / 21:53:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
192 |
"Modified: / 04-08-2015 / 19:44:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 193 |
! |
194 |
||
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
195 |
function: argumentTypes varargs: varargs returning: returnType |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
196 |
^ LLVM FunctionType: returnType _: argumentTypes asLLVMObjectArray _: argumentTypes size _: varargs |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
197 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
198 |
"Created: / 04-08-2015 / 19:27:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
199 |
! ! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
200 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
201 |
!LLVMType class methodsFor:'types - integers'! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
202 |
|
0 | 203 |
int1 |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
204 |
Int1 isNil ifTrue:[ Int1 := LLVM Int1Type ]. |
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
205 |
^ Int1 |
0 | 206 |
|
207 |
"Created: / 07-07-2015 / 21:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
208 |
"Modified: / 08-08-2015 / 04:23:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
209 |
"Modified (format): / 13-08-2015 / 17:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 210 |
! |
211 |
||
212 |
int16 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
213 |
Int16 isNil ifTrue:[ Int16 := LLVM Int16Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
214 |
^ Int16 |
0 | 215 |
|
216 |
"Created: / 07-07-2015 / 21:21:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
217 |
"Modified: / 13-08-2015 / 18:48:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 218 |
! |
219 |
||
220 |
int32 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
221 |
Int32 isNil ifTrue:[ Int32 := LLVM Int32Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
222 |
^ Int32 |
0 | 223 |
|
224 |
"Created: / 07-07-2015 / 21:21:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
225 |
"Modified: / 13-08-2015 / 17:22:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 226 |
! |
227 |
||
228 |
int64 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
229 |
Int64 isNil ifTrue:[ Int64 := LLVM Int64Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
230 |
^ Int64 |
0 | 231 |
|
232 |
"Created: / 07-07-2015 / 21:21:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
233 |
"Modified: / 13-08-2015 / 17:22:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 234 |
! |
235 |
||
236 |
int8 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
237 |
Int8 isNil ifTrue:[ Int8 := LLVM Int8Type ]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
238 |
^ Int8 |
0 | 239 |
|
240 |
"Created: / 07-07-2015 / 21:21:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
241 |
"Modified: / 13-08-2015 / 18:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4 | 242 |
! |
243 |
||
244 |
intptr |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
245 |
IntPtr isNil ifTrue:[ IntPtr := LLVM IntPtrType: LLVMTargetData new ]. |
4 | 246 |
^ IntPtr |
247 |
||
248 |
"Created: / 11-07-2015 / 07:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
249 |
"Modified (format): / 13-08-2015 / 17:22:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
250 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
251 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
252 |
!LLVMType class methodsFor:'types - structures'! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
253 |
|
50
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
254 |
named: aString |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
255 |
"Create an (opaque) named structure with no members (elements). |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
256 |
Use LLVMStructType>>elementTypes: to set members. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
257 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
258 |
This method comes handy when one needs to create |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
259 |
a recursive type, such as an element of linked list: |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
260 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
261 |
| listElemTy | |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
262 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
263 |
listElemTy := LLVMType named: 'listElemTy'. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
264 |
listElemTy elementTypes: { LLVMType int32 . listElemTy pointer }. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
265 |
listElemTy |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
266 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
267 |
" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
268 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
269 |
self assertIsString: aString. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
270 |
^ LLVM StructCreateNamed: LLVM GetGlobalContext _: aString. |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
271 |
|
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
272 |
"Created: / 12-10-2015 / 14:55:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
273 |
! |
dbda820d4d24
Support for creating recursive structures.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
49
diff
changeset
|
274 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
275 |
struct: memberTypes |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
276 |
^ self struct: memberTypes packed: false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
277 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
278 |
"Created: / 13-08-2015 / 19:15:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
279 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
280 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
281 |
struct: memberTypes packed: packed |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
282 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
283 |
self assert: memberTypes isSequenceable message: '`memberTypes` parameter is not an array of types'. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
284 |
self assert: (memberTypes allSatisfy:[:e|e isLLVMType]) message: 'element of a `memberTypes` parameter is not an LLVM type'. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
285 |
self assert: packed isBoolean message: '`packed` parameter is not a boolean'. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
286 |
|
49
aa3ce5de5ee8
Oops, re-added LLVMType>>struct:packed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
43
diff
changeset
|
287 |
^ LLVM StructType: memberTypes asLLVMObjectArray _: memberTypes size _: packed |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
288 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
289 |
"Created: / 13-08-2015 / 19:15:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
49
aa3ce5de5ee8
Oops, re-added LLVMType>>struct:packed:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
43
diff
changeset
|
290 |
"Modified: / 05-10-2015 / 13:57:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 291 |
! ! |
292 |
||
293 |
!LLVMType methodsFor:'accessing'! |
|
294 |
||
33
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
295 |
alignmentInBits |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
296 |
"Return an alignment of the type in bits" |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
297 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
298 |
^ self alignmentInBytes * 8 |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
299 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
300 |
"Created: / 14-08-2015 / 09:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
301 |
! |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
302 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
303 |
alignmentInBytes |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
304 |
"Return an alignment of the type in bytes" |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
305 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
306 |
| alignmentAsValue | |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
307 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
308 |
alignmentAsValue := LLVM AlignOf: self. |
43
597181c496f0
Added value-kind testing functions to LLVMValue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
309 |
self assert: alignmentAsValue isConstant. |
597181c496f0
Added value-kind testing functions to LLVMValue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
310 |
self assert: alignmentAsValue type isIntegerType. |
33
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
311 |
^ LLVMCEXT ValueAsUInt64: alignmentAsValue. |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
312 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
313 |
"Created: / 14-08-2015 / 09:16:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
43
597181c496f0
Added value-kind testing functions to LLVMValue
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
33
diff
changeset
|
314 |
"Modified: / 17-09-2015 / 19:25:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
33
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
315 |
! |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
316 |
|
0 | 317 |
kind |
318 |
^ LLVM GetTypeKind: self |
|
319 |
||
320 |
"Created: / 07-07-2015 / 21:59:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
321 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
322 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
323 |
sizeInBits |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
324 |
"For integer, pointer, FP types, return the size in bits. For all |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
325 |
other types, throw an LLVMTypeError. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
326 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
327 |
LLVMType int32 sizeInBits -> 32 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
328 |
LLVMType int1 sizeInBits -> 1 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
329 |
" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
330 |
LLVMTypeError new signal: 'type size not known' |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
331 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
332 |
"Created: / 13-08-2015 / 16:25:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
33
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
333 |
! |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
334 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
335 |
sizeInBytes |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
336 |
"For integer, pointer, FP types, return the size in bytes (rounded up). For all |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
337 |
other types, throw an LLVMTypeError. |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
338 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
339 |
LLVMType int32 sizeInBytes -> 4 |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
340 |
LLVMType int1 sizeInBytes -> 1 |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
341 |
" |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
342 |
^ (self sizeInBits // 8) + (self sizeInBits \\ 8) |
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
343 |
|
feabf14b6c1d
Initial support for generating (DWARF) debug info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
28
diff
changeset
|
344 |
"Created: / 14-08-2015 / 07:27:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 345 |
! ! |
346 |
||
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
347 |
!LLVMType methodsFor:'comparing'! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
348 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
349 |
= anotherType |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
350 |
^ anotherType isLLVMType and:[ self address == anotherType address ] |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
351 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
352 |
"Created: / 08-08-2015 / 02:56:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
353 |
! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
354 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
355 |
hash |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
356 |
^ self address |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
357 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
358 |
"Created: / 08-08-2015 / 02:50:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
359 |
! ! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
360 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
361 |
!LLVMType methodsFor:'converting'! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
362 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
363 |
array: numberOfElements |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
364 |
"Create a fixed-size array whose elements are of type of receiver |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
365 |
`LLVMType int8 array: 13` returns `[ 13 x i8 ]`" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
366 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
367 |
self assertIsIntegerUnsigned: numberOfElements. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
368 |
^ LLVM ArrayType: self _: numberOfElements |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
369 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
370 |
"Created: / 13-08-2015 / 18:57:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
371 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
372 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
373 |
pointer |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
374 |
"Return a pointer to the type represented by the receiver. |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
375 |
`LLVMType int32 pointer` returns int32_t*" |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
376 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
377 |
^ LLVM PointerType: self _: "AddressSpace"0 |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
378 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
379 |
"Created: / 04-08-2015 / 19:31:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
380 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
381 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
382 |
vector: numberOfElements |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
383 |
"Create a fixed-size vector whose elements are of type of receiver." |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
384 |
|
53
bbf3a88e2358
LLVM 3.9: Vector types are supported only for pointers, integer and floating points.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
385 |
self shouldNotImplement |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
386 |
|
53
bbf3a88e2358
LLVM 3.9: Vector types are supported only for pointers, integer and floating points.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
50
diff
changeset
|
387 |
"Created: / 12-10-2015 / 18:27:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
388 |
! ! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
389 |
|
2
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
390 |
!LLVMType methodsFor:'debugging-dumping'! |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
391 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
392 |
dumpOn: aStream |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
393 |
aStream nextPutAll: self dumpString |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
394 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
395 |
"Created: / 10-07-2015 / 14:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
396 |
! |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
397 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
398 |
dumpString |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
399 |
| cstr str| |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
400 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
401 |
cstr := LLVM PrintTypeToString: self. |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
402 |
str := cstr copyCStringFromHeap. |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
403 |
LLVM DisposeMessage: cstr. |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
404 |
^ str |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
405 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
406 |
"Created: / 10-07-2015 / 14:31:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4 | 407 |
! |
408 |
||
409 |
printOn: aStream |
|
410 |
| kind | |
|
411 |
||
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
412 |
self class name printOn:aStream. |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
413 |
aStream nextPut:$(. |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
414 |
self address printOn:aStream base:16. |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
415 |
aStream space. |
4 | 416 |
aStream nextPutAll: self dumpString. |
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
417 |
" |
4 | 418 |
aStream nextPutAll: ' ['. |
419 |
kind := self kind. |
|
420 |
kind == LLVMVoidTypeKind ifTrue:[ |
|
421 |
aStream nextPutAll:'void' |
|
422 |
] ifFalse:[ kind == LLVMHalfTypeKind ifTrue:[ |
|
423 |
aStream nextPutAll:'half' |
|
424 |
] ifFalse:[ kind == LLVMFloatTypeKind ifTrue:[ |
|
425 |
aStream nextPutAll:'float' |
|
426 |
] ifFalse:[ kind == LLVMDoubleTypeKind ifTrue:[ |
|
427 |
aStream nextPutAll:'double' |
|
428 |
] ifFalse:[ kind == LLVMX86_FP80TypeKind ifTrue:[ |
|
429 |
aStream nextPutAll:'x86-fp80' |
|
430 |
] ifFalse:[ kind == LLVMFP128TypeKind ifTrue:[ |
|
431 |
aStream nextPutAll:'fp128' |
|
432 |
] ifFalse:[ kind == LLVMLabelTypeKind ifTrue:[ |
|
433 |
aStream nextPutAll:'label' |
|
434 |
] ifFalse:[ kind == LLVMIntegerTypeKind ifTrue:[ |
|
435 |
aStream nextPutAll:'int' |
|
436 |
] ifFalse:[ kind == LLVMFunctionTypeKind ifTrue:[ |
|
437 |
aStream nextPutAll:'funct' |
|
438 |
] ifFalse:[ kind == LLVMStructTypeKind ifTrue:[ |
|
439 |
aStream nextPutAll:'struct' |
|
440 |
] ifFalse:[ kind == LLVMArrayTypeKind ifTrue:[ |
|
441 |
aStream nextPutAll:'array' |
|
442 |
] ifFalse:[ kind == LLVMPointerTypeKind ifTrue:[ |
|
443 |
aStream nextPutAll:'ptr' |
|
444 |
] ifFalse:[ kind == LLVMVectorTypeKind ifTrue:[ |
|
445 |
aStream nextPutAll:'vector' |
|
446 |
] ifFalse:[ kind == LLVMMetadataTypeKind ifTrue:[ |
|
447 |
aStream nextPutAll:'md' |
|
448 |
] ifFalse:[ kind == LLVMX86_MMXTypeKind ifTrue:[ |
|
449 |
aStream nextPutAll:'x86-mmx' |
|
450 |
]]]]]]]]]]]]]]]. |
|
451 |
aStream nextPutAll: ']'. |
|
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
452 |
" |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
453 |
aStream nextPut:$). |
4 | 454 |
|
455 |
"Created: / 11-07-2015 / 07:08:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
456 |
"Modified: / 08-08-2015 / 04:21:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
457 |
! ! |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
458 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
459 |
!LLVMType methodsFor:'initialization'! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
460 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
461 |
initialize |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
462 |
self class == LLVMType ifTrue:[ |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
463 |
self changeClassTo: (KindToClassMapping at: self kind) |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
464 |
]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
465 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
466 |
"Created: / 13-08-2015 / 16:53:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
467 |
"Modified: / 13-08-2015 / 18:43:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
468 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
469 |
|
5 | 470 |
!LLVMType methodsFor:'testing'! |
471 |
||
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
472 |
isArrayType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
473 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
474 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
475 |
"Created: / 13-08-2015 / 16:19:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
476 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
477 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
478 |
isDoubleType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
479 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
480 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
481 |
"Created: / 13-08-2015 / 16:14:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
482 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
483 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
484 |
isFP128Type |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
485 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
486 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
487 |
"Created: / 13-08-2015 / 16:15:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
488 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
489 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
490 |
isFloatType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
491 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
492 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
493 |
"Created: / 13-08-2015 / 16:14:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
494 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
495 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
496 |
isFunctionType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
497 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
498 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
499 |
"Created: / 13-08-2015 / 16:16:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
500 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
501 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
502 |
isHalfType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
503 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
504 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
505 |
"Created: / 13-08-2015 / 16:14:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
506 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
507 |
|
5 | 508 |
isIntegerType |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
509 |
^ false |
5 | 510 |
|
511 |
"Created: / 11-07-2015 / 14:56:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
512 |
"Modified: / 13-08-2015 / 16:49:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5 | 513 |
! |
514 |
||
22
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
515 |
isLLVMType |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
516 |
"Return true, if receiver represents an LLVM type" |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
517 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
518 |
^ true |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
519 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
520 |
"Created: / 08-08-2015 / 02:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
521 |
! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
522 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
523 |
isLabelType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
524 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
525 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
526 |
"Created: / 13-08-2015 / 16:16:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
527 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
528 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
529 |
isMetadataType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
530 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
531 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
532 |
"Created: / 13-08-2015 / 16:20:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
533 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
534 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
535 |
isPPC_FP128Type |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
536 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
537 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
538 |
"Created: / 13-08-2015 / 16:15:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
539 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
540 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
541 |
isPointerType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
542 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
543 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
544 |
"Created: / 13-08-2015 / 16:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
545 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
546 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
547 |
isStructType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
548 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
549 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
550 |
"Created: / 13-08-2015 / 16:19:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
551 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
552 |
|
5 | 553 |
isVectorType |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
554 |
^ false |
5 | 555 |
|
556 |
"Created: / 11-07-2015 / 14:56:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
557 |
"Modified: / 13-08-2015 / 16:50:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
558 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
559 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
560 |
isVoidType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
561 |
^false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
562 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
563 |
"Created: / 13-08-2015 / 16:13:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
564 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
565 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
566 |
isX86_FP80Type |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
567 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
568 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
569 |
"Created: / 13-08-2015 / 16:14:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
570 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
571 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
572 |
isX86_MMXType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
573 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
574 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
575 |
"Created: / 13-08-2015 / 16:20:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5 | 576 |
! ! |
577 |
||
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
578 |
!LLVMType class methodsFor:'documentation'! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
579 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
580 |
version_HG |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
581 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
582 |
^ '$Changeset: <not expanded> $' |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
583 |
! ! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
584 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
585 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
586 |
LLVMType initialize! |