1 //===--- COFFModuleDefinition.h ---------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 // A parser for the module-definition file (.def file).
12 // Parsed results are directly written to Config global variable.
14 // The format of module-definition files are described in this document:
15 // https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
17 //===----------------------------------------------------------------------===//
19 #ifndef LLVM_OBJECT_COFF_MODULE_DEFINITION_H
20 #define LLVM_OBJECT_COFF_MODULE_DEFINITION_H
22 #include "llvm/Object/COFF.h"
23 #include "llvm/Object/COFFImportFile.h"
28 struct COFFModuleDefinition {
29 std::vector<COFFShortExport> Exports;
30 std::string OutputFile;
31 std::string ImportName;
32 uint64_t ImageBase = 0;
33 uint64_t StackReserve = 0;
34 uint64_t StackCommit = 0;
35 uint64_t HeapReserve = 0;
36 uint64_t HeapCommit = 0;
37 uint32_t MajorImageVersion = 0;
38 uint32_t MinorImageVersion = 0;
39 uint32_t MajorOSVersion = 0;
40 uint32_t MinorOSVersion = 0;
43 // mingw and wine def files do not mangle _ for x86 which
44 // is a consequence of legacy binutils' dlltool functionality.
45 // This MingwDef flag should be removed once mingw stops this pratice.
46 Expected<COFFModuleDefinition>
47 parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine,
48 bool MingwDef = false);
50 } // End namespace object.
51 } // End namespace llvm.