llvm::Constant* embedRelocatablePtr(const void* addr, llvm::Type* type, llvm::StringRef shared_name) { assert(addr); if (!ENABLE_JIT_OBJECT_CACHE) return embedConstantPtr(addr, type); std::string name; if (!shared_name.empty()) { llvm::GlobalVariable* gv = g.cur_module->getGlobalVariable(shared_name, true); if (gv) return gv; assert(!relocatable_syms.count(name)); name = shared_name; } else { name = (llvm::Twine("c") + llvm::Twine(relocatable_syms.size())).str(); } relocatable_syms[name] = addr; llvm::Type* var_type = type->getPointerElementType(); return new llvm::GlobalVariable(*g.cur_module, var_type, true, llvm::GlobalVariable::ExternalLinkage, 0, name); }
size_t size() const { return UniqueDirs.size(); }
size_t size() const { return UniqueFiles.size(); }
size_t size() { return UniqueFiles.size(); }
size_t size() { return UniqueDirs.size(); }