[NFC][opt] Improve help message (#97805)
[llvm-project.git] / lld / ELF / Driver.h
blob29a2b04af7117468cf925ece6706f5748c6f78b3
1 //===- Driver.h -------------------------------------------------*- C++ -*-===//
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 LLD_ELF_DRIVER_H
10 #define LLD_ELF_DRIVER_H
12 #include "lld/Common/LLVM.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Option/ArgList.h"
15 #include <optional>
17 namespace lld::elf {
18 // Parses command line options.
19 class ELFOptTable : public llvm::opt::GenericOptTable {
20 public:
21 ELFOptTable();
22 llvm::opt::InputArgList parse(ArrayRef<const char *> argv);
25 // Create enum with OPT_xxx values for each option in Options.td
26 enum {
27 OPT_INVALID = 0,
28 #define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__),
29 #include "Options.inc"
30 #undef OPTION
33 void printHelp();
34 std::string createResponseFile(const llvm::opt::InputArgList &args);
36 std::optional<std::string> findFromSearchPaths(StringRef path);
37 std::optional<std::string> searchScript(StringRef path);
38 std::optional<std::string> searchLibraryBaseName(StringRef path);
39 std::optional<std::string> searchLibrary(StringRef path);
41 } // namespace lld::elf
43 #endif