reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

Declarations

tools/lld/wasm/Config.h
   82 extern Configuration *config;

References

tools/lld/wasm/Driver.cpp
   89   config = make<Configuration>();
  185       config->allowUndefinedSymbols.insert(sym);
  260   for (StringRef dir : config->searchPaths) {
  305   config->allowUndefined = args.hasArg(OPT_allow_undefined);
  306   config->checkFeatures =
  308   config->compressRelocations = args.hasArg(OPT_compress_relocations);
  309   config->demangle = args.hasFlag(OPT_demangle, OPT_no_demangle, true);
  310   config->disableVerify = args.hasArg(OPT_disable_verify);
  311   config->emitRelocs = args.hasArg(OPT_emit_relocs);
  312   config->entry = getEntry(args);
  313   config->exportAll = args.hasArg(OPT_export_all);
  314   config->exportTable = args.hasArg(OPT_export_table);
  315   config->growableTable = args.hasArg(OPT_growable_table);
  318   config->importMemory = args.hasArg(OPT_import_memory);
  319   config->sharedMemory = args.hasArg(OPT_shared_memory);
  320   config->importTable = args.hasArg(OPT_import_table);
  321   config->ltoo = args::getInteger(args, OPT_lto_O, 2);
  322   config->ltoPartitions = args::getInteger(args, OPT_lto_partitions, 1);
  323   config->optimize = args::getInteger(args, OPT_O, 0);
  324   config->outputFile = args.getLastArgValue(OPT_o);
  325   config->relocatable = args.hasArg(OPT_relocatable);
  326   config->gcSections =
  327       args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, !config->relocatable);
  328   config->mergeDataSegments =
  330                    !config->relocatable);
  331   config->pie = args.hasFlag(OPT_pie, OPT_no_pie, false);
  332   config->printGcSections =
  334   config->saveTemps = args.hasArg(OPT_save_temps);
  335   config->searchPaths = args::getStrings(args, OPT_L);
  336   config->shared = args.hasArg(OPT_shared);
  337   config->stripAll = args.hasArg(OPT_strip_all);
  338   config->stripDebug = args.hasArg(OPT_strip_debug);
  339   config->stackFirst = args.hasArg(OPT_stack_first);
  340   config->trace = args.hasArg(OPT_trace);
  341   config->thinLTOCacheDir = args.getLastArgValue(OPT_thinlto_cache_dir);
  342   config->thinLTOCachePolicy = CHECK(
  345   config->thinLTOJobs = args::getInteger(args, OPT_thinlto_jobs, -1u);
  350   config->initialMemory = args::getInteger(args, OPT_initial_memory, 0);
  351   config->globalBase = args::getInteger(args, OPT_global_base, 1024);
  352   config->maxMemory = args::getInteger(args, OPT_max_memory, 0);
  353   config->zStackSize =
  357   config->exportDynamic =
  358       args.hasFlag(OPT_export_dynamic, OPT_no_export_dynamic, config->shared);
  361     config->features =
  364       config->features->push_back(s);
  373   config->isPic = config->pie || config->shared;
  373   config->isPic = config->pie || config->shared;
  373   config->isPic = config->pie || config->shared;
  375   if (config->isPic) {
  376     if (config->exportTable)
  378     config->importTable = true;
  381   if (config->shared) {
  382     config->importMemory = true;
  383     config->allowUndefined = true;
  390   if (!config->stripDebug && !config->stripAll && config->compressRelocations)
  390   if (!config->stripDebug && !config->stripAll && config->compressRelocations)
  390   if (!config->stripDebug && !config->stripAll && config->compressRelocations)
  394   if (config->ltoo > 3)
  395     error("invalid optimization level for LTO: " + Twine(config->ltoo));
  396   if (config->ltoPartitions == 0)
  398   if (config->thinLTOJobs == 0)
  401   if (config->pie && config->shared)
  401   if (config->pie && config->shared)
  404   if (config->outputFile.empty())
  407   if (config->importTable && config->exportTable)
  407   if (config->importTable && config->exportTable)
  410   if (config->relocatable) {
  411     if (!config->entry.empty())
  413     if (config->gcSections)
  415     if (config->compressRelocations)
  419     if (config->pie)
  444   config->allowUndefinedSymbols.insert(sym->getName());
  462   if (config->relocatable)
  474   if (config->isPic) {
  483   if (config->isPic) {
  502   if (config->sharedMemory && !config->shared) {
  502   if (config->sharedMemory && !config->shared) {
  522   if (config->relocatable)
  527   if (!config->shared)
  530   if (!config->isPic) {
  703     config->exportedSymbols.insert(arg->getValue());
  728   if (!config->relocatable && !config->entry.empty()) {
  728   if (!config->relocatable && !config->entry.empty()) {
  729     entrySym = handleUndefined(config->entry);
  734             config->entry);
  765     else if (!config->allowUndefined)
  770   if (!config->relocatable) {
tools/lld/wasm/InputChunks.cpp
  228   if (!file || !config->compressRelocations)
  263   if (!file || !config->compressRelocations)
tools/lld/wasm/InputChunks.h
   72       : file(f), live(!config->gcSections), discarded(false), sectionKind(k) {}
  137     if (config->compressRelocations && file) {
  164     assert(!config->compressRelocations);
tools/lld/wasm/InputEvent.h
   32       : file(f), event(e), signature(s), live(!config->gcSections) {}
tools/lld/wasm/InputFiles.cpp
  184       index -= config->tableBase;
tools/lld/wasm/InputGlobal.h
   26       : file(f), global(g), live(!config->gcSections) {}
tools/lld/wasm/LTO.cpp
   50   c.DisableVerify = config->disableVerify;
   52   c.OptLevel = config->ltoo;
   54   c.CGOptLevel = args::getCGOptLevel(config->ltoo);
   56   if (config->relocatable)
   58   else if (config->isPic)
   63   if (config->saveTemps)
   64     checkError(c.addSaveTemps(config->outputFile.str() + ".",
   68   if (config->thinLTOJobs != -1U)
   69     backend = lto::createInProcessThinBackend(config->thinLTOJobs);
   71                                      config->ltoPartitions);
  106     r.VisibleToRegularObj = config->relocatable || sym->isUsedInRegularObj ||
  131   if (!config->thinLTOCacheDir.empty())
  133         lto::localCache(config->thinLTOCacheDir,
  145   if (!config->thinLTOCacheDir.empty())
  146     pruneCache(config->thinLTOCacheDir, config->thinLTOCachePolicy);
  146     pruneCache(config->thinLTOCacheDir, config->thinLTOCachePolicy);
  152     if (config->saveTemps) {
  154         saveBuffer(buf[i], config->outputFile + ".lto.o");
  156         saveBuffer(buf[i], config->outputFile + Twine(i) + ".lto.o");
tools/lld/wasm/MarkLive.cpp
   66     if (config->isPic)
   81   if (!config->entry.empty())
   82     enqueue(symtab->find(config->entry));
   90   if (config->relocatable) {
   98   if (config->isPic)
  101   if (config->sharedMemory && !config->shared)
  101   if (config->sharedMemory && !config->shared)
  137   if (!config->gcSections)
  146   if (config->printGcSections) {
tools/lld/wasm/OutputSections.cpp
  139   assert((!config->isPic || segments.size() <= 1) &&
  151       if (config->isPic) {
tools/lld/wasm/Relocations.cpp
   20   return config->isPic && !sym->isHidden() && !sym->isLocal();
   31   return (config->allowUndefined ||
   32           config->allowUndefinedSymbols.count(sym->getName()) != 0);
   50   if (config->isPic)
   87     if (config->isPic) {
  109       if (sym->isUndefined() && !config->relocatable && !sym->isWeak())
tools/lld/wasm/SymbolTable.cpp
   44   if (config->trace)
  211   if (!s && (config->exportAll || config->exportedSymbols.count(name) != 0))
  211   if (!s && (config->exportAll || config->exportedSymbols.count(name) != 0))
tools/lld/wasm/Symbols.cpp
   31   if (wasm::config->demangle)
  153   if (config->isPic) {
  186   if (forceExport || config->exportAll)
  189   if (config->exportDynamic && !isHidden())
tools/lld/wasm/Symbols.h
  127         referenced(!config->gcSections), requiresGOT(false),
tools/lld/wasm/SyntheticSections.cpp
   97   if (config->importMemory)
   99   if (config->importTable)
  129   if (config->importMemory) {
  136     if (out.memorySec->maxMemoryPages != 0 || config->sharedMemory) {
  140     if (config->sharedMemory)
  145   if (config->importTable) {
  146     uint32_t tableSize = config->tableBase + out.elemSec->numEntries();
  215   uint32_t tableSize = config->tableBase + out.elemSec->numEntries();
  220   if (config->growableTable)
  230   bool hasMax = maxMemoryPages != 0 || config->sharedMemory;
  235   if (config->sharedMemory)
  329   return !config->relocatable && numSegments && config->sharedMemory;
  329   return !config->relocatable && numSegments && config->sharedMemory;
  340   sym->setTableIndex(config->tableBase + indirectFunctions.size());
  350   if (config->isPic) {
  355     initExpr.Value.Int32 = config->tableBase;
  360   uint32_t tableIndex = config->tableBase;
  379   return numSegments && config->sharedMemory;
tools/lld/wasm/SyntheticSections.h
   78   bool isNeeded() const override { return config->isPic; }
  148   bool isNeeded() const override { return !config->importMemory; }
  168     return !config->importTable;
  270     return config->relocatable || config->emitRelocs;
  270     return config->relocatable || config->emitRelocs;
  287     return !config->stripDebug && !config->stripAll && numNames() > 0;
  287     return !config->stripDebug && !config->stripAll && numNames() > 0;
  298     return !config->stripAll && fieldCount() > 0;
  317     return !config->stripAll && features.size() > 0;
tools/lld/wasm/Writer.cpp
  108   bool stripDebug = config->stripDebug || config->stripAll;
  108   bool stripDebug = config->stripDebug || config->stripAll;
  132     if (config->relocatable || config->emitRelocs) {
  132     if (config->relocatable || config->emitRelocs) {
  207     if (config->relocatable || config->isPic)
  207     if (config->relocatable || config->isPic)
  210     if (config->zStackSize != alignTo(config->zStackSize, stackAlignment))
  210     if (config->zStackSize != alignTo(config->zStackSize, stackAlignment))
  212     log("mem: stack size  = " + Twine(config->zStackSize));
  214     memoryPtr += config->zStackSize;
  220   if (config->stackFirst) {
  223     memoryPtr = config->globalBase;
  224     log("mem: global base = " + Twine(config->globalBase));
  271   if (config->shared) {
  276   if (!config->stackFirst)
  286   if (config->initialMemory != 0) {
  287     if (config->initialMemory != alignTo(config->initialMemory, WasmPageSize))
  287     if (config->initialMemory != alignTo(config->initialMemory, WasmPageSize))
  289     if (memoryPtr > config->initialMemory)
  292       memoryPtr = config->initialMemory;
  300   if (config->maxMemory != 0 || config->sharedMemory) {
  300   if (config->maxMemory != 0 || config->sharedMemory) {
  301     if (config->maxMemory != alignTo(config->maxMemory, WasmPageSize))
  301     if (config->maxMemory != alignTo(config->maxMemory, WasmPageSize))
  303     if (memoryPtr > config->maxMemory)
  305     out.memorySec->maxMemoryPages = config->maxMemory / WasmPageSize;
  354   if (config->emitRelocs || config->relocatable) {
  354   if (config->emitRelocs || config->relocatable) {
  379   bool inferFeatures = !config->features.hasValue();
  382     auto &explicitFeatures = config->features.getValue();
  384     if (!config->checkFeatures)
  422   if (allowed.count("atomics") && !config->sharedMemory) {
  430   if (!config->checkFeatures)
  433   if (disallowed.count("atomics") && config->sharedMemory)
  437   if (!allowed.count("atomics") && config->sharedMemory)
  441   if (!allowed.count("bulk-memory") && config->sharedMemory)
  484     if (sym->isWeak() && !config->relocatable)
  501   if (config->relocatable)
  504   if (!config->relocatable && !config->importMemory)
  504   if (!config->relocatable && !config->importMemory)
  508   if (!config->relocatable && config->exportTable)
  508   if (!config->relocatable && config->exportTable)
  549   if (!config->relocatable && !config->emitRelocs)
  549   if (!config->relocatable && !config->emitRelocs)
  640   if (config->isPic)
  647   if (!config->mergeDataSegments)
  670         if (config->sharedMemory || name == ".tdata")
  676         if (!config->importMemory && !config->relocatable &&
  676         if (!config->importMemory && !config->relocatable &&
  870     if (config->isPic) {
  933   if (!config->relocatable && !WasmSym::callCtors->isLive())
  979   if (config->relocatable || config->isPic)
  979   if (config->relocatable || config->isPic)
  980     config->globalBase = 0;
  984   if (!config->isPic) {
  985     config->tableBase = 1;
  987       WasmSym::definedTableBase->setVirtualAddress(config->tableBase);
 1003   if (!config->relocatable) {
 1017   if (!config->relocatable) {
 1019     if (config->sharedMemory)
 1021     if (config->isPic)
 1026   if (!config->relocatable && config->sharedMemory && !config->shared)
 1026   if (!config->relocatable && config->sharedMemory && !config->shared)
 1026   if (!config->relocatable && config->sharedMemory && !config->shared)
 1077   log("writing: " + config->outputFile);
 1080       FileOutputBuffer::create(config->outputFile, fileSize,
 1084     error("failed to open " + config->outputFile + ": " +