diff options
Diffstat (limited to 'lld/COFF/InputFiles.h')
-rw-r--r-- | lld/COFF/InputFiles.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/COFF/InputFiles.h b/lld/COFF/InputFiles.h index 98a162482b90..0d768c52ea26 100644 --- a/lld/COFF/InputFiles.h +++ b/lld/COFF/InputFiles.h @@ -24,6 +24,8 @@ namespace lld { namespace coff { using llvm::LTOModule; +using llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN; +using llvm::COFF::MachineTypes; using llvm::object::Archive; using llvm::object::COFFObjectFile; using llvm::object::COFFSymbolRef; @@ -51,6 +53,9 @@ public: // file is broken. virtual std::error_code parse() = 0; + // Returns the CPU type this file was compiled to. + virtual MachineTypes getMachineType() { return IMAGE_FILE_MACHINE_UNKNOWN; } + // Returns a short, human-friendly filename. If this is a member of // an archive file, a returned value includes parent's filename. // Used for logging or debugging. @@ -112,6 +117,7 @@ public: explicit ObjectFile(MemoryBufferRef M) : InputFile(ObjectKind, M) {} static bool classof(const InputFile *F) { return F->kind() == ObjectKind; } std::error_code parse() override; + MachineTypes getMachineType() override; std::vector<Chunk *> &getChunks() { return Chunks; } std::vector<SymbolBody *> &getSymbols() override { return SymbolBodies; } @@ -181,6 +187,7 @@ public: explicit BitcodeFile(MemoryBufferRef M) : InputFile(BitcodeKind, M) {} static bool classof(const InputFile *F) { return F->kind() == BitcodeKind; } std::vector<SymbolBody *> &getSymbols() override { return SymbolBodies; } + MachineTypes getMachineType() override; LTOModule *getModule() const { return M.get(); } LTOModule *releaseModule() { return M.release(); } |