Vuo 2.4.2
Loading...
Searching...
No Matches
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 *getStringFunction;
27 Function *getInterprocessStringFunction;
28 Function *getSummaryFunction;
29 Function *areEqualFunction;
30 Function *isLessThanFunction;
31 Function *retainFunction;
32 Function *releaseFunction;
33
34 Type *llvmArgumentType;
35 Type *llvmSecondArgumentType;
36 Type *llvmReturnType;
37 bool isReturnPassedAsArgument;
38
39 static bool isType(string typeName, Module *module);
40 void parse(void);
41 set<string> globalsToRename(void);
42 void parseOrGenerateStringFromValueFunction(bool isInterprocess);
43 void parseOrGenerateRetainOrReleaseFunction(bool isRetain);
44 Value * generateFunctionCallWithTypeParameter(Module *module, BasicBlock *block, Value *arg, Function *sourceFunction);
45
46 friend class TestVuoCompilerType;
47 friend class TestTypes;
48
49protected:
50 VuoCompilerType(string typeName, Module *module);
51
52public:
53 static VuoCompilerType * newType(string typeName, Module *module);
54 static bool isListType(VuoCompilerType *type);
55
56 Value * generateRetainedValueFromString(Module *module, BasicBlock *block, Value *stringValue);
57 Value * generateStringFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
58 Value * generateInterprocessStringFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
59 Value * generateSummaryFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
60 void generateRetainCall(Module *module, BasicBlock *block, Value *arg);
61 void generateReleaseCall(Module *module, BasicBlock *block, Value *arg);
62 vector<Value *> convertPortDataToArgs(Module *module, BasicBlock *block, Value *arg, FunctionType *functionType, int parameterIndex, bool isUnloweredStructPointerParameter);
63 Value * convertArgsToPortData(Module *module, BasicBlock *block, Function *function, int parameterIndex);
64 size_t getAllocationSize(Module *module);
65 size_t getStorageSize(Module *module);
66 Value * convertToPortData(BasicBlock *block, Value *voidPointer);
67 vector<Type *> getFunctionParameterTypes(void);
68 PointerType * getFunctionParameterPointerType(void);
69 AttributeList getFunctionAttributes(void);
70 void copyFunctionParameterAttributes(Function *dstFunction);
71 void copyFunctionParameterAttributes(Module *module, CallInst *dstCall);
73 bool supportsComparison(void);
74};