LLVM  15.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 
13 namespace llvm {
14 namespace objcopy {
15 
28  "option is not supported for COFF");
29 
30  return COFF;
31 }
32 
47  "option is not supported for MachO");
48 
49  return MachO;
50 }
51 
63  !Common.SymbolsToRename.empty())
65  "only flags for section dumping, removal, and "
66  "addition are supported");
67 
68  return Wasm;
69 }
70 
76  !Common.DumpSection.empty() || !Common.SymbolsToAdd.empty() ||
90  return createStringError(
92  "no flags are supported yet, only basic copying is allowed");
93  }
94 
95  return XCOFF;
96 }
97 
98 } // end namespace objcopy
99 } // end namespace llvm
llvm::objcopy::CommonConfig::PreserveDates
bool PreserveDates
Definition: CommonConfig.h:255
llvm::errc::invalid_argument
@ invalid_argument
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::objcopy::ConfigManager::XCOFF
XCOFFConfig XCOFF
Definition: ConfigManager.h:44
llvm::objcopy::CommonConfig::SymbolsToWeaken
NameMatcher SymbolsToWeaken
Definition: CommonConfig.h:237
Error.h
llvm::objcopy::CommonConfig::SymbolsToRename
StringMap< StringRef > SymbolsToRename
Definition: CommonConfig.h:245
llvm::objcopy::CommonConfig::DiscardMode
DiscardType DiscardMode
Definition: CommonConfig.h:219
Errc.h
llvm::objcopy::CommonConfig::StripSections
bool StripSections
Definition: CommonConfig.h:261
llvm::objcopy::CommonConfig::StripNonAlloc
bool StripNonAlloc
Definition: CommonConfig.h:260
llvm::objcopy::ConfigManager::MachO
MachOConfig MachO
Definition: ConfigManager.h:42
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::objcopy::ConfigManager::getCOFFConfig
Expected< const COFFConfig & > getCOFFConfig() const override
Definition: ConfigManager.cpp:16
llvm::objcopy::ConfigManager::COFF
COFFConfig COFF
Definition: ConfigManager.h:41
llvm::objcopy::CommonConfig::OnlySection
NameMatcher OnlySection
Definition: CommonConfig.h:228
llvm::objcopy::CommonConfig::SymbolsToKeep
NameMatcher SymbolsToKeep
Definition: CommonConfig.h:233
llvm::objcopy::CommonConfig::SetSectionType
StringMap< uint64_t > SetSectionType
Definition: CommonConfig.h:244
llvm::objcopy::CommonConfig::AddSection
std::vector< NewSectionInfo > AddSection
Definition: CommonConfig.h:222
llvm::objcopy::CommonConfig::KeepSection
NameMatcher KeepSection
Definition: CommonConfig.h:227
llvm::objcopy::CommonConfig::DumpSection
std::vector< StringRef > DumpSection
Definition: CommonConfig.h:223
llvm::objcopy::ConfigManager::Wasm
WasmConfig Wasm
Definition: ConfigManager.h:43
llvm::objcopy::CommonConfig::SymbolsToGlobalize
NameMatcher SymbolsToGlobalize
Definition: CommonConfig.h:232
llvm::objcopy::NameMatcher::empty
bool empty() const
Definition: CommonConfig.h:155
llvm::objcopy::ConfigManager::Common
CommonConfig Common
Definition: ConfigManager.h:39
llvm::objcopy::CommonConfig::StripUnneeded
bool StripUnneeded
Definition: CommonConfig.h:262
llvm::objcopy::CommonConfig::SplitDWO
StringRef SplitDWO
Definition: CommonConfig.h:216
llvm::objcopy::CommonConfig::StripAllGNU
bool StripAllGNU
Definition: CommonConfig.h:257
llvm::objcopy::CommonConfig::SymbolsToLocalize
NameMatcher SymbolsToLocalize
Definition: CommonConfig.h:234
llvm::StringRef::empty
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:153
llvm::objcopy::CommonConfig::SymbolsToKeepGlobal
NameMatcher SymbolsToKeepGlobal
Definition: CommonConfig.h:238
llvm::objcopy::CommonConfig::UnneededSymbolsToRemove
NameMatcher UnneededSymbolsToRemove
Definition: CommonConfig.h:236
llvm::objcopy::CommonConfig::StripDebug
bool StripDebug
Definition: CommonConfig.h:259
llvm::objcopy::CommonConfig::SymbolsToAdd
std::vector< NewSymbolInfo > SymbolsToAdd
Definition: CommonConfig.h:248
llvm::objcopy::CommonConfig::SymbolsPrefix
StringRef SymbolsPrefix
Definition: CommonConfig.h:217
llvm::objcopy::CommonConfig::StripDWO
bool StripDWO
Definition: CommonConfig.h:258
llvm::objcopy::CommonConfig::SetSectionAlignment
StringMap< uint64_t > SetSectionAlignment
Definition: CommonConfig.h:242
llvm::objcopy::DiscardType::None
@ None
llvm::createStringError
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1239
llvm::objcopy::ConfigManager::getXCOFFConfig
Expected< const XCOFFConfig & > getXCOFFConfig() const override
Definition: ConfigManager.cpp:71
ConfigManager.h
llvm::objcopy::DiscardType::Locals
@ Locals
llvm::objcopy::ConfigManager::getMachOConfig
Expected< const MachOConfig & > getMachOConfig() const override
Definition: ConfigManager.cpp:33
llvm::objcopy::ConfigManager::getWasmConfig
Expected< const WasmConfig & > getWasmConfig() const override
Definition: ConfigManager.cpp:52
llvm::objcopy::CommonConfig::ExtractPartition
Optional< StringRef > ExtractPartition
Definition: CommonConfig.h:215
llvm::objcopy::CommonConfig::SectionsToRename
StringMap< SectionRename > SectionsToRename
Definition: CommonConfig.h:241
llvm::StringMapImpl::empty
bool empty() const
Definition: StringMap.h:94
llvm::objcopy::CommonConfig::SymbolsToRemove
NameMatcher SymbolsToRemove
Definition: CommonConfig.h:235
llvm::objcopy::CommonConfig::DecompressDebugSections
bool DecompressDebugSections
Definition: CommonConfig.h:264
llvm::objcopy::CommonConfig::ExtractMainPartition
bool ExtractMainPartition
Definition: CommonConfig.h:253
llvm::objcopy::CommonConfig::ToRemove
NameMatcher ToRemove
Definition: CommonConfig.h:229
llvm::objcopy::CommonConfig::ExtractDWO
bool ExtractDWO
Definition: CommonConfig.h:252
llvm::objcopy::CommonConfig::SetSectionFlags
StringMap< SectionFlagsUpdate > SetSectionFlags
Definition: CommonConfig.h:243
llvm::objcopy::CommonConfig::Weaken
bool Weaken
Definition: CommonConfig.h:263
llvm::objcopy::CommonConfig::AddGnuDebugLink
StringRef AddGnuDebugLink
Definition: CommonConfig.h:212
llvm::objcopy::CommonConfig::AllocSectionsPrefix
StringRef AllocSectionsPrefix
Definition: CommonConfig.h:218
llvm::objcopy::CommonConfig::OnlyKeepDebug
bool OnlyKeepDebug
Definition: CommonConfig.h:254