2015-08-14 22:12:54 +08:00
|
|
|
//===- InputFiles.h ---------------------------------------------*- C++ -*-===//
|
2015-05-29 03:09:30 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-05-29 03:09:30 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLD_COFF_INPUT_FILES_H
|
|
|
|
#define LLD_COFF_INPUT_FILES_H
|
|
|
|
|
2017-05-25 06:30:06 +08:00
|
|
|
#include "Config.h"
|
2017-10-03 05:00:41 +08:00
|
|
|
#include "lld/Common/LLVM.h"
|
2015-05-29 03:09:30 +08:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
2018-08-07 05:26:09 +08:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2016-12-12 11:16:14 +08:00
|
|
|
#include "llvm/ADT/DenseSet.h"
|
2018-11-06 03:20:47 +08:00
|
|
|
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
|
2017-02-03 07:58:14 +08:00
|
|
|
#include "llvm/LTO/LTO.h"
|
2015-05-29 03:09:30 +08:00
|
|
|
#include "llvm/Object/Archive.h"
|
|
|
|
#include "llvm/Object/COFF.h"
|
2015-06-13 20:50:13 +08:00
|
|
|
#include "llvm/Support/StringSaver.h"
|
2015-05-29 03:09:30 +08:00
|
|
|
#include <memory>
|
|
|
|
#include <set>
|
|
|
|
#include <vector>
|
|
|
|
|
2017-06-13 23:49:13 +08:00
|
|
|
namespace llvm {
|
|
|
|
namespace pdb {
|
|
|
|
class DbiModuleDescriptorBuilder;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
namespace lld {
|
|
|
|
namespace coff {
|
|
|
|
|
2017-08-31 04:55:18 +08:00
|
|
|
std::vector<MemoryBufferRef> getArchiveMembers(llvm::object::Archive *File);
|
|
|
|
|
2015-07-10 03:54:13 +08:00
|
|
|
using llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN;
|
|
|
|
using llvm::COFF::MachineTypes;
|
2015-05-29 03:09:30 +08:00
|
|
|
using llvm::object::Archive;
|
|
|
|
using llvm::object::COFFObjectFile;
|
2015-06-30 02:50:11 +08:00
|
|
|
using llvm::object::COFFSymbolRef;
|
2016-12-10 05:55:24 +08:00
|
|
|
using llvm::object::coff_import_header;
|
2015-07-25 07:51:14 +08:00
|
|
|
using llvm::object::coff_section;
|
2015-06-30 02:50:11 +08:00
|
|
|
|
|
|
|
class Chunk;
|
2015-06-30 06:16:21 +08:00
|
|
|
class Defined;
|
2015-08-17 15:27:45 +08:00
|
|
|
class DefinedImportData;
|
|
|
|
class DefinedImportThunk;
|
2019-02-14 11:16:44 +08:00
|
|
|
class DefinedRegular;
|
2015-07-01 03:35:21 +08:00
|
|
|
class Lazy;
|
2016-11-22 01:22:35 +08:00
|
|
|
class SectionChunk;
|
2017-11-04 05:21:47 +08:00
|
|
|
class Symbol;
|
2015-06-30 06:16:21 +08:00
|
|
|
class Undefined;
|
[LLD][COFF] Early dependency detection
We introduce a new class hierarchy for debug types merging (in DebugTypes.h). The end-goal is to parallelize the type merging - please see the plan in D59226.
Previously, dependency discovery was done on the fly, much later, during the type merging loop. Unfortunately, parallelizing the type merging requires the dependencies to be merged in first, before any dependent ObjFile, thus this early discovery.
The overall intention for this path is to discover debug information dependencies at a much earlier stage, when processing input files. Currently, two types of dependency are supported: PDB type servers (when compiling with MSVC /Zi) and precompiled headers OBJs (when compiling with MSVC /Yc and /Yu). Once discovered, an explicit link is added into the dependent ObjFile, through the new debug types class hierarchy introduced in DebugTypes.h.
Differential Revision: https://reviews.llvm.org/D59053
llvm-svn: 357383
2019-04-01 21:36:59 +08:00
|
|
|
class TpiSource;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
// The root class of input files.
|
|
|
|
class InputFile {
|
|
|
|
public:
|
2015-06-02 04:10:10 +08:00
|
|
|
enum Kind { ArchiveKind, ObjectKind, ImportKind, BitcodeKind };
|
2015-05-29 03:09:30 +08:00
|
|
|
Kind kind() const { return FileKind; }
|
|
|
|
virtual ~InputFile() {}
|
|
|
|
|
|
|
|
// Returns the filename.
|
2017-12-06 00:50:46 +08:00
|
|
|
StringRef getName() const { return MB.getBufferIdentifier(); }
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2015-08-07 03:57:21 +08:00
|
|
|
// Reads a file (the constructor doesn't do that).
|
2015-08-06 22:58:50 +08:00
|
|
|
virtual void parse() = 0;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2015-07-10 03:54:13 +08:00
|
|
|
// Returns the CPU type this file was compiled to.
|
|
|
|
virtual MachineTypes getMachineType() { return IMAGE_FILE_MACHINE_UNKNOWN; }
|
|
|
|
|
2017-04-22 05:38:01 +08:00
|
|
|
MemoryBufferRef MB;
|
|
|
|
|
2016-12-08 07:17:02 +08:00
|
|
|
// An archive file name if this file is created from an archive.
|
|
|
|
StringRef ParentName;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2015-06-08 14:00:10 +08:00
|
|
|
// Returns .drectve section contents if exist.
|
2019-03-30 05:00:22 +08:00
|
|
|
StringRef getDirectives() { return Directives; }
|
2015-06-08 14:00:10 +08:00
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
protected:
|
2016-12-10 05:55:24 +08:00
|
|
|
InputFile(Kind K, MemoryBufferRef M) : MB(M), FileKind(K) {}
|
2015-07-03 04:33:48 +08:00
|
|
|
|
2019-03-30 05:00:22 +08:00
|
|
|
StringRef Directives;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
const Kind FileKind;
|
|
|
|
};
|
|
|
|
|
|
|
|
// .lib or .a file.
|
|
|
|
class ArchiveFile : public InputFile {
|
|
|
|
public:
|
2016-09-16 06:24:51 +08:00
|
|
|
explicit ArchiveFile(MemoryBufferRef M);
|
2015-05-29 03:09:30 +08:00
|
|
|
static bool classof(const InputFile *F) { return F->kind() == ArchiveKind; }
|
2015-08-06 22:58:50 +08:00
|
|
|
void parse() override;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2016-12-15 12:02:23 +08:00
|
|
|
// Enqueues an archive member load for the given symbol. If we've already
|
|
|
|
// enqueued a load for the same archive member, this function does nothing,
|
|
|
|
// which ensures that we don't load the same member more than once.
|
|
|
|
void addMember(const Archive::Symbol *Sym);
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Archive> File;
|
2016-12-12 11:16:14 +08:00
|
|
|
llvm::DenseSet<uint64_t> Seen;
|
2015-05-29 03:09:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// .obj or .o file. This may be a member of an archive file.
|
2017-07-27 07:05:24 +08:00
|
|
|
class ObjFile : public InputFile {
|
2015-05-29 03:09:30 +08:00
|
|
|
public:
|
2017-07-27 07:05:24 +08:00
|
|
|
explicit ObjFile(MemoryBufferRef M) : InputFile(ObjectKind, M) {}
|
2015-05-29 03:09:30 +08:00
|
|
|
static bool classof(const InputFile *F) { return F->kind() == ObjectKind; }
|
2015-08-06 22:58:50 +08:00
|
|
|
void parse() override;
|
2015-07-10 03:54:13 +08:00
|
|
|
MachineTypes getMachineType() override;
|
2017-12-08 09:09:21 +08:00
|
|
|
ArrayRef<Chunk *> getChunks() { return Chunks; }
|
|
|
|
ArrayRef<SectionChunk *> getDebugChunks() { return DebugChunks; }
|
2018-02-06 09:58:26 +08:00
|
|
|
ArrayRef<SectionChunk *> getSXDataChunks() { return SXDataChunks; }
|
|
|
|
ArrayRef<SectionChunk *> getGuardFidChunks() { return GuardFidChunks; }
|
2018-02-14 04:32:53 +08:00
|
|
|
ArrayRef<SectionChunk *> getGuardLJmpChunks() { return GuardLJmpChunks; }
|
2017-12-08 09:09:21 +08:00
|
|
|
ArrayRef<Symbol *> getSymbols() { return Symbols; }
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2019-02-23 09:46:18 +08:00
|
|
|
ArrayRef<uint8_t> getDebugSection(StringRef SecName);
|
|
|
|
|
2017-11-04 05:21:47 +08:00
|
|
|
// Returns a Symbol object for the SymbolIndex'th symbol in the
|
2015-05-29 03:09:30 +08:00
|
|
|
// underlying object file.
|
2017-11-04 05:21:47 +08:00
|
|
|
Symbol *getSymbol(uint32_t SymbolIndex) {
|
2017-11-21 02:52:53 +08:00
|
|
|
return Symbols[SymbolIndex];
|
2015-06-27 11:40:10 +08:00
|
|
|
}
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2018-11-06 03:20:47 +08:00
|
|
|
// Returns the underlying COFF file.
|
2016-12-09 02:49:04 +08:00
|
|
|
COFFObjectFile *getCOFFObj() { return COFFObj.get(); }
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2019-03-29 02:30:03 +08:00
|
|
|
// Add a symbol for a range extension thunk. Return the new symbol table
|
|
|
|
// index. This index can be used to modify a relocation.
|
|
|
|
uint32_t addRangeThunkSymbol(Symbol *Thunk) {
|
|
|
|
Symbols.push_back(Thunk);
|
|
|
|
return Symbols.size() - 1;
|
|
|
|
}
|
|
|
|
|
2017-07-27 08:45:26 +08:00
|
|
|
static std::vector<ObjFile *> Instances;
|
|
|
|
|
2018-02-06 09:58:26 +08:00
|
|
|
// Flags in the absolute @feat.00 symbol if it is present. These usually
|
|
|
|
// indicate if an object was compiled with certain security features enabled
|
|
|
|
// like stack guard, safeseh, /guard:cf, or other things.
|
|
|
|
uint32_t Feat00Flags = 0;
|
2015-07-25 07:51:14 +08:00
|
|
|
|
2018-02-06 09:58:26 +08:00
|
|
|
// True if this object file is compatible with SEH. COFF-specific and
|
|
|
|
// x86-only. COFF spec 5.10.1. The .sxdata section.
|
|
|
|
bool hasSafeSEH() { return Feat00Flags & 0x1; }
|
|
|
|
|
|
|
|
// True if this file was compiled with /guard:cf.
|
|
|
|
bool hasGuardCF() { return Feat00Flags & 0x800; }
|
2015-07-25 07:51:14 +08:00
|
|
|
|
2017-06-13 23:49:13 +08:00
|
|
|
// Pointer to the PDB module descriptor builder. Various debug info records
|
|
|
|
// will reference object files by "module index", which is here. Things like
|
|
|
|
// source files and section contributions are also recorded here. Will be null
|
|
|
|
// if we are not producing a PDB.
|
|
|
|
llvm::pdb::DbiModuleDescriptorBuilder *ModuleDBI = nullptr;
|
|
|
|
|
2018-08-24 01:44:42 +08:00
|
|
|
const coff_section *AddrsigSec = nullptr;
|
|
|
|
|
2018-11-06 03:20:47 +08:00
|
|
|
// When using Microsoft precompiled headers, this is the PCH's key.
|
|
|
|
// The same key is used by both the precompiled object, and objects using the
|
|
|
|
// precompiled object. Any difference indicates out-of-date objects.
|
2019-01-07 21:53:16 +08:00
|
|
|
llvm::Optional<uint32_t> PCHSignature;
|
2018-11-06 03:20:47 +08:00
|
|
|
|
2019-02-23 09:46:18 +08:00
|
|
|
// Tells whether this file was compiled with /hotpatch
|
|
|
|
bool HotPatchable = false;
|
|
|
|
|
2019-03-23 06:07:27 +08:00
|
|
|
// Whether the object was already merged into the final PDB or not
|
|
|
|
bool MergedIntoPDB = false;
|
|
|
|
|
[LLD][COFF] Early dependency detection
We introduce a new class hierarchy for debug types merging (in DebugTypes.h). The end-goal is to parallelize the type merging - please see the plan in D59226.
Previously, dependency discovery was done on the fly, much later, during the type merging loop. Unfortunately, parallelizing the type merging requires the dependencies to be merged in first, before any dependent ObjFile, thus this early discovery.
The overall intention for this path is to discover debug information dependencies at a much earlier stage, when processing input files. Currently, two types of dependency are supported: PDB type servers (when compiling with MSVC /Zi) and precompiled headers OBJs (when compiling with MSVC /Yc and /Yu). Once discovered, an explicit link is added into the dependent ObjFile, through the new debug types class hierarchy introduced in DebugTypes.h.
Differential Revision: https://reviews.llvm.org/D59053
llvm-svn: 357383
2019-04-01 21:36:59 +08:00
|
|
|
// If the OBJ has a .debug$T stream, this tells how it will be handled.
|
|
|
|
TpiSource *DebugTypesObj = nullptr;
|
|
|
|
|
|
|
|
// The .debug$T stream if there's one.
|
|
|
|
llvm::Optional<llvm::codeview::CVTypeArray> DebugTypes;
|
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
private:
|
2019-01-30 10:17:27 +08:00
|
|
|
const coff_section* getSection(uint32_t I);
|
2019-02-14 11:16:44 +08:00
|
|
|
const coff_section *getSection(COFFSymbolRef Sym) {
|
|
|
|
return getSection(Sym.getSectionNumber());
|
|
|
|
}
|
2019-01-30 10:17:27 +08:00
|
|
|
|
2015-08-06 22:58:50 +08:00
|
|
|
void initializeChunks();
|
|
|
|
void initializeSymbols();
|
2019-02-23 09:46:18 +08:00
|
|
|
void initializeFlags();
|
[LLD][COFF] Early dependency detection
We introduce a new class hierarchy for debug types merging (in DebugTypes.h). The end-goal is to parallelize the type merging - please see the plan in D59226.
Previously, dependency discovery was done on the fly, much later, during the type merging loop. Unfortunately, parallelizing the type merging requires the dependencies to be merged in first, before any dependent ObjFile, thus this early discovery.
The overall intention for this path is to discover debug information dependencies at a much earlier stage, when processing input files. Currently, two types of dependency are supported: PDB type servers (when compiling with MSVC /Zi) and precompiled headers OBJs (when compiling with MSVC /Yc and /Yu). Once discovered, an explicit link is added into the dependent ObjFile, through the new debug types class hierarchy introduced in DebugTypes.h.
Differential Revision: https://reviews.llvm.org/D59053
llvm-svn: 357383
2019-04-01 21:36:59 +08:00
|
|
|
void initializeDependencies();
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2017-11-28 09:30:07 +08:00
|
|
|
SectionChunk *
|
|
|
|
readSection(uint32_t SectionNumber,
|
2018-03-16 05:14:02 +08:00
|
|
|
const llvm::object::coff_aux_section_definition *Def,
|
|
|
|
StringRef LeaderName);
|
2017-11-28 09:30:07 +08:00
|
|
|
|
|
|
|
void readAssociativeDefinition(
|
|
|
|
COFFSymbolRef COFFSym,
|
|
|
|
const llvm::object::coff_aux_section_definition *Def);
|
|
|
|
|
2018-08-07 05:26:09 +08:00
|
|
|
void readAssociativeDefinition(
|
|
|
|
COFFSymbolRef COFFSym,
|
|
|
|
const llvm::object::coff_aux_section_definition *Def,
|
|
|
|
uint32_t ParentSection);
|
|
|
|
|
|
|
|
void recordPrevailingSymbolForMingw(
|
|
|
|
COFFSymbolRef COFFSym,
|
|
|
|
llvm::DenseMap<StringRef, uint32_t> &PrevailingSectionMap);
|
|
|
|
|
|
|
|
void maybeAssociateSEHForMingw(
|
|
|
|
COFFSymbolRef Sym, const llvm::object::coff_aux_section_definition *Def,
|
|
|
|
const llvm::DenseMap<StringRef, uint32_t> &PrevailingSectionMap);
|
|
|
|
|
2019-02-14 11:16:44 +08:00
|
|
|
// Given a new symbol Sym with comdat selection Selection, if the new
|
|
|
|
// symbol is not (yet) Prevailing and the existing comdat leader set to
|
|
|
|
// Leader, emits a diagnostic if the new symbol and its selection doesn't
|
|
|
|
// match the existing symbol and its selection. If either old or new
|
|
|
|
// symbol have selection IMAGE_COMDAT_SELECT_LARGEST, Sym might replace
|
|
|
|
// the existing leader. In that case, Prevailing is set to true.
|
|
|
|
void handleComdatSelection(COFFSymbolRef Sym,
|
|
|
|
llvm::COFF::COMDATType &Selection,
|
|
|
|
bool &Prevailing, DefinedRegular *Leader);
|
|
|
|
|
2017-11-28 09:30:07 +08:00
|
|
|
llvm::Optional<Symbol *>
|
|
|
|
createDefined(COFFSymbolRef Sym,
|
|
|
|
std::vector<const llvm::object::coff_aux_section_definition *>
|
2018-08-07 05:26:09 +08:00
|
|
|
&ComdatDefs,
|
|
|
|
bool &PrevailingComdat);
|
2017-11-28 09:30:07 +08:00
|
|
|
Symbol *createRegular(COFFSymbolRef Sym);
|
2017-11-04 05:21:47 +08:00
|
|
|
Symbol *createUndefined(COFFSymbolRef Sym);
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2016-12-09 02:49:04 +08:00
|
|
|
std::unique_ptr<COFFObjectFile> COFFObj;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
// List of all chunks defined by this file. This includes both section
|
|
|
|
// chunks and non-section chunks for common symbols.
|
|
|
|
std::vector<Chunk *> Chunks;
|
|
|
|
|
2016-11-22 01:22:35 +08:00
|
|
|
// CodeView debug info sections.
|
|
|
|
std::vector<SectionChunk *> DebugChunks;
|
|
|
|
|
2018-02-06 09:58:26 +08:00
|
|
|
// Chunks containing symbol table indices of exception handlers. Only used for
|
|
|
|
// 32-bit x86.
|
|
|
|
std::vector<SectionChunk *> SXDataChunks;
|
|
|
|
|
2018-02-14 04:32:53 +08:00
|
|
|
// Chunks containing symbol table indices of address taken symbols and longjmp
|
|
|
|
// targets. These are not linked into the final binary when /guard:cf is set.
|
2018-02-06 09:58:26 +08:00
|
|
|
std::vector<SectionChunk *> GuardFidChunks;
|
2018-02-14 04:32:53 +08:00
|
|
|
std::vector<SectionChunk *> GuardLJmpChunks;
|
2018-02-06 09:58:26 +08:00
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
// This vector contains the same chunks as Chunks, but they are
|
|
|
|
// indexed such that you can get a SectionChunk by section index.
|
|
|
|
// Nonexistent section indices are filled with null pointers.
|
|
|
|
// (Because section number is 1-based, the first slot is always a
|
|
|
|
// null pointer.)
|
2017-11-20 13:31:23 +08:00
|
|
|
std::vector<SectionChunk *> SparseChunks;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2017-11-21 02:52:53 +08:00
|
|
|
// This vector contains a list of all symbols defined or referenced by this
|
|
|
|
// file. They are indexed such that you can get a Symbol by symbol
|
2015-05-29 03:09:30 +08:00
|
|
|
// index. Nonexistent indices (which are occupied by auxiliary
|
|
|
|
// symbols in the real symbol table) are filled with null pointers.
|
2017-11-21 02:52:53 +08:00
|
|
|
std::vector<Symbol *> Symbols;
|
2015-05-29 03:09:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// This type represents import library members that contain DLL names
|
|
|
|
// and symbols exported from the DLLs. See Microsoft PE/COFF spec. 7
|
|
|
|
// for details about the format.
|
|
|
|
class ImportFile : public InputFile {
|
|
|
|
public:
|
2018-05-11 03:01:28 +08:00
|
|
|
explicit ImportFile(MemoryBufferRef M) : InputFile(ImportKind, M) {}
|
2017-05-25 06:30:06 +08:00
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
static bool classof(const InputFile *F) { return F->kind() == ImportKind; }
|
|
|
|
|
2017-07-27 08:45:26 +08:00
|
|
|
static std::vector<ImportFile *> Instances;
|
|
|
|
|
2018-07-10 18:40:11 +08:00
|
|
|
Symbol *ImpSym = nullptr;
|
|
|
|
Symbol *ThunkSym = nullptr;
|
2015-08-17 16:30:31 +08:00
|
|
|
std::string DLLName;
|
2015-08-17 15:27:45 +08:00
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
private:
|
2015-08-06 22:58:50 +08:00
|
|
|
void parse() override;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2016-12-10 05:55:24 +08:00
|
|
|
public:
|
|
|
|
StringRef ExternalName;
|
|
|
|
const coff_import_header *Hdr;
|
|
|
|
Chunk *Location = nullptr;
|
2017-05-25 06:30:06 +08:00
|
|
|
|
|
|
|
// We want to eliminate dllimported symbols if no one actually refers them.
|
2018-05-11 03:01:28 +08:00
|
|
|
// These "Live" bits are used to keep track of which import library members
|
2017-05-25 06:30:06 +08:00
|
|
|
// are actually in use.
|
|
|
|
//
|
|
|
|
// If the Live bit is turned off by MarkLive, Writer will ignore dllimported
|
2018-05-11 03:01:28 +08:00
|
|
|
// symbols provided by this import library member. We also track whether the
|
|
|
|
// imported symbol is used separately from whether the thunk is used in order
|
|
|
|
// to avoid creating unnecessary thunks.
|
|
|
|
bool Live = !Config->DoGC;
|
|
|
|
bool ThunkLive = !Config->DoGC;
|
2015-05-29 03:09:30 +08:00
|
|
|
};
|
|
|
|
|
2015-06-02 04:10:10 +08:00
|
|
|
// Used for LTO.
|
|
|
|
class BitcodeFile : public InputFile {
|
|
|
|
public:
|
2015-06-08 11:27:57 +08:00
|
|
|
explicit BitcodeFile(MemoryBufferRef M) : InputFile(BitcodeKind, M) {}
|
2015-06-02 04:10:10 +08:00
|
|
|
static bool classof(const InputFile *F) { return F->kind() == BitcodeKind; }
|
2018-04-12 03:52:53 +08:00
|
|
|
ArrayRef<Symbol *> getSymbols() { return Symbols; }
|
2015-07-10 03:54:13 +08:00
|
|
|
MachineTypes getMachineType() override;
|
2017-07-27 08:45:26 +08:00
|
|
|
static std::vector<BitcodeFile *> Instances;
|
2017-02-03 07:58:14 +08:00
|
|
|
std::unique_ptr<llvm::lto::InputFile> Obj;
|
2016-04-15 05:41:44 +08:00
|
|
|
|
2015-06-02 04:10:10 +08:00
|
|
|
private:
|
2015-08-06 22:58:50 +08:00
|
|
|
void parse() override;
|
2015-06-02 04:10:10 +08:00
|
|
|
|
2018-04-12 03:52:53 +08:00
|
|
|
std::vector<Symbol *> Symbols;
|
2015-06-02 04:10:10 +08:00
|
|
|
};
|
2015-05-29 03:09:30 +08:00
|
|
|
} // namespace coff
|
2017-01-06 18:04:08 +08:00
|
|
|
|
2017-12-06 00:50:46 +08:00
|
|
|
std::string toString(const coff::InputFile *File);
|
2015-05-29 03:09:30 +08:00
|
|
|
} // namespace lld
|
|
|
|
|
|
|
|
#endif
|