[UpdateCCTestChecks] Detect function mangled name on separate line
[llvm-core.git] / tools / llvm-objcopy / COFF / Reader.h
blobec15369db0b80d867fc4b252c9bb796d404ab3bc
1 //===- Reader.h -------------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_OBJCOPY_COFF_READER_H
10 #define LLVM_TOOLS_OBJCOPY_COFF_READER_H
12 #include "Buffer.h"
13 #include "llvm/BinaryFormat/COFF.h"
14 #include "llvm/Object/COFF.h"
15 #include "llvm/Support/Error.h"
17 namespace llvm {
18 namespace objcopy {
19 namespace coff {
21 struct Object;
23 using object::COFFObjectFile;
25 class COFFReader {
26 const COFFObjectFile &COFFObj;
28 Error readExecutableHeaders(Object &Obj) const;
29 Error readSections(Object &Obj) const;
30 Error readSymbols(Object &Obj, bool IsBigObj) const;
31 Error setSymbolTargets(Object &Obj) const;
33 public:
34 explicit COFFReader(const COFFObjectFile &O) : COFFObj(O) {}
35 Expected<std::unique_ptr<Object>> create() const;
38 } // end namespace coff
39 } // end namespace objcopy
40 } // end namespace llvm
42 #endif // LLVM_TOOLS_OBJCOPY_COFF_READER_H