| 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 |  | 
| Rui Ueyama | 15cc47e | 2015-05-29 16:34:31 +0000 | [diff] [blame] | 22 | using llvm::COFF::WindowsSubsystem; | 
|  | 23 |  | 
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 24 | class Configuration { | 
|  | 25 | public: | 
| Rui Ueyama | 3d3e6fb | 2015-05-29 16:06:00 +0000 | [diff] [blame] | 26 | llvm::COFF::MachineTypes MachineType = llvm::COFF::IMAGE_FILE_MACHINE_AMD64; | 
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 27 | bool Verbose = false; | 
| Rui Ueyama | 3ee0fe4 | 2015-05-31 03:55:46 +0000 | [diff] [blame^] | 28 | WindowsSubsystem Subsystem = llvm::COFF::IMAGE_SUBSYSTEM_UNKNOWN; | 
| Rui Ueyama | 5cff685 | 2015-05-31 03:34:08 +0000 | [diff] [blame] | 29 | std::string EntryName; | 
| Rui Ueyama | b41b7e5 | 2015-05-29 16:21:11 +0000 | [diff] [blame] | 30 |  | 
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 31 | uint64_t ImageBase = 0x140000000; | 
| Rui Ueyama | b41b7e5 | 2015-05-29 16:21:11 +0000 | [diff] [blame] | 32 | uint64_t StackReserve = 1024 * 1024; | 
|  | 33 | uint64_t StackCommit = 4096; | 
| Rui Ueyama | c377e9a | 2015-05-29 16:23:40 +0000 | [diff] [blame] | 34 | uint64_t HeapReserve = 1024 * 1024; | 
|  | 35 | uint64_t HeapCommit = 4096; | 
| Rui Ueyama | b9dcdb5 | 2015-05-29 16:28:29 +0000 | [diff] [blame] | 36 | uint32_t MajorImageVersion = 0; | 
|  | 37 | uint32_t MinorImageVersion = 0; | 
| Rui Ueyama | 15cc47e | 2015-05-29 16:34:31 +0000 | [diff] [blame] | 38 | uint32_t MajorOSVersion = 6; | 
|  | 39 | uint32_t MinorOSVersion = 0; | 
| Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 +0000 | [diff] [blame] | 40 |  | 
|  | 41 | bool insertFile(llvm::StringRef Path) { | 
|  | 42 | return VisitedFiles.insert(Path.lower()).second; | 
|  | 43 | } | 
|  | 44 |  | 
|  | 45 | private: | 
|  | 46 | std::set<std::string> VisitedFiles; | 
|  | 47 | }; | 
|  | 48 |  | 
|  | 49 | extern Configuration *Config; | 
|  | 50 |  | 
|  | 51 | } // namespace coff | 
|  | 52 | } // namespace lld | 
|  | 53 |  | 
|  | 54 | #endif |