xref: /llvm-project/llvm/include/llvm-c/Support.h (revision ad523cc398d132ca48215f6499ba420cf0f7aaaa)
134ddbf1aSPeter Zotov /*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
234ddbf1aSPeter Zotov |*                                                                            *|
32946cd70SChandler Carruth |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
42946cd70SChandler Carruth |* Exceptions.                                                                *|
52946cd70SChandler Carruth |* See https://llvm.org/LICENSE.txt for license information.                  *|
62946cd70SChandler Carruth |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
734ddbf1aSPeter Zotov |*                                                                            *|
834ddbf1aSPeter Zotov |*===----------------------------------------------------------------------===*|
934ddbf1aSPeter Zotov |*                                                                            *|
1034ddbf1aSPeter Zotov |* This file defines the C interface to the LLVM support library.             *|
1134ddbf1aSPeter Zotov |*                                                                            *|
1234ddbf1aSPeter Zotov \*===----------------------------------------------------------------------===*/
1334ddbf1aSPeter Zotov 
1434ddbf1aSPeter Zotov #ifndef LLVM_C_SUPPORT_H
1534ddbf1aSPeter Zotov #define LLVM_C_SUPPORT_H
1634ddbf1aSPeter Zotov 
1799e17253SDavid Blaikie #include "llvm-c/DataTypes.h"
188c484050SDuncan P. N. Exon Smith #include "llvm-c/ExternC.h"
19a6b96004SEric Christopher #include "llvm-c/Types.h"
2034ddbf1aSPeter Zotov 
218c484050SDuncan P. N. Exon Smith LLVM_C_EXTERN_C_BEGIN
2234ddbf1aSPeter Zotov 
2334ddbf1aSPeter Zotov /**
24*ad523cc3SMats Larsen  * @addtogroup LLVMCCore
25*ad523cc3SMats Larsen  *
26*ad523cc3SMats Larsen  * @{
27*ad523cc3SMats Larsen  */
28*ad523cc3SMats Larsen 
29*ad523cc3SMats Larsen /**
3034ddbf1aSPeter Zotov  * This function permanently loads the dynamic library at the given path.
3134ddbf1aSPeter Zotov  * It is safe to call this function multiple times for the same library.
3234ddbf1aSPeter Zotov  *
3334ddbf1aSPeter Zotov  * @see sys::DynamicLibrary::LoadLibraryPermanently()
3434ddbf1aSPeter Zotov   */
3534ddbf1aSPeter Zotov LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
3634ddbf1aSPeter Zotov 
37e1863193SPeter Collingbourne /**
38e1863193SPeter Collingbourne  * This function parses the given arguments using the LLVM command line parser.
39e1863193SPeter Collingbourne  * Note that the only stable thing about this function is its signature; you
40e1863193SPeter Collingbourne  * cannot rely on any particular set of command line arguments being interpreted
41e1863193SPeter Collingbourne  * the same way across LLVM versions.
42e1863193SPeter Collingbourne  *
43e1863193SPeter Collingbourne  * @see llvm::cl::ParseCommandLineOptions()
44e1863193SPeter Collingbourne  */
45e1863193SPeter Collingbourne void LLVMParseCommandLineOptions(int argc, const char *const *argv,
46e1863193SPeter Collingbourne                                  const char *Overview);
47e1863193SPeter Collingbourne 
48af79f3dbSEli Bendersky /**
49af79f3dbSEli Bendersky  * This function will search through all previously loaded dynamic
50af79f3dbSEli Bendersky  * libraries for the symbol \p symbolName. If it is found, the address of
51af79f3dbSEli Bendersky  * that symbol is returned. If not, null is returned.
52af79f3dbSEli Bendersky  *
53af79f3dbSEli Bendersky  * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
54af79f3dbSEli Bendersky  */
55af79f3dbSEli Bendersky void *LLVMSearchForAddressOfSymbol(const char *symbolName);
56af79f3dbSEli Bendersky 
57af79f3dbSEli Bendersky /**
58af79f3dbSEli Bendersky  * This functions permanently adds the symbol \p symbolName with the
59af79f3dbSEli Bendersky  * value \p symbolValue.  These symbols are searched before any
60af79f3dbSEli Bendersky  * libraries.
61af79f3dbSEli Bendersky  *
62af79f3dbSEli Bendersky  * @see sys::DynamicLibrary::AddSymbol()
63af79f3dbSEli Bendersky  */
64af79f3dbSEli Bendersky void LLVMAddSymbol(const char *symbolName, void *symbolValue);
65af79f3dbSEli Bendersky 
66*ad523cc3SMats Larsen /**
67*ad523cc3SMats Larsen  * @}
68*ad523cc3SMats Larsen  */
69*ad523cc3SMats Larsen 
708c484050SDuncan P. N. Exon Smith LLVM_C_EXTERN_C_END
7134ddbf1aSPeter Zotov 
7234ddbf1aSPeter Zotov #endif
73