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:102
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:1258
StringMap< SectionRename > SectionsToRename
Definition: CommonConfig.h:239
SmallVector< StringRef, 0 > DumpSection
Definition: CommonConfig.h:220
SmallVector< NewSymbolInfo, 0 > SymbolsToAdd
Definition: CommonConfig.h:246
StringMap< uint64_t > SetSectionAlignment
Definition: CommonConfig.h:240
StringMap< SectionFlagsUpdate > SetSectionFlags
Definition: CommonConfig.h:241
SmallVector< NewSectionInfo, 0 > AddSection
Definition: CommonConfig.h:219
NameMatcher UnneededSymbolsToRemove
Definition: CommonConfig.h:233
std::optional< StringRef > ExtractPartition
Definition: CommonConfig.h:209
StringMap< StringRef > SymbolsToRename
Definition: CommonConfig.h:243
StringMap< uint64_t > SetSectionType
Definition: CommonConfig.h:242
Expected< const XCOFFConfig & > getXCOFFConfig() const override
Expected< const COFFConfig & > getCOFFConfig() const override
Expected< const MachOConfig & > getMachOConfig() const override
Expected< const WasmConfig & > getWasmConfig() const override