annotate gen/tollvm.h @ 1638:0de4525a9ed6

Apply workaround for #395 by klickverbot.
author Christian Kamm <kamm incasoftware de>
date Mon, 08 Mar 2010 20:06:08 +0100
parents 8b9f236dd051
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
664
eef8ac26c66c Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents: 648
diff changeset
1 #ifndef LDC_GEN_TOLLVM_H
eef8ac26c66c Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents: 648
diff changeset
2 #define LDC_GEN_TOLLVM_H
86
fd32135dca3e [svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents: 85
diff changeset
3
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
4 #include "gen/llvm.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
5 #include "lexer.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
6 #include "mtype.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
7 #include "attrib.h"
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
8 #include "declaration.h"
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
9
217
0806379a5eca [svn r233] Added: -oq command line option for writing fully qualified object names.
lindquist
parents: 213
diff changeset
10 #include "gen/structs.h"
0806379a5eca [svn r233] Added: -oq command line option for writing fully qualified object names.
lindquist
parents: 213
diff changeset
11
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
12 // D->LLVM type handling stuff
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
13 const LLType* DtoType(Type* t);
328
7086a84ab3d6 [svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.
lindquist
parents: 323
diff changeset
14
7086a84ab3d6 [svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.
lindquist
parents: 323
diff changeset
15 // same as DtoType except it converts 'void' to 'i8'
7086a84ab3d6 [svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.
lindquist
parents: 323
diff changeset
16 const LLType* DtoTypeNotVoid(Type* t);
7086a84ab3d6 [svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.
lindquist
parents: 323
diff changeset
17
7086a84ab3d6 [svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.
lindquist
parents: 323
diff changeset
18 // returns true is the type must be passed by pointer
81
3587401b6eeb [svn r85] Fixed: if a return statement appeared in the try block of a nested try-finally, only the inner-most finally block would be executed.
lindquist
parents: 77
diff changeset
19 bool DtoIsPassedByRef(Type* type);
328
7086a84ab3d6 [svn r349] Fixed problems with static arrays of void as well as a static arrays with zero length.
lindquist
parents: 323
diff changeset
20
988
2667e3a145be - Fixed LLVM style CL args for D2.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 945
diff changeset
21 // should argument be zero or sign extended
445
cc40db549aea Changed the handling of variadic intrinsics a bit.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 414
diff changeset
22 unsigned DtoShouldExtend(Type* type);
cc40db549aea Changed the handling of variadic intrinsics a bit.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 414
diff changeset
23
648
8d850fa25713 Fix VarDecls for tuples. Closes #99.
Christian Kamm <kamm incasoftware de>
parents: 611
diff changeset
24 // tuple helper
8d850fa25713 Fix VarDecls for tuples. Closes #99.
Christian Kamm <kamm incasoftware de>
parents: 611
diff changeset
25 // takes a arguments list and makes a struct type out of them
8d850fa25713 Fix VarDecls for tuples. Closes #99.
Christian Kamm <kamm incasoftware de>
parents: 611
diff changeset
26 //const LLType* DtoStructTypeFromArguments(Arguments* arguments);
8d850fa25713 Fix VarDecls for tuples. Closes #99.
Christian Kamm <kamm incasoftware de>
parents: 611
diff changeset
27
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
28 // delegate helpers
344
e20ce6d8d374 [svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents: 328
diff changeset
29 LLValue* DtoDelegateEquals(TOK op, LLValue* lhs, LLValue* rhs);
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
30
149
4c577c2b7229 [svn r155] Fixed a bunch of linkage problems (especially with templates)
lindquist
parents: 136
diff changeset
31 // return linkage type for symbol using the current ir state for context
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
32 LLGlobalValue::LinkageTypes DtoLinkage(Dsymbol* sym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
33 LLGlobalValue::LinkageTypes DtoInternalLinkage(Dsymbol* sym);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
34 LLGlobalValue::LinkageTypes DtoExternalLinkage(Dsymbol* sym);
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
35
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
36 // TODO: this one should be removed!!!
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
37 LLValue* DtoPointedType(LLValue* ptr, LLValue* val);
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
38
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
39 // some types
1501
8b9f236dd051 Build fix for LLVM >= r73431
Benjamin Kramer <benny.kra@gmail.com>
parents: 1480
diff changeset
40 const LLIntegerType* DtoSize_t();
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
41 const LLStructType* DtoInterfaceInfoType();
309
d59c363fccad [svn r330] Implemented synchronized statements.
lindquist
parents: 244
diff changeset
42 const LLStructType* DtoMutexType();
323
0d52412d5b1a [svn r344] Fixed some very minor issues with the usage listing when calling llvmdc with no arguments.
lindquist
parents: 309
diff changeset
43 const LLStructType* DtoModuleReferenceType();
4
e116aa1488e6 [svn r8] changed backend includes to always use the gen/<foo>.h prefix
lindquist
parents: 1
diff changeset
44
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
45 // getelementptr helpers
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
46 LLValue* DtoGEP1(LLValue* ptr, LLValue* i0, const char* var=NULL, llvm::BasicBlock* bb=NULL);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
47 LLValue* DtoGEP(LLValue* ptr, LLValue* i0, LLValue* i1, const char* var=NULL, llvm::BasicBlock* bb=NULL);
705
5a2983f97498 Fixed weird struct problem from downs, see mini/compile_structs1.d
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 664
diff changeset
48
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
49 LLValue* DtoGEPi1(LLValue* ptr, unsigned i0, const char* var=NULL, llvm::BasicBlock* bb=NULL);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
50 LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var=NULL, llvm::BasicBlock* bb=NULL);
1450
83bdf7bed9c5 Fix a type mismatch in ModuleInfo generation.
Frits van Bommel <fvbommel wxs.nl>
parents: 1375
diff changeset
51 LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1);
40
8b0e809563df [svn r44] Lots of bug fixes.
lindquist
parents: 34
diff changeset
52
136
0e28624814e8 [svn r140] did a lot of the work towards being able to pass multiple modules on the command line. not complete yet though
lindquist
parents: 133
diff changeset
53 // to constant helpers
1375
63f4afd01036 Cleaned up TypeInfo_Struct.
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents: 1364
diff changeset
54 LLConstantInt* DtoConstSize_t(uint64_t);
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
55 LLConstantInt* DtoConstUint(unsigned i);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
56 LLConstantInt* DtoConstInt(int i);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
57 LLConstantInt* DtoConstUbyte(unsigned char i);
1501
8b9f236dd051 Build fix for LLVM >= r73431
Benjamin Kramer <benny.kra@gmail.com>
parents: 1480
diff changeset
58 LLConstant* DtoConstFP(Type* t, long double value);
104
4d1e9eb001e0 [svn r108] Now basic suppport for complex types. =,+,-,*,/ are supported.
lindquist
parents: 102
diff changeset
59
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
60 LLConstant* DtoConstString(const char*);
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
61 LLConstant* DtoConstStringPtr(const char* str, const char* section = 0);
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
62 LLConstant* DtoConstBool(bool);
54
28e99b04a132 [svn r58] Fixed cond expression resulting in a non-basic type.
lindquist
parents: 53
diff changeset
63
86
fd32135dca3e [svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents: 85
diff changeset
64 // llvm wrappers
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
65 LLValue* DtoLoad(LLValue* src, const char* name=0);
1210
3d4581761b4c Add some alignment info where LLVM might otherwise be more pessimistic.
Frits van Bommel <fvbommel wxs.nl>
parents: 988
diff changeset
66 LLValue* DtoAlignedLoad(LLValue* src, const char* name=0);
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
67 void DtoStore(LLValue* src, LLValue* dst);
1210
3d4581761b4c Add some alignment info where LLVM might otherwise be more pessimistic.
Frits van Bommel <fvbommel wxs.nl>
parents: 988
diff changeset
68 void DtoAlignedStore(LLValue* src, LLValue* dst);
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
69 LLValue* DtoBitCast(LLValue* v, const LLType* t, const char* name=0);
797
340acf1535d0 Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 715
diff changeset
70 LLConstant* DtoBitCast(LLConstant* v, const LLType* t);
1353
45aca7e7cc88 Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents: 1210
diff changeset
71 LLValue* DtoInsertValue(LLValue* aggr, LLValue* v, unsigned idx);
45aca7e7cc88 Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents: 1210
diff changeset
72 LLValue* DtoExtractValue(LLValue* aggr, unsigned idx);
86
fd32135dca3e [svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents: 85
diff changeset
73
94
61615fa85940 [svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents: 92
diff changeset
74 // llvm::dyn_cast wrappers
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
75 const LLPointerType* isaPointer(LLValue* v);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
76 const LLPointerType* isaPointer(const LLType* t);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
77 const LLArrayType* isaArray(LLValue* v);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
78 const LLArrayType* isaArray(const LLType* t);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
79 const LLStructType* isaStruct(LLValue* v);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
80 const LLStructType* isaStruct(const LLType* t);
414
ac1fcc138e42 Fixed issue with internal real representation, incorrect for non x86-32 architectures.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 365
diff changeset
81 const LLFunctionType* isaFunction(LLValue* v);
ac1fcc138e42 Fixed issue with internal real representation, incorrect for non x86-32 architectures.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 365
diff changeset
82 const LLFunctionType* isaFunction(const LLType* t);
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
83 LLConstant* isaConstant(LLValue* v);
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
84 LLConstantInt* isaConstantInt(LLValue* v);
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
85 llvm::Argument* isaArgument(LLValue* v);
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
86 LLGlobalVariable* isaGlobalVar(LLValue* v);
94
61615fa85940 [svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
lindquist
parents: 92
diff changeset
87
133
44a95ac7368a [svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents: 131
diff changeset
88 // llvm::T::get(...) wrappers
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
89 const LLPointerType* getPtrToType(const LLType* t);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
90 const LLPointerType* getVoidPtrType();
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
91 llvm::ConstantPointerNull* getNullPtr(const LLType* t);
811
8e6135be6999 Fixed ModuleInfo generation to no longer use the ModuleInfo class' default initializer for types/defaults, it's unsafe as initializers don't necesarily match the "formal" type. There might be explicit padding.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 797
diff changeset
92 LLConstant* getNullValue(const LLType* t);
133
44a95ac7368a [svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents: 131
diff changeset
93
44a95ac7368a [svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents: 131
diff changeset
94 // type sizes
213
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
95 size_t getTypeBitSize(const LLType* t);
7816aafeea3c [svn r229] Updated the object.d implementation to the latest Tango.
lindquist
parents: 210
diff changeset
96 size_t getTypeStoreSize(const LLType* t);
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 811
diff changeset
97 size_t getTypePaddedSize(const LLType* t);
486
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 445
diff changeset
98
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
99 // type alignments
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
100 unsigned char getABITypeAlign(const LLType* t);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
101 unsigned char getPrefTypeAlign(const LLType* t);
133
44a95ac7368a [svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents: 131
diff changeset
102
797
340acf1535d0 Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 715
diff changeset
103 // get biggest type, for unions ...
340acf1535d0 Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 715
diff changeset
104 const LLType* getBiggestType(const LLType** begin, size_t n);
340acf1535d0 Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 715
diff changeset
105
585
fbb1a366cfbc Complex number should now follow the D ABI on x86. They're also treated as first class values now. Big change.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
106 // pair type helpers
fbb1a366cfbc Complex number should now follow the D ABI on x86. They're also treated as first class values now. Big change.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
107 LLValue* DtoAggrPair(const LLType* type, LLValue* V1, LLValue* V2, const char* name = 0);
715
30b42a283c8e Removed TypeOpaque from DMD.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 705
diff changeset
108 LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name = 0);
30b42a283c8e Removed TypeOpaque from DMD.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 705
diff changeset
109 LLValue* DtoAggrPaint(LLValue* aggr, const LLType* as);
945
03d7c4aac654 SWITCHED TO LLVM 2.5 !
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 811
diff changeset
110 LLValue* DtoAggrPairSwap(LLValue* aggr);
585
fbb1a366cfbc Complex number should now follow the D ABI on x86. They're also treated as first class values now. Big change.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
111
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
112 /**
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
113 * Generates a call to llvm.memset.i32 (or i64 depending on architecture).
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
114 * @param dst Destination memory.
1480
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
115 * @param val The value to set.
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
116 * @param nbytes Number of bytes to overwrite.
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
117 */
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
118 void DtoMemSet(LLValue* dst, LLValue* val, LLValue* nbytes);
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
119
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
120 /**
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
121 * Generates a call to llvm.memset.i32 (or i64 depending on architecture).
b3ba2c6ff038 Use `llvm.memset` instead of `_d_array_init_i1` and `_d_array_init_i8`.
Frits van Bommel <fvbommel wxs.nl>
parents: 1450
diff changeset
122 * @param dst Destination memory.
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
123 * @param nbytes Number of bytes to overwrite.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
124 */
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
125 void DtoMemSetZero(LLValue* dst, LLValue* nbytes);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
126
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
127 /**
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
128 * Generates a call to llvm.memcpy.i32 (or i64 depending on architecture).
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
129 * @param dst Destination memory.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
130 * @param src Source memory.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
131 * @param nbytes Number of bytes to copy.
1210
3d4581761b4c Add some alignment info where LLVM might otherwise be more pessimistic.
Frits van Bommel <fvbommel wxs.nl>
parents: 988
diff changeset
132 * @param align The minimum alignment of the source and destination memory.
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
133 */
1210
3d4581761b4c Add some alignment info where LLVM might otherwise be more pessimistic.
Frits van Bommel <fvbommel wxs.nl>
parents: 988
diff changeset
134 void DtoMemCpy(LLValue* dst, LLValue* src, LLValue* nbytes, unsigned align = 0);
86
fd32135dca3e [svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents: 85
diff changeset
135
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
136 /**
344
e20ce6d8d374 [svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents: 328
diff changeset
137 * Generates a call to C memcmp.
e20ce6d8d374 [svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents: 328
diff changeset
138 */
e20ce6d8d374 [svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents: 328
diff changeset
139 LLValue* DtoMemCmp(LLValue* lhs, LLValue* rhs, LLValue* nbytes);
e20ce6d8d374 [svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents: 328
diff changeset
140
e20ce6d8d374 [svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents: 328
diff changeset
141 /**
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
142 * The same as DtoMemSetZero but figures out the size itself by "dereferencing" the v pointer once.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
143 * @param v Destination memory.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
144 */
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
145 void DtoAggrZeroInit(LLValue* v);
97
c4e161556a21 [svn r101] Split up CastExp into several smaller utility functions.
lindquist
parents: 96
diff changeset
146
244
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
147 /**
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
148 * The same as DtoMemCpy but figures out the size itself by "dereferencing" dst the pointer once.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
149 * @param dst Destination memory.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
150 * @param src Source memory.
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
151 */
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
152 void DtoAggrCopy(LLValue* dst, LLValue* src);
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
153
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
154 /**
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
155 * Generates a call to llvm.memory.barrier
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
156 * @param ll load-load
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
157 * @param ls load-store
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
158 * @param sl store-load
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
159 * @param ss store-store
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
160 * @param device special device flag
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
161 */
a95056b3c996 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
lindquist
parents: 217
diff changeset
162 void DtoMemoryBarrier(bool ll, bool ls, bool sl, bool ss, bool device=false);
86
fd32135dca3e [svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents: 85
diff changeset
163
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
164 #include "enums.h"
86
fd32135dca3e [svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents: 85
diff changeset
165
664
eef8ac26c66c Some missed LLVMDC -> LDC.
Christian Kamm <kamm incasoftware de>
parents: 648
diff changeset
166 #endif // LDC_GEN_TOLLVM_H