llvm::GlobalVariable *Property::GetMemberInfo() { if(!propertyInfo) { // Only create the property info variable when reflection is enabled. Module *module = GetModule(); if(!module->HasReflection()) return NULL; // Get the property info class. VirtualMachine *vm = module->GetVirtualMachine(); Class *propInfoClass = vm->GetPropertyInfoClass(); llvm::Module *targetModule = module->GetTargetModule(); propertyInfo = new llvm::GlobalVariable(*targetModule, propInfoClass->GetTargetType(), false, ComputeMetadataLinkage(), NULL, GetMangledName() + "_propinfo_"); } return propertyInfo; }
Module* VirtualMachine::LoadModule(ModuleReader &reader, bool noreflection, bool debug, std::string *libPaths, size_t libPathCount) { // Create the module. Module *ret = new Module(this, noreflection, debug); // Add library paths. for(size_t i = 0; i < libPathCount; ++i) ret->AddLibraryPath(libPaths[i]); // Load from file. ret->LoadFromFile(reader); // Load the runtime data. if(loadedModules.size() == 1) LoadRuntimeData(); else executionEngine->addModule(ret->GetTargetModule()); return ret; }