Vuo  2.4.0
VuoCompilerType.hh
Go to the documentation of this file.
1
10#pragma once
11
12#include "VuoBaseDetail.hh"
13#include "VuoCompilerModule.hh"
14
15class VuoType;
16
20class VuoCompilerType : public VuoBaseDetail<VuoType>, public VuoCompilerModule // Order matters: VuoCompilerModule after VuoBaseDetail - https://stackoverflow.com/a/2254306/238387
21{
22private:
23 Function *makeFromJsonFunction;
24 Function *getJsonFunction;
25 Function *getInterprocessJsonFunction;
26 Function *makeFromStringFunction;
27 Function *getStringFunction;
28 Function *getInterprocessStringFunction;
29 Function *getSummaryFunction;
30 Function *areEqualFunction;
31 Function *isLessThanFunction;
32 Function *retainFunction;
33 Function *releaseFunction;
34
35 Type *llvmArgumentType;
36 Type *llvmSecondArgumentType;
37 Type *llvmReturnType;
38 bool isReturnPassedAsArgument;
39
40 static bool isType(string typeName, Module *module);
41 void parse(void);
42 set<string> globalsToRename(void);
43 void parseOrGenerateValueFromStringFunction(void);
44 void parseOrGenerateStringFromValueFunction(bool isInterprocess);
45 void parseOrGenerateRetainOrReleaseFunction(bool isRetain);
46 Value * generateFunctionCallWithTypeParameter(Module *module, BasicBlock *block, Value *arg, Function *sourceFunction);
47
48 friend class TestVuoCompilerType;
49 friend class TestTypes;
50
51protected:
52 VuoCompilerType(string typeName, Module *module);
53
54public:
55 static VuoCompilerType * newType(string typeName, Module *module);
56 static bool isListType(VuoCompilerType *type);
57
58 Value * generateValueFromStringFunctionCall(Module *module, BasicBlock *block, Value *arg);
59 Value * generateStringFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
60 Value * generateInterprocessStringFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
61 Value * generateSummaryFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
62 void generateRetainCall(Module *module, BasicBlock *block, Value *arg);
63 void generateReleaseCall(Module *module, BasicBlock *block, Value *arg);
64 vector<Value *> convertPortDataToArgs(Module *module, BasicBlock *block, Value *arg, FunctionType *functionType, int parameterIndex, bool isUnloweredStructPointerParameter);
65 Value * convertArgsToPortData(Module *module, BasicBlock *block, Function *function, int parameterIndex);
66 size_t getSize(Module *module);
67 Value * convertToPortData(BasicBlock *block, Value *voidPointer);
69 vector<Type *> getFunctionParameterTypes(void);
70 PointerType * getFunctionParameterPointerType(void);
71 AttributeList getFunctionAttributes(void);
72 void copyFunctionParameterAttributes(Function *dstFunction);
73 void copyFunctionParameterAttributes(Module *module, CallInst *dstCall);
75 bool supportsComparison(void);
76};