Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | //===- lld/Common/Driver.h - Linker Driver Emulator -----------------------===// |
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_COMMON_DRIVER_H |
||
10 | #define LLD_COMMON_DRIVER_H |
||
11 | |||
12 | #include "llvm/ADT/ArrayRef.h" |
||
13 | #include "llvm/Support/raw_ostream.h" |
||
14 | |||
15 | namespace lld { |
||
16 | struct SafeReturn { |
||
17 | int ret; |
||
18 | bool canRunAgain; |
||
19 | }; |
||
20 | |||
21 | // Generic entry point when using LLD as a library, safe for re-entry, supports |
||
22 | // crash recovery. Returns a general completion code and a boolean telling |
||
23 | // whether it can be called again. In some cases, a crash could corrupt memory |
||
24 | // and re-entry would not be possible anymore. Use exitLld() in that case to |
||
25 | // properly exit your application and avoid intermittent crashes on exit caused |
||
26 | // by cleanup. |
||
27 | SafeReturn safeLldMain(int argc, const char **argv, llvm::raw_ostream &stdoutOS, |
||
28 | llvm::raw_ostream &stderrOS); |
||
29 | |||
30 | namespace coff { |
||
31 | bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS, |
||
32 | llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput); |
||
33 | } |
||
34 | |||
35 | namespace mingw { |
||
36 | bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS, |
||
37 | llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput); |
||
38 | } |
||
39 | |||
40 | namespace elf { |
||
41 | bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS, |
||
42 | llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput); |
||
43 | } |
||
44 | |||
45 | namespace macho { |
||
46 | bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS, |
||
47 | llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput); |
||
48 | } |
||
49 | |||
50 | namespace wasm { |
||
51 | bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS, |
||
52 | llvm::raw_ostream &stderrOS, bool exitEarly, bool disableOutput); |
||
53 | } |
||
54 | } // namespace lld |
||
55 | |||
56 | #endif |