| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 1 | //===- 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 Ueyama | 3d3e6fb | 2015-05-29 16:06:00 +0000 | [diff] [blame] | 14 | #include "llvm/Object/COFF.h" |
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 15 | #include <cstdint> |
| 16 | #include <set> |
| 17 | #include <string> |
| 18 | |
| 19 | namespace lld { |
| 20 | namespace coff { |
| 21 | |
| 22 | class Configuration { |
| 23 | public: |
| Rui Ueyama | 3d3e6fb | 2015-05-29 16:06:00 +0000 | [diff] [blame] | 24 | llvm::COFF::MachineTypes MachineType = llvm::COFF::IMAGE_FILE_MACHINE_AMD64; |
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 25 | bool Verbose = false; |
| 26 | std::string EntryName = "mainCRTStartup"; |
| Rui Ueyama | b41b7e5 | 2015-05-29 16:21:11 +0000 | [diff] [blame] | 27 | |
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 28 | uint64_t ImageBase = 0x140000000; |
| Rui Ueyama | b41b7e5 | 2015-05-29 16:21:11 +0000 | [diff] [blame] | 29 | uint64_t StackReserve = 1024 * 1024; |
| 30 | uint64_t StackCommit = 4096; |
| Rui Ueyama | c377e9a | 2015-05-29 16:23:40 +0000 | [diff] [blame] | 31 | uint64_t HeapReserve = 1024 * 1024; |
| 32 | uint64_t HeapCommit = 4096; |
| Rui Ueyama | b9dcdb5 | 2015-05-29 16:28:29 +0000 | [diff] [blame^] | 33 | uint32_t MajorImageVersion = 0; |
| 34 | uint32_t MinorImageVersion = 0; |
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 35 | |
| 36 | bool insertFile(llvm::StringRef Path) { |
| 37 | return VisitedFiles.insert(Path.lower()).second; |
| 38 | } |
| 39 | |
| 40 | private: |
| 41 | std::set<std::string> VisitedFiles; |
| 42 | }; |
| 43 | |
| 44 | extern Configuration *Config; |
| 45 | |
| 46 | } // namespace coff |
| 47 | } // namespace lld |
| 48 | |
| 49 | #endif |