xref: /openbsd-src/gnu/llvm/llvm/include/llvm-c/Support.h (revision d415bd752c734aee168c4ee86ff32e8cc249eb16)
109467b48Spatrick /*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
209467b48Spatrick |*                                                                            *|
309467b48Spatrick |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
409467b48Spatrick |* Exceptions.                                                                *|
509467b48Spatrick |* See https://llvm.org/LICENSE.txt for license information.                  *|
609467b48Spatrick |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
709467b48Spatrick |*                                                                            *|
809467b48Spatrick |*===----------------------------------------------------------------------===*|
909467b48Spatrick |*                                                                            *|
1009467b48Spatrick |* This file defines the C interface to the LLVM support library.             *|
1109467b48Spatrick |*                                                                            *|
1209467b48Spatrick \*===----------------------------------------------------------------------===*/
1309467b48Spatrick 
1409467b48Spatrick #ifndef LLVM_C_SUPPORT_H
1509467b48Spatrick #define LLVM_C_SUPPORT_H
1609467b48Spatrick 
1709467b48Spatrick #include "llvm-c/DataTypes.h"
1809467b48Spatrick #include "llvm-c/ExternC.h"
1909467b48Spatrick #include "llvm-c/Types.h"
2009467b48Spatrick 
2109467b48Spatrick LLVM_C_EXTERN_C_BEGIN
2209467b48Spatrick 
2309467b48Spatrick /**
24*d415bd75Srobert  * @addtogroup LLVMCCore
25*d415bd75Srobert  *
26*d415bd75Srobert  * @{
27*d415bd75Srobert  */
28*d415bd75Srobert 
29*d415bd75Srobert /**
3009467b48Spatrick  * This function permanently loads the dynamic library at the given path.
3109467b48Spatrick  * It is safe to call this function multiple times for the same library.
3209467b48Spatrick  *
3309467b48Spatrick  * @see sys::DynamicLibrary::LoadLibraryPermanently()
3409467b48Spatrick   */
3509467b48Spatrick LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
3609467b48Spatrick 
3709467b48Spatrick /**
3809467b48Spatrick  * This function parses the given arguments using the LLVM command line parser.
3909467b48Spatrick  * Note that the only stable thing about this function is its signature; you
4009467b48Spatrick  * cannot rely on any particular set of command line arguments being interpreted
4109467b48Spatrick  * the same way across LLVM versions.
4209467b48Spatrick  *
4309467b48Spatrick  * @see llvm::cl::ParseCommandLineOptions()
4409467b48Spatrick  */
4509467b48Spatrick void LLVMParseCommandLineOptions(int argc, const char *const *argv,
4609467b48Spatrick                                  const char *Overview);
4709467b48Spatrick 
4809467b48Spatrick /**
4909467b48Spatrick  * This function will search through all previously loaded dynamic
5009467b48Spatrick  * libraries for the symbol \p symbolName. If it is found, the address of
5109467b48Spatrick  * that symbol is returned. If not, null is returned.
5209467b48Spatrick  *
5309467b48Spatrick  * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
5409467b48Spatrick  */
5509467b48Spatrick void *LLVMSearchForAddressOfSymbol(const char *symbolName);
5609467b48Spatrick 
5709467b48Spatrick /**
5809467b48Spatrick  * This functions permanently adds the symbol \p symbolName with the
5909467b48Spatrick  * value \p symbolValue.  These symbols are searched before any
6009467b48Spatrick  * libraries.
6109467b48Spatrick  *
6209467b48Spatrick  * @see sys::DynamicLibrary::AddSymbol()
6309467b48Spatrick  */
6409467b48Spatrick void LLVMAddSymbol(const char *symbolName, void *symbolValue);
6509467b48Spatrick 
66*d415bd75Srobert /**
67*d415bd75Srobert  * @}
68*d415bd75Srobert  */
69*d415bd75Srobert 
7009467b48Spatrick LLVM_C_EXTERN_C_END
7109467b48Spatrick 
7209467b48Spatrick #endif
73