xref: /aosp_15_r20/external/llvm/include/llvm-c/Support.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker /*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
2*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
3*9880d681SAndroid Build Coastguard Worker |*                     The LLVM Compiler Infrastructure                       *|
4*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
5*9880d681SAndroid Build Coastguard Worker |* This file is distributed under the University of Illinois Open Source      *|
6*9880d681SAndroid Build Coastguard Worker |* License. See LICENSE.TXT for details.                                      *|
7*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
8*9880d681SAndroid Build Coastguard Worker |*===----------------------------------------------------------------------===*|
9*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
10*9880d681SAndroid Build Coastguard Worker |* This file defines the C interface to the LLVM support library.             *|
11*9880d681SAndroid Build Coastguard Worker |*                                                                            *|
12*9880d681SAndroid Build Coastguard Worker \*===----------------------------------------------------------------------===*/
13*9880d681SAndroid Build Coastguard Worker 
14*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_C_SUPPORT_H
15*9880d681SAndroid Build Coastguard Worker #define LLVM_C_SUPPORT_H
16*9880d681SAndroid Build Coastguard Worker 
17*9880d681SAndroid Build Coastguard Worker #include "llvm/Support/DataTypes.h"
18*9880d681SAndroid Build Coastguard Worker #include "llvm-c/Types.h"
19*9880d681SAndroid Build Coastguard Worker 
20*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus
21*9880d681SAndroid Build Coastguard Worker extern "C" {
22*9880d681SAndroid Build Coastguard Worker #endif
23*9880d681SAndroid Build Coastguard Worker 
24*9880d681SAndroid Build Coastguard Worker /**
25*9880d681SAndroid Build Coastguard Worker  * This function permanently loads the dynamic library at the given path.
26*9880d681SAndroid Build Coastguard Worker  * It is safe to call this function multiple times for the same library.
27*9880d681SAndroid Build Coastguard Worker  *
28*9880d681SAndroid Build Coastguard Worker  * @see sys::DynamicLibrary::LoadLibraryPermanently()
29*9880d681SAndroid Build Coastguard Worker   */
30*9880d681SAndroid Build Coastguard Worker LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
31*9880d681SAndroid Build Coastguard Worker 
32*9880d681SAndroid Build Coastguard Worker /**
33*9880d681SAndroid Build Coastguard Worker  * This function parses the given arguments using the LLVM command line parser.
34*9880d681SAndroid Build Coastguard Worker  * Note that the only stable thing about this function is its signature; you
35*9880d681SAndroid Build Coastguard Worker  * cannot rely on any particular set of command line arguments being interpreted
36*9880d681SAndroid Build Coastguard Worker  * the same way across LLVM versions.
37*9880d681SAndroid Build Coastguard Worker  *
38*9880d681SAndroid Build Coastguard Worker  * @see llvm::cl::ParseCommandLineOptions()
39*9880d681SAndroid Build Coastguard Worker  */
40*9880d681SAndroid Build Coastguard Worker void LLVMParseCommandLineOptions(int argc, const char *const *argv,
41*9880d681SAndroid Build Coastguard Worker                                  const char *Overview);
42*9880d681SAndroid Build Coastguard Worker 
43*9880d681SAndroid Build Coastguard Worker /**
44*9880d681SAndroid Build Coastguard Worker  * This function will search through all previously loaded dynamic
45*9880d681SAndroid Build Coastguard Worker  * libraries for the symbol \p symbolName. If it is found, the address of
46*9880d681SAndroid Build Coastguard Worker  * that symbol is returned. If not, null is returned.
47*9880d681SAndroid Build Coastguard Worker  *
48*9880d681SAndroid Build Coastguard Worker  * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
49*9880d681SAndroid Build Coastguard Worker  */
50*9880d681SAndroid Build Coastguard Worker void *LLVMSearchForAddressOfSymbol(const char *symbolName);
51*9880d681SAndroid Build Coastguard Worker 
52*9880d681SAndroid Build Coastguard Worker /**
53*9880d681SAndroid Build Coastguard Worker  * This functions permanently adds the symbol \p symbolName with the
54*9880d681SAndroid Build Coastguard Worker  * value \p symbolValue.  These symbols are searched before any
55*9880d681SAndroid Build Coastguard Worker  * libraries.
56*9880d681SAndroid Build Coastguard Worker  *
57*9880d681SAndroid Build Coastguard Worker  * @see sys::DynamicLibrary::AddSymbol()
58*9880d681SAndroid Build Coastguard Worker  */
59*9880d681SAndroid Build Coastguard Worker void LLVMAddSymbol(const char *symbolName, void *symbolValue);
60*9880d681SAndroid Build Coastguard Worker 
61*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus
62*9880d681SAndroid Build Coastguard Worker }
63*9880d681SAndroid Build Coastguard Worker #endif
64*9880d681SAndroid Build Coastguard Worker 
65*9880d681SAndroid Build Coastguard Worker #endif
66