1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/include/llvm/Object/COFFModuleDefinition.h
Saleem Abdulrasool a0ad631f4e Object: preserve more information about DEF file
Preserve the actual library name as provided by the user.  This is
required to properly replicate link's behaviour about the module import
name handling.  This requires an associated change to lld for updating
the tests for the proper behaviour for the import library module name
handling in various cases.

Associated tests will be part of the lld change.

llvm-svn: 308406
2017-07-19 02:01:22 +00:00

54 lines
1.7 KiB
C++

//===--- COFFModuleDefinition.h ---------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Windows-specific.
// A parser for the module-definition file (.def file).
// Parsed results are directly written to Config global variable.
//
// The format of module-definition files are described in this document:
// https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_OBJECT_COFF_MODULE_DEFINITION_H
#define LLVM_OBJECT_COFF_MODULE_DEFINITION_H
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFImportFile.h"
namespace llvm {
namespace object {
struct COFFModuleDefinition {
std::vector<COFFShortExport> Exports;
std::string OutputFile;
std::string ImportName;
uint64_t ImageBase = 0;
uint64_t StackReserve = 0;
uint64_t StackCommit = 0;
uint64_t HeapReserve = 0;
uint64_t HeapCommit = 0;
uint32_t MajorImageVersion = 0;
uint32_t MinorImageVersion = 0;
uint32_t MajorOSVersion = 0;
uint32_t MinorOSVersion = 0;
};
// mingw and wine def files do not mangle _ for x86 which
// is a consequence of legacy binutils' dlltool functionality.
// This MingwDef flag should be removed once mingw stops this pratice.
Expected<COFFModuleDefinition>
parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine,
bool MingwDef = false);
} // End namespace object.
} // End namespace llvm.
#endif