brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 3b88789 Raw
58 lines · c
1//===- ObjcopyOptions.h ---------------------------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H10#define LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H11 12#include "llvm/ObjCopy/ConfigManager.h"13#include "llvm/Support/Allocator.h"14 15namespace llvm {16namespace objcopy {17 18// Configuration for the overall invocation of this tool. When invoked as19// objcopy, will always contain exactly one CopyConfig. When invoked as strip,20// will contain one or more CopyConfigs.21struct DriverConfig {22  SmallVector<ConfigManager, 1> CopyConfigs;23  BumpPtrAllocator Alloc;24};25 26// ParseObjcopyOptions returns the config and sets the input arguments. If a27// help flag is set then ParseObjcopyOptions will print the help messege and28// exit. ErrorCallback is used to handle recoverable errors. An Error returned29// by the callback aborts the parsing and is then returned by this function.30Expected<DriverConfig>31parseObjcopyOptions(ArrayRef<const char *> ArgsArr,32                    llvm::function_ref<Error(Error)> ErrorCallback);33 34// ParseInstallNameToolOptions returns the config and sets the input arguments.35// If a help flag is set then ParseInstallNameToolOptions will print the help36// messege and exit.37Expected<DriverConfig>38parseInstallNameToolOptions(ArrayRef<const char *> ArgsArr);39 40// ParseBitcodeStripOptions returns the config and sets the input arguments.41// If a help flag is set then ParseBitcodeStripOptions will print the help42// messege and exit.43Expected<DriverConfig>44parseBitcodeStripOptions(ArrayRef<const char *> ArgsArr,45                         llvm::function_ref<Error(Error)> ErrorCallback);46 47// ParseStripOptions returns the config and sets the input arguments. If a48// help flag is set then ParseStripOptions will print the help messege and49// exit. ErrorCallback is used to handle recoverable errors. An Error returned50// by the callback aborts the parsing and is then returned by this function.51Expected<DriverConfig>52parseStripOptions(ArrayRef<const char *> ArgsArr,53                  llvm::function_ref<Error(Error)> ErrorCallback);54} // namespace objcopy55} // namespace llvm56 57#endif // LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H58