blob: 0cdc7738b6cd1f284957d45781a019ff9a9b6006 [file] [log] [blame]
Rui Ueyama411c63602015-05-28 19:09:30 +00001//===- Config.h -----------------------------------------------------------===//
2//
3// The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLD_COFF_CONFIG_H
11#define LLD_COFF_CONFIG_H
12
13#include "llvm/ADT/StringRef.h"
Rui Ueyama3d3e6fb2015-05-29 16:06:00 +000014#include "llvm/Object/COFF.h"
Rui Ueyama411c63602015-05-28 19:09:30 +000015#include <cstdint>
16#include <set>
17#include <string>
18
19namespace lld {
20namespace coff {
21
22class Configuration {
23public:
Rui Ueyama3d3e6fb2015-05-29 16:06:00 +000024 llvm::COFF::MachineTypes MachineType = llvm::COFF::IMAGE_FILE_MACHINE_AMD64;
Rui Ueyama411c63602015-05-28 19:09:30 +000025 bool Verbose = false;
26 std::string EntryName = "mainCRTStartup";
Rui Ueyamab41b7e52015-05-29 16:21:11 +000027
Rui Ueyama411c63602015-05-28 19:09:30 +000028 uint64_t ImageBase = 0x140000000;
Rui Ueyamab41b7e52015-05-29 16:21:11 +000029 uint64_t StackReserve = 1024 * 1024;
30 uint64_t StackCommit = 4096;
Rui Ueyamac377e9a2015-05-29 16:23:40 +000031 uint64_t HeapReserve = 1024 * 1024;
32 uint64_t HeapCommit = 4096;
Rui Ueyamab9dcdb52015-05-29 16:28:29 +000033 uint32_t MajorImageVersion = 0;
34 uint32_t MinorImageVersion = 0;
Rui Ueyama411c63602015-05-28 19:09:30 +000035
36 bool insertFile(llvm::StringRef Path) {
37 return VisitedFiles.insert(Path.lower()).second;
38 }
39
40private:
41 std::set<std::string> VisitedFiles;
42};
43
44extern Configuration *Config;
45
46} // namespace coff
47} // namespace lld
48
49#endif