Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | //===- ConfigManager.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 | //===----------------------------------------------------------------------===// |
||
8 | |||
9 | #ifndef LLVM_OBJCOPY_CONFIGMANAGER_H |
||
10 | #define LLVM_OBJCOPY_CONFIGMANAGER_H |
||
11 | |||
12 | #include "llvm/ObjCopy/COFF/COFFConfig.h" |
||
13 | #include "llvm/ObjCopy/CommonConfig.h" |
||
14 | #include "llvm/ObjCopy/ELF/ELFConfig.h" |
||
15 | #include "llvm/ObjCopy/MachO/MachOConfig.h" |
||
16 | #include "llvm/ObjCopy/MultiFormatConfig.h" |
||
17 | #include "llvm/ObjCopy/wasm/WasmConfig.h" |
||
18 | #include "llvm/ObjCopy/XCOFF/XCOFFConfig.h" |
||
19 | |||
20 | namespace llvm { |
||
21 | namespace objcopy { |
||
22 | |||
23 | struct ConfigManager : public MultiFormatConfig { |
||
24 | virtual ~ConfigManager() {} |
||
25 | |||
26 | const CommonConfig &getCommonConfig() const override { return Common; } |
||
27 | |||
28 | Expected<const ELFConfig &> getELFConfig() const override { return ELF; } |
||
29 | |||
30 | Expected<const COFFConfig &> getCOFFConfig() const override; |
||
31 | |||
32 | Expected<const MachOConfig &> getMachOConfig() const override; |
||
33 | |||
34 | Expected<const WasmConfig &> getWasmConfig() const override; |
||
35 | |||
36 | Expected<const XCOFFConfig &> getXCOFFConfig() const override; |
||
37 | |||
38 | // All configs. |
||
39 | CommonConfig Common; |
||
40 | ELFConfig ELF; |
||
41 | COFFConfig COFF; |
||
42 | MachOConfig MachO; |
||
43 | WasmConfig Wasm; |
||
44 | XCOFFConfig XCOFF; |
||
45 | }; |
||
46 | |||
47 | } // namespace objcopy |
||
48 | } // namespace llvm |
||
49 | |||
50 | #endif // LLVM_OBJCOPY_CONFIGMANAGER_H |