This commit is contained in:
Ivan 2017-11-09 22:12:20 +03:00
parent 911cf5bfdc
commit adca0a4ca8

View file

@ -26,7 +26,7 @@
namespace { namespace {
const char *RuntimeCompileModulesHeadName = "dynamiccompile_modules_head"; const char *DynamicCompileModulesHeadName = "dynamiccompile_modules_head";
llvm::GlobalValue *getPredefinedSymbol(llvm::Module &module, llvm::GlobalValue *getPredefinedSymbol(llvm::Module &module,
llvm::StringRef name, llvm::Type *type) { llvm::StringRef name, llvm::Type *type) {
@ -608,17 +608,17 @@ llvm::GlobalVariable *declareModListHead(llvm::Module &module,
const Types &types) { const Types &types) {
auto type = getModListHeadType(module.getContext(), types); auto type = getModListHeadType(module.getContext(), types);
// auto existingVar = // auto existingVar =
// module.getGlobalVariable(RuntimeCompileModulesHeadName); if (nullptr != // module.getGlobalVariable(DynamicCompileModulesHeadName); if (nullptr !=
// existingVar) { // existingVar) {
// if (type != existingVar->getType()) { // if (type != existingVar->getType()) {
// error(Loc(), "Invalid RuntimeCompileModulesHeadName type"); // error(Loc(), "Invalid DynamicCompileModulesHeadName type");
// fatal(); // fatal();
// } // }
// return existingVar; // return existingVar;
// } // }
return new llvm::GlobalVariable(module, type, false, return new llvm::GlobalVariable(module, type, false,
llvm::GlobalValue::ExternalLinkage, nullptr, llvm::GlobalValue::ExternalLinkage, nullptr,
RuntimeCompileModulesHeadName); DynamicCompileModulesHeadName);
} }
void generateCtorBody(IRState *irs, const Types &types, llvm::Function *func, void generateCtorBody(IRState *irs, const Types &types, llvm::Function *func,