LLVM 19.0.0git
ConfigManager.cpp
Go to the documentation of this file.
1//===- ConfigManager.cpp --------------------------------------------------===//
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
10#include "llvm/Support/Errc.h"
11#include "llvm/Support/Error.h"
12
13namespace llvm {
14namespace objcopy {
15
28 !Common.SymbolsToAdd.empty() || Common.GapFill != 0 || Common.PadTo != 0)
30 "option is not supported for COFF");
31
32 return COFF;
33}
34
49 !Common.SymbolsToAdd.empty() || Common.GapFill != 0 || Common.PadTo != 0)
51 "option is not supported for MachO");
52
53 return MachO;
54}
55
68 !Common.SymbolsToRename.empty() || Common.GapFill != 0 ||
69 Common.PadTo != 0)
71 "only flags for section dumping, removal, and "
72 "addition are supported");
73
74 return Wasm;
75}
76
83 !Common.DumpSection.empty() || !Common.SymbolsToAdd.empty() ||
97 Common.GapFill != 0 || Common.PadTo != 0) {
98 return createStringError(
100 "no flags are supported yet, only basic copying is allowed");
101 }
102
103 return XCOFF;
104}
105
106} // end namespace objcopy
107} // end namespace llvm
Tagged union holding either a T or a Error.
Definition: Error.h:474
bool empty() const
Definition: StringMap.h:103
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1244
StringMap< SectionRename > SectionsToRename
Definition: CommonConfig.h:240
std::vector< StringRef > DumpSection
Definition: CommonConfig.h:222
StringMap< uint64_t > SetSectionAlignment
Definition: CommonConfig.h:241
std::vector< NewSymbolInfo > SymbolsToAdd
Definition: CommonConfig.h:247
StringMap< SectionFlagsUpdate > SetSectionFlags
Definition: CommonConfig.h:242
NameMatcher UnneededSymbolsToRemove
Definition: CommonConfig.h:235
std::optional< StringRef > ExtractPartition
Definition: CommonConfig.h:211
std::vector< NewSectionInfo > AddSection
Definition: CommonConfig.h:221
StringMap< StringRef > SymbolsToRename
Definition: CommonConfig.h:244
StringMap< uint64_t > SetSectionType
Definition: CommonConfig.h:243
Expected< const XCOFFConfig & > getXCOFFConfig() const override
Expected< const COFFConfig & > getCOFFConfig() const override
Expected< const MachOConfig & > getMachOConfig() const override
Expected< const WasmConfig & > getWasmConfig() const override