Path: blob/main/contrib/llvm-project/llvm/tools/llvm-objcopy/ObjcopyOptions.h
35258 views
//===- ObjcopyOptions.h ---------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H9#define LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H1011#include "llvm/ObjCopy/ConfigManager.h"12#include "llvm/Support/Allocator.h"1314namespace llvm {15namespace objcopy {1617// Configuration for the overall invocation of this tool. When invoked as18// objcopy, will always contain exactly one CopyConfig. When invoked as strip,19// will contain one or more CopyConfigs.20struct DriverConfig {21SmallVector<ConfigManager, 1> CopyConfigs;22BumpPtrAllocator Alloc;23};2425// ParseObjcopyOptions returns the config and sets the input arguments. If a26// help flag is set then ParseObjcopyOptions will print the help messege and27// exit. ErrorCallback is used to handle recoverable errors. An Error returned28// by the callback aborts the parsing and is then returned by this function.29Expected<DriverConfig>30parseObjcopyOptions(ArrayRef<const char *> ArgsArr,31llvm::function_ref<Error(Error)> ErrorCallback);3233// ParseInstallNameToolOptions returns the config and sets the input arguments.34// If a help flag is set then ParseInstallNameToolOptions will print the help35// messege and exit.36Expected<DriverConfig>37parseInstallNameToolOptions(ArrayRef<const char *> ArgsArr);3839// ParseBitcodeStripOptions returns the config and sets the input arguments.40// If a help flag is set then ParseBitcodeStripOptions will print the help41// messege and exit.42Expected<DriverConfig>43parseBitcodeStripOptions(ArrayRef<const char *> ArgsArr,44llvm::function_ref<Error(Error)> ErrorCallback);4546// ParseStripOptions returns the config and sets the input arguments. If a47// help flag is set then ParseStripOptions will print the help messege and48// exit. ErrorCallback is used to handle recoverable errors. An Error returned49// by the callback aborts the parsing and is then returned by this function.50Expected<DriverConfig>51parseStripOptions(ArrayRef<const char *> ArgsArr,52llvm::function_ref<Error(Error)> ErrorCallback);53} // namespace objcopy54} // namespace llvm5556#endif // LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H575859