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 ||
31 "option is not supported for COFF");
32
33 return COFF;
34}
35
50 !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 ||
73 "only flags for section dumping, removal, and "
74 "addition are supported");
75
76 return Wasm;
77}
78
85 !Common.DumpSection.empty() || !Common.SymbolsToAdd.empty() ||
99 Common.GapFill != 0 || Common.PadTo != 0 ||
101 return createStringError(
103 "no flags are supported yet, only basic copying is allowed");
104 }
105
106 return XCOFF;
107}
108
109} // end namespace objcopy
110} // 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
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