A node class or type defined in an LLVM module.
This class would be the compiler detail class for VuoModule
, except that the inheritance doesn't work out.
Definition at line 22 of file VuoCompilerModule.hh.
Public Member Functions | |
virtual | ~VuoCompilerModule (void) |
Destructor. More... | |
VuoCompilerTargetSet | parseTargetSet (json_object *o, string key) |
Parses the target set value for key in the top level of the JSON object. More... | |
VuoCompilerTargetSet::MacVersion | parseMacVersion (string version) |
Parses a Mac OS version from a string. 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... | |
VuoCompilerTargetSet | 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 VuoCompilerModule * | newModule (const string &moduleKey, Module *module, const string &modulePath) |
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 | |
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... | |
Static Protected Member Functions | |
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 | |
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... | |
Module * | module |
The LLVM module that defines this node class or type. More... | |
VuoCompilerBitcodeParser * | parser |
The parser of the LLVM module. More... | |
Friends | |
class | TestVuoCompilerModule |
class | TestModules |
|
protected |
Creates a VuoCompilerModule associated with the given LLVM module, as a pseudo compiler detail class of the given VuoModule.
Definition at line 21 of file VuoCompilerModule.cc.
|
virtual |
Destructor.
Definition at line 42 of file VuoCompilerModule.cc.
|
static |
Copies the function's header into the LLVM module, if it's not already there.
Use this when an LLVM module needs to call a function defined in another LLVM module.
Definition at line 255 of file VuoCompilerModule.cc.
VuoCompilerTargetSet VuoCompilerModule::getCompatibleTargets | ( | void | ) |
Returns the set of targets (operating system versions) with which this module is compatible.
Definition at line 289 of file VuoCompilerModule.cc.
|
virtual |
Returns a list of this VuoCompilerModule's dependencies.
Reimplemented in VuoCompilerSpecializedNodeClass.
Definition at line 272 of file VuoCompilerModule.cc.
|
virtual |
Returns the name that would represent this VuoCompilerModule in another VuoCompilerModule's list of dependencies.
Reimplemented in VuoCompilerSpecializedNodeClass.
Definition at line 281 of file VuoCompilerModule.cc.
Module * VuoCompilerModule::getModule | ( | void | ) |
Returns this VuoCompilerModule's LLVM module, which other LLVM modules can link to.
Definition at line 297 of file VuoCompilerModule.cc.
string VuoCompilerModule::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.
Definition at line 330 of file VuoCompilerModule.cc.
VuoModule * VuoCompilerModule::getPseudoBase | ( | void | ) |
Returns the (pseudo) base for this (pseudo) compiler detail class.
Definition at line 305 of file VuoCompilerModule.cc.
|
protectedvirtual |
Returns a list of global variables and functions that may be defined in multiple modules, and thus need to be renamed.
Definition at line 183 of file VuoCompilerModule.cc.
|
staticprotected |
Returns true if the module contains a function or global variable with name nameBeforeCompilation
or with the corresponding mangled name.
Definition at line 210 of file VuoCompilerModule.cc.
bool VuoCompilerModule::isBuiltIn | ( | void | ) |
Returns true if this module is one of the built-in modules distributed with Vuo.
Definition at line 313 of file VuoCompilerModule.cc.
|
protected |
Returns the mangled name for a function or global variable.
Definition at line 193 of file VuoCompilerModule.cc.
|
staticprotected |
Returns the mangled name for a function or global variable.
Definition at line 201 of file VuoCompilerModule.cc.
|
static |
Instantiates a VuoCompilerModule (or child class) corresponding to the type of VuoCompilerModule defined in the LLVM module.
If no type of VuoCompilerModule is defined, returns NULL.
Definition at line 56 of file VuoCompilerModule.cc.
|
protectedvirtual |
Renames globals in the LLVM module that might conflict with other VuoCompilerModules, and parses those globals.
Definition at line 95 of file VuoCompilerModule.cc.
VuoCompilerTargetSet::MacVersion VuoCompilerModule::parseMacVersion | ( | string | version | ) |
Parses a Mac OS version from a string.
If the string doesn't represent a Mac OS version, returns VuoCompilerTargetSet::MacVersion_Any
.
Definition at line 155 of file VuoCompilerModule.cc.
|
protectedvirtual |
Parses the metadata of this VuoCompilerModule (name, description, ...) from the LLVM module.
Definition at line 105 of file VuoCompilerModule.cc.
VuoCompilerTargetSet VuoCompilerModule::parseTargetSet | ( | json_object * | o, |
string | key | ||
) |
Parses the target set value for key in the top level of the JSON object.
If no such value is found, returns an unrestricted target set.
Definition at line 131 of file VuoCompilerModule.cc.
|
protected |
Renames the global variables and functions within the LLVM module so that they are unique to this VuoCompilerModule.
Definition at line 220 of file VuoCompilerModule.cc.
void VuoCompilerModule::setBuiltIn | ( | bool | builtIn | ) |
Sets whether this module is one of the built-in modules distributed with Vuo.
Definition at line 321 of file VuoCompilerModule.cc.
|
protected |
The dependencies found in this module's metadata.
Definition at line 34 of file VuoCompilerModule.hh.
|
protected |
The LLVM module that defines this node class or type.
Definition at line 35 of file VuoCompilerModule.hh.
|
protected |
This module's metadata, found in the argument to VuoModuleMetadata
in the module definition.
Definition at line 33 of file VuoCompilerModule.hh.
|
protected |
The parser of the LLVM module.
Definition at line 36 of file VuoCompilerModule.hh.