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
49 !Common.SymbolsToAdd.empty() || Common.GapFill != 0 ||
53 "option is not supported for MachO");
54
55 return MachO;
56}
57
70 !Common.SymbolsToRename.empty() || Common.GapFill != 0 ||
74 "only flags for section dumping, removal, and "
75 "addition are supported");
76
77 return Wasm;
78}
79
86 !Common.DumpSection.empty() || !Common.SymbolsToAdd.empty() ||
100 Common.GapFill != 0 || Common.PadTo != 0 ||
102 !Common.ChangeSectionAddress.empty()) {
103 return createStringError(
105 "no flags are supported yet, only basic copying is allowed");
106 }
107
108 return XCOFF;
109}
110
111} // end namespace objcopy
112} // 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:147
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:1291
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