1 //===- ObjcopyOptions.h ---------------------------------------------------===//
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
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"
18 // Configuration for the overall invocation of this tool. When invoked as
19 // objcopy, will always contain exactly one CopyConfig. When invoked as strip,
20 // will contain one or more CopyConfigs.
22 SmallVector
<ConfigManager
, 1> CopyConfigs
;
23 BumpPtrAllocator Alloc
;
26 // ParseObjcopyOptions returns the config and sets the input arguments. If a
27 // help flag is set then ParseObjcopyOptions will print the help messege and
28 // exit. ErrorCallback is used to handle recoverable errors. An Error returned
29 // by the callback aborts the parsing and is then returned by this function.
30 Expected
<DriverConfig
>
31 parseObjcopyOptions(ArrayRef
<const char *> ArgsArr
,
32 llvm::function_ref
<Error(Error
)> ErrorCallback
);
34 // ParseInstallNameToolOptions returns the config and sets the input arguments.
35 // If a help flag is set then ParseInstallNameToolOptions will print the help
37 Expected
<DriverConfig
>
38 parseInstallNameToolOptions(ArrayRef
<const char *> ArgsArr
);
40 // ParseBitcodeStripOptions returns the config and sets the input arguments.
41 // If a help flag is set then ParseBitcodeStripOptions will print the help
43 Expected
<DriverConfig
>
44 parseBitcodeStripOptions(ArrayRef
<const char *> ArgsArr
,
45 llvm::function_ref
<Error(Error
)> ErrorCallback
);
47 // ParseStripOptions returns the config and sets the input arguments. If a
48 // help flag is set then ParseStripOptions will print the help messege and
49 // exit. ErrorCallback is used to handle recoverable errors. An Error returned
50 // by the callback aborts the parsing and is then returned by this function.
51 Expected
<DriverConfig
>
52 parseStripOptions(ArrayRef
<const char *> ArgsArr
,
53 llvm::function_ref
<Error(Error
)> ErrorCallback
);
54 } // namespace objcopy
57 #endif // LLVM_TOOLS_LLVM_OBJCOPY_OBJCOPYOPTIONS_H