Vuo  2.0.0
VuoCompilerType.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoBaseDetail.hh"
13 #include "VuoCompilerModule.hh"
14 
15 class VuoType;
16 
20 class VuoCompilerType : public VuoBaseDetail<VuoType>, public VuoCompilerModule // Order matters: VuoCompilerModule after VuoBaseDetail - https://stackoverflow.com/a/2254306/238387
21 {
22 private:
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  Type *llvmType;
35 
36  static bool isType(string typeName, Module *module);
37  void parse(void);
38  set<string> globalsToRename(void);
39  void parseOrGenerateValueFromStringFunction(void);
40  void parseOrGenerateStringFromValueFunction(bool isInterprocess);
41  void parseOrGenerateRetainOrReleaseFunction(bool isRetain);
42  Value * generateFunctionCallWithTypeParameter(Module *module, BasicBlock *block, Value *arg, Function *sourceFunction);
43 
44 protected:
45  VuoCompilerType(string typeName, Module *module);
46 
47 public:
48  static VuoCompilerType * newType(string typeName, Module *module);
49  static bool isListType(VuoCompilerType *type);
50 
51  Value * generateValueFromStringFunctionCall(Module *module, BasicBlock *block, Value *arg);
52  Value * generateStringFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
53  Value * generateInterprocessStringFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
54  Value * generateSummaryFromValueFunctionCall(Module *module, BasicBlock *block, Value *arg);
55  void generateRetainCall(Module *module, BasicBlock *block, Value *arg);
56  void generateReleaseCall(Module *module, BasicBlock *block, Value *arg);
57  Type * getType(void);
58  Type * getFunctionParameterType(Type **secondType);
59  AttributeSet getFunctionParameterAttributes(void);
61  bool supportsComparison(void);
62 };