zig/deps/lld/wasm/Config.h

82 lines
2.1 KiB
C
Raw Normal View History

2018-01-18 06:29:21 +08:00
//===- Config.h -------------------------------------------------*- C++ -*-===//
//
2019-08-04 00:43:55 +08:00
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2018-01-18 06:29:21 +08:00
//
//===----------------------------------------------------------------------===//
#ifndef LLD_WASM_CONFIG_H
#define LLD_WASM_CONFIG_H
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/BinaryFormat/Wasm.h"
2018-08-05 05:47:16 +08:00
#include "llvm/Support/CachePruning.h"
2018-01-18 06:29:21 +08:00
namespace lld {
namespace wasm {
2019-08-04 00:43:55 +08:00
// This struct contains the global configuration for the linker.
// Most fields are direct mapping from the command line options
// and such fields have the same name as the corresponding options.
// Most fields are initialized by the driver.
2018-01-18 06:29:21 +08:00
struct Configuration {
2019-08-04 00:43:55 +08:00
bool allowUndefined;
bool checkFeatures;
bool compressRelocations;
bool demangle;
bool disableVerify;
bool emitRelocs;
bool exportAll;
bool exportDynamic;
bool exportTable;
bool gcSections;
bool importMemory;
bool sharedMemory;
bool passiveSegments;
bool importTable;
bool mergeDataSegments;
bool pie;
bool printGcSections;
bool relocatable;
bool saveTemps;
bool shared;
bool stripAll;
bool stripDebug;
bool stackFirst;
bool trace;
uint32_t globalBase;
uint32_t initialMemory;
uint32_t maxMemory;
uint32_t zStackSize;
unsigned ltoPartitions;
unsigned ltoo;
unsigned optimize;
unsigned thinLTOJobs;
llvm::StringRef entry;
llvm::StringRef outputFile;
llvm::StringRef thinLTOCacheDir;
llvm::StringSet<> allowUndefinedSymbols;
llvm::StringSet<> exportedSymbols;
std::vector<llvm::StringRef> searchPaths;
llvm::CachePruningPolicy thinLTOCachePolicy;
llvm::Optional<std::vector<std::string>> features;
2018-01-18 06:29:21 +08:00
2019-08-04 00:43:55 +08:00
// The following config options do not directly correspond to any
// particualr command line options.
2019-02-08 06:07:18 +08:00
// True if we are creating position-independent code.
2019-08-04 00:43:55 +08:00
bool isPic;
2018-01-18 06:29:21 +08:00
};
// The only instance of Configuration struct.
2019-08-04 00:43:55 +08:00
extern Configuration *config;
2018-01-18 06:29:21 +08:00
} // namespace wasm
} // namespace lld
#endif