[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / tools / llvm-objcopy / ObjcopyOptions.h
blobf7fa2af304d77316278cfdadb132cbcb5e9914c1
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H
10 #define LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H
12 #include "llvm/ObjCopy/ConfigManager.h"
13 #include "llvm/Support/Allocator.h"
14 #include <vector>
16 namespace llvm {
17 namespace objcopy {
19 // Configuration for the overall invocation of this tool. When invoked as
20 // objcopy, will always contain exactly one CopyConfig. When invoked as strip,
21 // will contain one or more CopyConfigs.
22 struct DriverConfig {
23 SmallVector<ConfigManager, 1> CopyConfigs;
24 BumpPtrAllocator Alloc;
27 // ParseObjcopyOptions returns the config and sets the input arguments. If a
28 // help flag is set then ParseObjcopyOptions will print the help messege and
29 // exit. ErrorCallback is used to handle recoverable errors. An Error returned
30 // by the callback aborts the parsing and is then returned by this function.
31 Expected<DriverConfig>
32 parseObjcopyOptions(ArrayRef<const char *> ArgsArr,
33 llvm::function_ref<Error(Error)> ErrorCallback);
35 // ParseInstallNameToolOptions returns the config and sets the input arguments.
36 // If a help flag is set then ParseInstallNameToolOptions will print the help
37 // messege and exit.
38 Expected<DriverConfig>
39 parseInstallNameToolOptions(ArrayRef<const char *> ArgsArr);
41 // ParseBitcodeStripOptions returns the config and sets the input arguments.
42 // If a help flag is set then ParseBitcodeStripOptions will print the help
43 // messege and exit.
44 Expected<DriverConfig>
45 parseBitcodeStripOptions(ArrayRef<const char *> ArgsArr,
46 llvm::function_ref<Error(Error)> ErrorCallback);
48 // ParseStripOptions returns the config and sets the input arguments. If a
49 // help flag is set then ParseStripOptions will print the help messege and
50 // exit. ErrorCallback is used to handle recoverable errors. An Error returned
51 // by the callback aborts the parsing and is then returned by this function.
52 Expected<DriverConfig>
53 parseStripOptions(ArrayRef<const char *> ArgsArr,
54 llvm::function_ref<Error(Error)> ErrorCallback);
55 } // namespace objcopy
56 } // namespace llvm
58 #endif // LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H