comparison gen/tollvm.h @ 86:fd32135dca3e trunk

[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!! Lots of bugfixes. Added support for special foreach on strings. Added std.array, std.utf, std.ctype and std.uni to phobos. Changed all the .c files in the gen dir to .cpp (it *is* C++ after all)
author lindquist
date Sat, 03 Nov 2007 14:44:58 +0100
parents f869c636a113
children 058d3925950e
comparison
equal deleted inserted replaced
85:f869c636a113 86:fd32135dca3e
1 #ifndef LLVMDC_GEN_TOLLVM_H
2 #define LLVMDC_GEN_TOLLVM_H
3
1 // D -> LLVM helpers 4 // D -> LLVM helpers
2 5
3 struct StructInitializer; 6 struct StructInitializer;
7 struct DValue;
4 8
5 const llvm::Type* DtoType(Type* t); 9 const llvm::Type* DtoType(Type* t);
6 bool DtoIsPassedByRef(Type* type); 10 bool DtoIsPassedByRef(Type* type);
7 Type* DtoDType(Type* t); 11 Type* DtoDType(Type* t);
8 12
53 57
54 llvm::Value* DtoArgument(const llvm::Type* paramtype, Argument* fnarg, Expression* argexp); 58 llvm::Value* DtoArgument(const llvm::Type* paramtype, Argument* fnarg, Expression* argexp);
55 59
56 llvm::Value* DtoNestedVariable(VarDeclaration* vd); 60 llvm::Value* DtoNestedVariable(VarDeclaration* vd);
57 61
58 void DtoAssign(Type* lhsType, llvm::Value* lhs, llvm::Value* rhs);
59
60 llvm::ConstantInt* DtoConstSize_t(size_t); 62 llvm::ConstantInt* DtoConstSize_t(size_t);
61 llvm::ConstantInt* DtoConstUint(unsigned i); 63 llvm::ConstantInt* DtoConstUint(unsigned i);
62 llvm::ConstantInt* DtoConstInt(int i); 64 llvm::ConstantInt* DtoConstInt(int i);
63 llvm::Constant* DtoConstString(const char*); 65 llvm::Constant* DtoConstString(const char*);
64 llvm::Constant* DtoConstStringPtr(const char* str, const char* section = 0); 66 llvm::Constant* DtoConstStringPtr(const char* str, const char* section = 0);
65 llvm::Constant* DtoConstBool(bool); 67 llvm::Constant* DtoConstBool(bool);
66 68
67 void DtoMemCpy(llvm::Value* dst, llvm::Value* src, llvm::Value* nbytes);
68
69 llvm::Value* DtoIndexStruct(llvm::Value* ptr, StructDeclaration* sd, Type* t, unsigned os, std::vector<unsigned>& idxs); 69 llvm::Value* DtoIndexStruct(llvm::Value* ptr, StructDeclaration* sd, Type* t, unsigned os, std::vector<unsigned>& idxs);
70 70
71 bool DtoIsTemplateInstance(Dsymbol* s); 71 bool DtoIsTemplateInstance(Dsymbol* s);
72 72
73 // llvm wrappers
74 void DtoMemCpy(llvm::Value* dst, llvm::Value* src, llvm::Value* nbytes);
75 bool DtoCanLoad(llvm::Value* ptr);
76 llvm::Value* DtoLoad(llvm::Value* src);
77 void DtoStore(llvm::Value* src, llvm::Value* dst);
78 llvm::Value* DtoBitCast(llvm::Value* v, const llvm::Type* t);
79
80 // basic operations
81 void DtoAssign(DValue* lhs, DValue* rhs);
82
83 // binary operations
84 DValue* DtoBinAdd(DValue* lhs, DValue* rhs);
85 DValue* DtoBinSub(DValue* lhs, DValue* rhs);
86 DValue* DtoBinMul(DValue* lhs, DValue* rhs);
87 DValue* DtoBinDiv(DValue* lhs, DValue* rhs);
88 DValue* DtoBinRem(DValue* lhs, DValue* rhs);
89
73 #include "enums.h" 90 #include "enums.h"
91
92 #endif // LLVMDC_GEN_TOLLVM_H