30 this->builtIn =
false;
60 if (isModule(
module, moduleKey))
74 m->modulePath = modulePath;
76 else if (moduleKey !=
"libmodule")
77 VUserLog(
"Warning: No VuoModuleMetadata found in \"%s\" so I'm not going to load it.", moduleKey.c_str());
86 bool VuoCompilerModule::isModule(Module *module,
string moduleKey)
109 moduleDetails = json_tokener_parse(moduleDetailsStr.c_str());
113 VUserLog(
"Error: Couldn't parse VuoModuleMetadata as JSON: %s", moduleDetailsStr.c_str());
122 dependencies = set<string>(dependenciesVector.begin(), dependenciesVector.end());
135 if (json_object_object_get_ex(o, key.c_str(), &operatingSystemsObject))
137 if (json_object_get_type(operatingSystemsObject) == json_type_object)
140 if (json_object_object_get_ex(operatingSystemsObject,
"macosx", &macosObject))
157 if (version ==
"10.11")
158 return VuoCompilerTargetSet::MacVersion_10_11;
159 if (version ==
"10.12")
160 return VuoCompilerTargetSet::MacVersion_10_12;
161 if (version ==
"10.13")
162 return VuoCompilerTargetSet::MacVersion_10_13;
163 if (version ==
"10.14")
164 return VuoCompilerTargetSet::MacVersion_10_14;
165 if (version ==
"10.15")
166 return VuoCompilerTargetSet::MacVersion_10_15;
167 if (version ==
"11.0")
168 return VuoCompilerTargetSet::MacVersion_11_0;
170 return VuoCompilerTargetSet::MacVersion_Any;
180 globals.insert(
"moduleDetails");
206 string nameAfterCompilation =
nameForGlobal(nameBeforeCompilation, moduleKey);
207 return (
module->getNamedValue(nameBeforeCompilation) != NULL ||
module->getNamedValue(nameAfterCompilation) != NULL);
218 Module::GlobalListType& globals =
module->getGlobalList();
221 for (Module::GlobalListType::iterator i = globals.begin(), e = globals.end(); i != e; ++i) {
222 string curGlobalVarName = i->getName();
224 if (globalsAndFuncsToRename.find(curGlobalVarName) != globalsAndFuncsToRename.end()) {
226 i->setName(newGlobalVarName);
231 Module::FunctionListType& functions =
module->getFunctionList();
234 for (Module::FunctionListType::iterator i = functions.begin(), e = functions.end(); i != e; ++i) {
235 string curFuncName = i->getName();
237 if (globalsAndFuncsToRename.find(curFuncName) != globalsAndFuncsToRename.end()) {
239 i->setName(newFuncName);
251 Function *functionDst =
module->getFunction(functionSrc->getName());
254 functionDst = Function::Create(functionSrc->getFunctionType(),
255 GlobalValue::ExternalLinkage,
256 functionSrc->getName(),
258 functionDst->setAttributes( functionSrc->getAttributes() );
285 return compatibleTargets;
317 this->builtIn = builtIn;