LLVM 20.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 ||
32 "option is not supported for COFF");
33
34 return COFF;
35}
36
51 !Common.SymbolsToAdd.empty() || Common.GapFill != 0 ||
55 "option is not supported for MachO");
56
57 return MachO;
58}
59
72 !Common.SymbolsToRename.empty() || Common.GapFill != 0 ||
76 "only flags for section dumping, removal, and "
77 "addition are supported");
78
79 return Wasm;
80}
81
88 !Common.DumpSection.empty() || !Common.SymbolsToAdd.empty() ||
102 Common.GapFill != 0 || Common.PadTo != 0 ||
104 !Common.ChangeSectionAddress.empty()) {
105 return createStringError(
107 "no flags are supported yet, only basic copying is allowed");
108 }
109
110 return XCOFF;
111}
112
113} // end namespace objcopy
114} // end namespace llvm
Tagged union holding either a T or a Error.
Definition: Error.h:481
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:1286
SmallVector< SectionPatternAddressUpdate, 0 > ChangeSectionAddress
Definition: CommonConfig.h:234
StringMap< SectionRename > SectionsToRename
Definition: CommonConfig.h:252
SmallVector< StringRef, 0 > DumpSection
Definition: CommonConfig.h:232
SmallVector< NewSymbolInfo, 0 > SymbolsToAdd
Definition: CommonConfig.h:259
StringMap< uint64_t > SetSectionAlignment
Definition: CommonConfig.h:253
StringMap< SectionFlagsUpdate > SetSectionFlags
Definition: CommonConfig.h:254
SmallVector< NewSectionInfo, 0 > AddSection
Definition: CommonConfig.h:231
NameMatcher UnneededSymbolsToRemove
Definition: CommonConfig.h:246
std::optional< StringRef > ExtractPartition
Definition: CommonConfig.h:221
StringMap< StringRef > SymbolsToRename
Definition: CommonConfig.h:256
StringMap< uint64_t > SetSectionType
Definition: CommonConfig.h:255
Expected< const XCOFFConfig & > getXCOFFConfig() const override
Expected< const COFFConfig & > getCOFFConfig() const override
Expected< const MachOConfig & > getMachOConfig() const override
Expected< const WasmConfig & > getWasmConfig() const override