blob: 866df32efa9803a6dabb17a22e31038af21dff18 [file] [log] [blame]
Peter Zotov34ddbf12013-11-06 09:21:31 +00001/*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
2|* *|
Chandler Carruth2946cd72019-01-19 08:50:56 +00003|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4|* Exceptions. *|
5|* See https://llvm.org/LICENSE.txt for license information. *|
6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
Peter Zotov34ddbf12013-11-06 09:21:31 +00007|* *|
8|*===----------------------------------------------------------------------===*|
9|* *|
10|* This file defines the C interface to the LLVM support library. *|
11|* *|
12\*===----------------------------------------------------------------------===*/
13
14#ifndef LLVM_C_SUPPORT_H
15#define LLVM_C_SUPPORT_H
16
David Blaikie99e17252018-03-21 17:31:49 +000017#include "llvm-c/DataTypes.h"
Duncan P. N. Exon Smith8c484052019-11-14 13:57:57 -080018#include "llvm-c/ExternC.h"
Eric Christophera6b96002015-12-18 01:46:52 +000019#include "llvm-c/Types.h"
Peter Zotov34ddbf12013-11-06 09:21:31 +000020
Duncan P. N. Exon Smith8c484052019-11-14 13:57:57 -080021LLVM_C_EXTERN_C_BEGIN
Peter Zotov34ddbf12013-11-06 09:21:31 +000022
23/**
24 * This function permanently loads the dynamic library at the given path.
25 * It is safe to call this function multiple times for the same library.
26 *
27 * @see sys::DynamicLibrary::LoadLibraryPermanently()
28 */
29LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
30
Peter Collingbournee1863192014-10-16 22:47:52 +000031/**
32 * This function parses the given arguments using the LLVM command line parser.
33 * Note that the only stable thing about this function is its signature; you
34 * cannot rely on any particular set of command line arguments being interpreted
35 * the same way across LLVM versions.
36 *
37 * @see llvm::cl::ParseCommandLineOptions()
38 */
39void LLVMParseCommandLineOptions(int argc, const char *const *argv,
40 const char *Overview);
41
Eli Benderskyaf79f3d2015-06-09 15:57:30 +000042/**
43 * This function will search through all previously loaded dynamic
44 * libraries for the symbol \p symbolName. If it is found, the address of
45 * that symbol is returned. If not, null is returned.
46 *
47 * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
48 */
49void *LLVMSearchForAddressOfSymbol(const char *symbolName);
50
51/**
52 * This functions permanently adds the symbol \p symbolName with the
53 * value \p symbolValue. These symbols are searched before any
54 * libraries.
55 *
56 * @see sys::DynamicLibrary::AddSymbol()
57 */
58void LLVMAddSymbol(const char *symbolName, void *symbolValue);
59
Duncan P. N. Exon Smith8c484052019-11-14 13:57:57 -080060LLVM_C_EXTERN_C_END
Peter Zotov34ddbf12013-11-06 09:21:31 +000061
NAKAMURA Takumi29c3b552013-11-07 13:54:24 +000062#endif