The compiler detail class for VuoType
.
Definition at line 20 of file VuoCompilerType.hh.
Public Member Functions | |
Value * | generateRetainedValueFromString (Module *module, BasicBlock *block, Value *stringValue) |
Generates code that unserializes data from a string. More... | |
Value * | generateStringFromValueFunctionCall (Module *module, BasicBlock *block, Value *arg) |
Generates a call to [Type]_getString(). More... | |
Value * | generateInterprocessStringFromValueFunctionCall (Module *module, BasicBlock *block, Value *arg) |
Generates a call to [Type]_getInterprocessString(). More... | |
Value * | generateSummaryFromValueFunctionCall (Module *module, BasicBlock *block, Value *arg) |
Generates a call to [Type]_getSummary(). More... | |
void | generateRetainCall (Module *module, BasicBlock *block, Value *arg) |
Generates a call to [Type]_retain(), if needed. More... | |
void | generateReleaseCall (Module *module, BasicBlock *block, Value *arg) |
Generates a call to [Type]_release(), if needed. More... | |
vector< Value * > | convertPortDataToArgs (Module *module, BasicBlock *block, Value *arg, FunctionType *functionType, int parameterIndex, bool isUnloweredStructPointerParameter) |
Generates an argument or arguments representing the port data, lowered for the C ABI. More... | |
Value * | convertArgsToPortData (Module *module, BasicBlock *block, Function *function, int parameterIndex) |
Unlowers the function argument at parameterIndex (and the one after, if this data type is lowered to 2 arguments) into port data (the same data type as portContext->data ). More... | |
size_t | getAllocationSize (Module *module) |
Returns the offset in bytes between successive objects of the type, including alignment padding. More... | |
size_t | getStorageSize (Module *module) |
Returns the maximum number of bytes that may be overwritten by storing the type. More... | |
Value * | convertToPortData (BasicBlock *block, Value *voidPointer) |
Casts a void * to a pointer to this type's storage. More... | |
vector< Type * > | getFunctionParameterTypes (void) |
Returns the LLVM type(s) for when this Vuo type is passed to a function. More... | |
PointerType * | getFunctionParameterPointerType (void) |
Returns the LLVM type for when a pointer to this Vuo type is passed to a function. More... | |
AttributeList | getFunctionAttributes (void) |
Returns the LLVM attributes for this Vuo type when it appears as a function parameter. More... | |
void | copyFunctionParameterAttributes (Function *dstFunction) |
Copies the LLVM attributes for this Vuo type as a function parameter onto the parameter(s) of dstFunction. More... | |
void | copyFunctionParameterAttributes (Module *module, CallInst *dstCall) |
Copies the LLVM attributes for this Vuo type as a function parameter onto the parameter(s) of dstCall. More... | |
bool | hasInterprocessStringFunction (void) |
Returns true if the type's getInterprocessString() function is defined. More... | |
bool | supportsComparison (void) |
Returns true if the type's areEqual and isLessThan functions are defined. More... | |
Public Member Functions inherited from VuoBaseDetail< VuoType > | |
VuoBaseDetail (string description, VuoType *base) | |
Creates a detail class. More... | |
VuoType * | getBase (void) const |
Returns the detail class instance's base class instance. More... | |
void | setBase (VuoType *base) |
Sets the detail class instance's base class instance. More... | |
Public Member Functions inherited from VuoCompilerModule | |
virtual | ~VuoCompilerModule (void) |
Destructor. More... | |
VuoCompilerCompatibility | parseCompatibility (json_object *o, string key) |
Parses the target set value for key in the top level of the JSON object. More... | |
virtual set< string > | getDependencies (void) |
Returns a list of this VuoCompilerModule's dependencies. More... | |
virtual string | getDependencyName (void) |
Returns the name that would represent this VuoCompilerModule in another VuoCompilerModule's list of dependencies. More... | |
VuoCompilerCompatibility | getCompatibleTargets (void) |
Returns the set of targets (operating system versions) with which this module is compatible. More... | |
Module * | getModule (void) |
Returns this VuoCompilerModule's LLVM module, which other LLVM modules can link to. More... | |
VuoModule * | getPseudoBase (void) |
Returns the (pseudo) base for this (pseudo) compiler detail class. More... | |
bool | isBuiltIn (void) |
Returns true if this module is one of the built-in modules distributed with Vuo. More... | |
void | setBuiltIn (bool builtIn) |
Sets whether this module is one of the built-in modules distributed with Vuo. More... | |
string | getModulePath (void) |
Returns the file from which the LLVM module was loaded, or an empty string if the module was contained in an archive or generated by the compiler. More... | |
Static Public Member Functions | |
static VuoCompilerType * | newType (string typeName, Module *module) |
Creates a type from the type definition in the module. More... | |
static bool | isListType (VuoCompilerType *type) |
Returns true if the type is a list type. More... | |
Static Public Member Functions inherited from VuoCompilerModule | |
static VuoCompilerModule * | newModule (const string &moduleKey, Module *module, const string &modulePath, const VuoCompilerCompatibility &moduleCompatibility) |
Instantiates a VuoCompilerModule (or child class) corresponding to the type of VuoCompilerModule defined in the LLVM module. More... | |
static Function * | declareFunctionInModule (Module *module, Function *function) |
Copies the function's header into the LLVM module, if it's not already there. More... | |
Protected Member Functions | |
VuoCompilerType (string typeName, Module *module) | |
Creates a type from an LLVM module, and creates its corresponding base VuoType . More... | |
Protected Member Functions inherited from VuoCompilerModule | |
VuoCompilerModule (VuoModule *base, Module *module) | |
Creates a VuoCompilerModule associated with the given LLVM module, as a pseudo compiler detail class of the given VuoModule. More... | |
virtual void | parse (void) |
Renames globals in the LLVM module that might conflict with other VuoCompilerModules, and parses those globals. More... | |
virtual void | parseMetadata (void) |
Parses the metadata of this VuoCompilerModule (name, description, ...) from the LLVM module. More... | |
virtual set< string > | globalsToRename (void) |
Returns a list of global variables and functions that may be defined in multiple modules, and thus need to be renamed. More... | |
string | nameForGlobal (string genericGlobalVarOrFuncName) |
Returns the mangled name for a function or global variable. More... | |
void | renameGlobalVarsAndFuncs (void) |
Renames the global variables and functions within the LLVM module so that they are unique to this VuoCompilerModule. More... | |
Friends | |
class | TestVuoCompilerType |
class | TestTypes |
Additional Inherited Members | |
Static Protected Member Functions inherited from VuoCompilerModule | |
static string | nameForGlobal (string nameBeforeCompilation, string moduleKey) |
Returns the mangled name for a function or global variable. More... | |
static bool | hasOriginalOrMangledGlobal (string nameBeforeCompilation, Module *module, string moduleKey) |
Returns true if the module contains a function or global variable with name nameBeforeCompilation or with the corresponding mangled name. More... | |
Protected Attributes inherited from VuoCompilerModule | |
struct json_object * | moduleDetails |
This module's metadata, found in the argument to VuoModuleMetadata in the module definition. More... | |
set< string > | dependencies |
The dependencies found in this module's metadata. More... | |
VuoCompilerCompatibility | compatibleTargets |
The set of targets with which this module is compatible. More... | |
Module * | module |
The LLVM module that defines this node class or type. More... | |
VuoCompilerBitcodeParser * | parser |
The parser of the LLVM module. More... | |
|
protected |
Creates a type from an LLVM module, and creates its corresponding base VuoType
.
Definition at line 21 of file VuoCompilerType.cc.
Value * VuoCompilerType::convertArgsToPortData | ( | Module * | module, |
BasicBlock * | block, | ||
Function * | function, | ||
int | parameterIndex | ||
) |
Unlowers the function argument at parameterIndex (and the one after, if this data type is lowered to 2 arguments) into port data (the same data type as portContext->data
).
Definition at line 465 of file VuoCompilerType.cc.
vector< Value * > VuoCompilerType::convertPortDataToArgs | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | arg, | ||
FunctionType * | functionType, | ||
int | parameterIndex, | ||
bool | isUnloweredStructPointerParameter | ||
) |
Generates an argument or arguments representing the port data, lowered for the C ABI.
arg
should be the same data type as portContext->data
.
Definition at line 398 of file VuoCompilerType.cc.
Value * VuoCompilerType::convertToPortData | ( | BasicBlock * | block, |
Value * | voidPointer | ||
) |
Casts a void *
to a pointer to this type's storage.
Definition at line 548 of file VuoCompilerType.cc.
void VuoCompilerType::copyFunctionParameterAttributes | ( | Function * | dstFunction | ) |
Copies the LLVM attributes for this Vuo type as a function parameter onto the parameter(s) of dstFunction.
Definition at line 590 of file VuoCompilerType.cc.
void VuoCompilerType::copyFunctionParameterAttributes | ( | Module * | module, |
CallInst * | dstCall | ||
) |
Copies the LLVM attributes for this Vuo type as a function parameter onto the parameter(s) of dstCall.
Definition at line 598 of file VuoCompilerType.cc.
Value * VuoCompilerType::generateInterprocessStringFromValueFunctionCall | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | arg | ||
) |
Generates a call to [Type]_getInterprocessString().
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
arg | The argument to pass to [Type]_getInterprocessString(). |
[Type]_getInterprocessString(), or the return value of
[Type]_getString() if the interprocess function doesn't exist. Definition at line 356 of file VuoCompilerType.cc.
void VuoCompilerType::generateReleaseCall | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | arg | ||
) |
Generates a call to [Type]_release(), if needed.
Definition at line 388 of file VuoCompilerType.cc.
void VuoCompilerType::generateRetainCall | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | arg | ||
) |
Generates a call to [Type]_retain(), if needed.
Definition at line 380 of file VuoCompilerType.cc.
Value * VuoCompilerType::generateRetainedValueFromString | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | stringValue | ||
) |
Generates code that unserializes data from a string.
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
stringValue | The serialized data, which will be passed to json_tokener_parse() . |
portContext->data
). Definition at line 302 of file VuoCompilerType.cc.
Value * VuoCompilerType::generateStringFromValueFunctionCall | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | arg | ||
) |
Generates a call to [Type]_getString().
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
arg | The argument to pass to [Type]_getString(). |
[Type]_getString(). Definition at line 343 of file VuoCompilerType.cc.
Value * VuoCompilerType::generateSummaryFromValueFunctionCall | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | arg | ||
) |
Generates a call to [Type]_getSummary().
module | The destination LLVM module (i.e., generated code). |
block | The LLVM block to which to append the function call. |
arg | The argument to pass to [Type]_getSummary(). |
[Type]_getSummary(). Definition at line 372 of file VuoCompilerType.cc.
size_t VuoCompilerType::getAllocationSize | ( | Module * | module | ) |
Returns the offset in bytes between successive objects of the type, including alignment padding.
Definition at line 524 of file VuoCompilerType.cc.
AttributeList VuoCompilerType::getFunctionAttributes | ( | void | ) |
Returns the LLVM attributes for this Vuo type when it appears as a function parameter.
This is needed, for example, for struct parameters with the "byval" attribute.
Definition at line 582 of file VuoCompilerType.cc.
PointerType * VuoCompilerType::getFunctionParameterPointerType | ( | void | ) |
Returns the LLVM type for when a pointer to this Vuo type is passed to a function.
Definition at line 572 of file VuoCompilerType.cc.
vector< Type * > VuoCompilerType::getFunctionParameterTypes | ( | void | ) |
Returns the LLVM type(s) for when this Vuo type is passed to a function.
Definition at line 560 of file VuoCompilerType.cc.
size_t VuoCompilerType::getStorageSize | ( | Module * | module | ) |
Returns the maximum number of bytes that may be overwritten by storing the type.
Definition at line 536 of file VuoCompilerType.cc.
bool VuoCompilerType::hasInterprocessStringFunction | ( | void | ) |
Returns true if the type's getInterprocessString()
function is defined.
Definition at line 617 of file VuoCompilerType.cc.
|
static |
Returns true if the type is a list type.
Definition at line 606 of file VuoCompilerType.cc.
|
static |
Creates a type from the type definition in the module.
If the module does not contain a type definition, returns NULL.
Definition at line 49 of file VuoCompilerType.cc.
bool VuoCompilerType::supportsComparison | ( | void | ) |
Returns true if the type's areEqual
and isLessThan
functions are defined.
Definition at line 625 of file VuoCompilerType.cc.
|
friend |
Definition at line 47 of file VuoCompilerType.hh.
|
friend |
Definition at line 46 of file VuoCompilerType.hh.