2015-05-29 03:09:30 +08:00
|
|
|
//===- Config.h -----------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Linker
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLD_COFF_CONFIG_H
|
|
|
|
#define LLD_COFF_CONFIG_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
2015-05-30 00:06:00 +08:00
|
|
|
#include "llvm/Object/COFF.h"
|
2015-05-29 03:09:30 +08:00
|
|
|
#include <cstdint>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace lld {
|
|
|
|
namespace coff {
|
|
|
|
|
2015-05-30 00:34:31 +08:00
|
|
|
using llvm::COFF::WindowsSubsystem;
|
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
class Configuration {
|
|
|
|
public:
|
2015-05-30 00:06:00 +08:00
|
|
|
llvm::COFF::MachineTypes MachineType = llvm::COFF::IMAGE_FILE_MACHINE_AMD64;
|
2015-05-29 03:09:30 +08:00
|
|
|
bool Verbose = false;
|
2015-05-30 00:34:31 +08:00
|
|
|
WindowsSubsystem Subsystem = llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI;
|
2015-05-31 11:34:08 +08:00
|
|
|
std::string EntryName;
|
2015-05-30 00:21:11 +08:00
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
uint64_t ImageBase = 0x140000000;
|
2015-05-30 00:21:11 +08:00
|
|
|
uint64_t StackReserve = 1024 * 1024;
|
|
|
|
uint64_t StackCommit = 4096;
|
2015-05-30 00:23:40 +08:00
|
|
|
uint64_t HeapReserve = 1024 * 1024;
|
|
|
|
uint64_t HeapCommit = 4096;
|
2015-05-30 00:28:29 +08:00
|
|
|
uint32_t MajorImageVersion = 0;
|
|
|
|
uint32_t MinorImageVersion = 0;
|
2015-05-30 00:34:31 +08:00
|
|
|
uint32_t MajorOSVersion = 6;
|
|
|
|
uint32_t MinorOSVersion = 0;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
bool insertFile(llvm::StringRef Path) {
|
|
|
|
return VisitedFiles.insert(Path.lower()).second;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::set<std::string> VisitedFiles;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Configuration *Config;
|
|
|
|
|
|
|
|
} // namespace coff
|
|
|
|
} // namespace lld
|
|
|
|
|
|
|
|
#endif
|