author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 14 Aug 2015 06:26:02 +0100 | |
changeset 27 | b26354bbff25 |
parent 22 | 789a35bd30ac |
child 28 | 97013ae2abae |
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 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
49 |
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
|
50 |
LLVMHalfTypeKind . LLVMTypeHalt . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
51 |
LLVMFloatTypeKind . LLVMTypeFloat . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
52 |
LLVMDoubleTypeKind . LLVMTypeDouble . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
53 |
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
|
54 |
LLVMFP128TypeKind . LLVMTypeFP128. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
55 |
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
|
56 |
LLVMIntegerTypeKind . LLVMTypeInteger . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
57 |
LLVMVectorTypeKind . LLVMTypeVector . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
58 |
LLVMArrayTypeKind . LLVMTypeArray . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
59 |
LLVMStructTypeKind . LLVMTypeStruct . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
60 |
LLVMPointerTypeKind . LLVMTypePointer . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
61 |
LLVMFunctionTypeKind . LLVMTypeFunction . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
62 |
LLVMMetadataTypeKind . LLVMTypeMetadata . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
63 |
LLVMVoidTypeKind . LLVMTypeVoid . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
64 |
LLVMLabelTypeKind . LLVMTypeLabel . |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
65 |
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
|
66 |
} |
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 |
"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
|
69 |
! ! |
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 |
!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
|
72 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
73 |
newAddress:addr |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
74 |
^ (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
|
75 |
initialize; |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
76 |
yourself |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
77 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
78 |
"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
|
79 |
! ! |
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 |
!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
|
82 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
83 |
isAbstract |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
84 |
"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
|
85 |
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
|
86 |
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
|
87 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
88 |
^ self == LLVMType. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
89 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
90 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
91 |
!LLVMType class methodsFor:'types - C'! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
92 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
93 |
char |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
94 |
^ self int8 |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
95 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
96 |
"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
|
97 |
! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
98 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
99 |
void |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
100 |
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
|
101 |
^ Void |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
102 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
103 |
"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
|
104 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
105 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
106 |
wchar |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
107 |
^ self int16 |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
108 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
109 |
"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
|
110 |
! ! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
111 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
112 |
!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
|
113 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
114 |
double |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
115 |
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
|
116 |
^ Double |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
117 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
118 |
"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
|
119 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
120 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
121 |
float |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
122 |
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
|
123 |
^ Float |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
124 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
125 |
"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
|
126 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
127 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
128 |
fp128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
129 |
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
|
130 |
^ FP128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
131 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
132 |
"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
|
133 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
134 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
135 |
half |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
136 |
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
|
137 |
^ Half |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
138 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
139 |
"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
|
140 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
141 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
142 |
ppcfp128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
143 |
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
|
144 |
^ PPCFP128 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
145 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
146 |
"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
|
147 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
148 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
149 |
x86fp80 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
150 |
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
|
151 |
^ X86FP80 |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
152 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
153 |
"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
|
154 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
155 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
156 |
x86mmx |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
157 |
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
|
158 |
^ X86MMX |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
159 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
160 |
"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
|
161 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
162 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
163 |
!LLVMType class methodsFor:'types - functions'! |
0 | 164 |
|
165 |
function: argumentTypes returning: returnType |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
166 |
^ self function: argumentTypes varargs: false returning: returnType |
0 | 167 |
|
168 |
"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
|
169 |
"Modified: / 04-08-2015 / 19:44:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 170 |
! |
171 |
||
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
172 |
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
|
173 |
^ 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
|
174 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
175 |
"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
|
176 |
! ! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
177 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
178 |
!LLVMType class methodsFor:'types - integers'! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
179 |
|
0 | 180 |
int1 |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
181 |
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
|
182 |
^ Int1 |
0 | 183 |
|
184 |
"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
|
185 |
"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
|
186 |
"Modified (format): / 13-08-2015 / 17:21:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 187 |
! |
188 |
||
189 |
int16 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
190 |
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
|
191 |
^ Int16 |
0 | 192 |
|
193 |
"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
|
194 |
"Modified: / 13-08-2015 / 18:48:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 195 |
! |
196 |
||
197 |
int32 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
198 |
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
|
199 |
^ Int32 |
0 | 200 |
|
201 |
"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
|
202 |
"Modified: / 13-08-2015 / 17:22:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 203 |
! |
204 |
||
205 |
int64 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
206 |
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
|
207 |
^ Int64 |
0 | 208 |
|
209 |
"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
|
210 |
"Modified: / 13-08-2015 / 17:22:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 211 |
! |
212 |
||
213 |
int8 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
214 |
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
|
215 |
^ Int8 |
0 | 216 |
|
217 |
"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
|
218 |
"Modified: / 13-08-2015 / 18:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4 | 219 |
! |
220 |
||
221 |
intptr |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
222 |
IntPtr isNil ifTrue:[ IntPtr := LLVM IntPtrType: LLVMTargetData new ]. |
4 | 223 |
^ IntPtr |
224 |
||
225 |
"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
|
226 |
"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
|
227 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
228 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
229 |
!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
|
230 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
231 |
struct: memberTypes |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
232 |
^ 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
|
233 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
234 |
"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
|
235 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
236 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
237 |
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
|
238 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
239 |
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
|
240 |
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
|
241 |
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
|
242 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
243 |
^ LLVM StructType: memberTypes asLLVMObjectArray _: memberTypes size _: (packed ifTrue:[ 1 ] ifFalse:[ 0 ]) |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
244 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
245 |
"Created: / 13-08-2015 / 19:15:17 / 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
|
246 |
"Modified: / 14-08-2015 / 05:49:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 247 |
! ! |
248 |
||
249 |
!LLVMType methodsFor:'accessing'! |
|
250 |
||
251 |
kind |
|
252 |
^ LLVM GetTypeKind: self |
|
253 |
||
254 |
"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
|
255 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
256 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
257 |
sizeInBits |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
258 |
"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
|
259 |
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
|
260 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
261 |
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
|
262 |
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
|
263 |
" |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
264 |
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
|
265 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
266 |
"Created: / 13-08-2015 / 16:25:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 267 |
! ! |
268 |
||
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
|
269 |
!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
|
270 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
271 |
= 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
|
272 |
^ 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
|
273 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
274 |
"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
|
275 |
! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
276 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
277 |
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
|
278 |
^ 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
|
279 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
280 |
"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
|
281 |
! ! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
282 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
283 |
!LLVMType methodsFor:'converting'! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
284 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
285 |
array: numberOfElements |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
286 |
"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
|
287 |
`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
|
288 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
289 |
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
|
290 |
^ 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
|
291 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
292 |
"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
|
293 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
294 |
|
19
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
295 |
pointer |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
296 |
"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
|
297 |
`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
|
298 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
299 |
^ LLVM PointerType: self _: "AddressSpace"0 |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
300 |
|
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
301 |
"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
|
302 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
303 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
304 |
vector: numberOfElements |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
305 |
"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
|
306 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
307 |
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
|
308 |
^ LLVM VectorType: self _: numberOfElements |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
309 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
310 |
"Created: / 13-08-2015 / 18:59:41 / 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
|
311 |
! ! |
706be0fcef22
Refactored 'Hello World' example to ise GEP.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
16
diff
changeset
|
312 |
|
2
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
313 |
!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
|
314 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
315 |
dumpOn: aStream |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
316 |
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
|
317 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
318 |
"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
|
319 |
! |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
320 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
321 |
dumpString |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
322 |
| cstr str| |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
323 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
324 |
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
|
325 |
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
|
326 |
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
|
327 |
^ str |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
328 |
|
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
329 |
"Created: / 10-07-2015 / 14:31:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4 | 330 |
! |
331 |
||
332 |
printOn: aStream |
|
333 |
| kind | |
|
334 |
||
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
|
335 |
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
|
336 |
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
|
337 |
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
|
338 |
aStream space. |
4 | 339 |
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
|
340 |
" |
4 | 341 |
aStream nextPutAll: ' ['. |
342 |
kind := self kind. |
|
343 |
kind == LLVMVoidTypeKind ifTrue:[ |
|
344 |
aStream nextPutAll:'void' |
|
345 |
] ifFalse:[ kind == LLVMHalfTypeKind ifTrue:[ |
|
346 |
aStream nextPutAll:'half' |
|
347 |
] ifFalse:[ kind == LLVMFloatTypeKind ifTrue:[ |
|
348 |
aStream nextPutAll:'float' |
|
349 |
] ifFalse:[ kind == LLVMDoubleTypeKind ifTrue:[ |
|
350 |
aStream nextPutAll:'double' |
|
351 |
] ifFalse:[ kind == LLVMX86_FP80TypeKind ifTrue:[ |
|
352 |
aStream nextPutAll:'x86-fp80' |
|
353 |
] ifFalse:[ kind == LLVMFP128TypeKind ifTrue:[ |
|
354 |
aStream nextPutAll:'fp128' |
|
355 |
] ifFalse:[ kind == LLVMLabelTypeKind ifTrue:[ |
|
356 |
aStream nextPutAll:'label' |
|
357 |
] ifFalse:[ kind == LLVMIntegerTypeKind ifTrue:[ |
|
358 |
aStream nextPutAll:'int' |
|
359 |
] ifFalse:[ kind == LLVMFunctionTypeKind ifTrue:[ |
|
360 |
aStream nextPutAll:'funct' |
|
361 |
] ifFalse:[ kind == LLVMStructTypeKind ifTrue:[ |
|
362 |
aStream nextPutAll:'struct' |
|
363 |
] ifFalse:[ kind == LLVMArrayTypeKind ifTrue:[ |
|
364 |
aStream nextPutAll:'array' |
|
365 |
] ifFalse:[ kind == LLVMPointerTypeKind ifTrue:[ |
|
366 |
aStream nextPutAll:'ptr' |
|
367 |
] ifFalse:[ kind == LLVMVectorTypeKind ifTrue:[ |
|
368 |
aStream nextPutAll:'vector' |
|
369 |
] ifFalse:[ kind == LLVMMetadataTypeKind ifTrue:[ |
|
370 |
aStream nextPutAll:'md' |
|
371 |
] ifFalse:[ kind == LLVMX86_MMXTypeKind ifTrue:[ |
|
372 |
aStream nextPutAll:'x86-mmx' |
|
373 |
]]]]]]]]]]]]]]]. |
|
374 |
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
|
375 |
" |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
376 |
aStream nextPut:$). |
4 | 377 |
|
378 |
"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
|
379 |
"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
|
380 |
! ! |
53abac7217de
Added support for creating execution engines and fetching function addresses.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1
diff
changeset
|
381 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
382 |
!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
|
383 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
384 |
initialize |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
385 |
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
|
386 |
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
|
387 |
]. |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
388 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
389 |
"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
|
390 |
"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
|
391 |
! ! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
392 |
|
5 | 393 |
!LLVMType methodsFor:'testing'! |
394 |
||
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
395 |
isArrayType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
396 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
397 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
398 |
"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
|
399 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
400 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
401 |
isDoubleType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
402 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
403 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
404 |
"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
|
405 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
406 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
407 |
isFP128Type |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
408 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
409 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
410 |
"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
|
411 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
412 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
413 |
isFloatType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
414 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
415 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
416 |
"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
|
417 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
418 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
419 |
isFunctionType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
420 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
421 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
422 |
"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
|
423 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
424 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
425 |
isHalfType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
426 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
427 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
428 |
"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
|
429 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
430 |
|
5 | 431 |
isIntegerType |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
432 |
^ false |
5 | 433 |
|
434 |
"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
|
435 |
"Modified: / 13-08-2015 / 16:49:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5 | 436 |
! |
437 |
||
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
|
438 |
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
|
439 |
"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
|
440 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
441 |
^ 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
|
442 |
|
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
443 |
"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
|
444 |
! |
789a35bd30ac
Added example for compiling conditional. Added convenience API to simply code generation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
19
diff
changeset
|
445 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
446 |
isLabelType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
447 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
448 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
449 |
"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
|
450 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
451 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
452 |
isMetadataType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
453 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
454 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
455 |
"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
|
456 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
457 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
458 |
isPPC_FP128Type |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
459 |
^ false |
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 |
"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
|
462 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
463 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
464 |
isPointerType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
465 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
466 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
467 |
"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
|
468 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
469 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
470 |
isStructType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
471 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
472 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
473 |
"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
|
474 |
! |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
475 |
|
5 | 476 |
isVectorType |
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
477 |
^ false |
5 | 478 |
|
479 |
"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
|
480 |
"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
|
481 |
! |
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 |
isVoidType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
484 |
^false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
485 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
486 |
"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
|
487 |
! |
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 |
isX86_FP80Type |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
490 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
491 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
492 |
"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
|
493 |
! |
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 |
isX86_MMXType |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
496 |
^ false |
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
497 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
498 |
"Created: / 13-08-2015 / 16:20:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5 | 499 |
! ! |
500 |
||
16
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
501 |
!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
|
502 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
503 |
version_HG |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
504 |
|
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
505 |
^ '$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
|
506 |
! ! |
23e82cf19788
Tests refactored to be actually a testcase. Introduced LLVMConstant class
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14
diff
changeset
|
507 |
|
27
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
508 |
|
b26354bbff25
LLVM type system refactored to use a subclass per kind.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
22
diff
changeset
|
509 |
LLVMType initialize! |