1 //===- Args.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 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLD_ARGS_H
10 #define LLD_ARGS_H
11 
12 #include "lld/Common/LLVM.h"
13 #include "llvm/Support/CodeGen.h"
14 #include "llvm/Support/MemoryBuffer.h"
15 #include <vector>
16 
17 namespace llvm {
18 namespace opt {
19 class InputArgList;
20 }
21 } // namespace llvm
22 
23 namespace lld {
24 namespace args {
25 
26 llvm::CodeGenOpt::Level getCGOptLevel(int optLevelLTO);
27 
28 int64_t getInteger(llvm::opt::InputArgList &args, unsigned key,
29                    int64_t Default);
30 
31 int64_t getHex(llvm::opt::InputArgList &args, unsigned key, int64_t Default);
32 
33 llvm::SmallVector<StringRef, 0> getStrings(llvm::opt::InputArgList &args,
34                                            int id);
35 
36 uint64_t getZOptionValue(llvm::opt::InputArgList &args, int id, StringRef key,
37                          uint64_t Default);
38 
39 std::vector<StringRef> getLines(MemoryBufferRef mb);
40 
41 StringRef getFilenameWithoutExe(StringRef path);
42 
43 } // namespace args
44 } // namespace lld
45 
46 #endif
47