187265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov/*===-- llvm-c/Support.h - Support C Interface --------------------*- C -*-===*\
287265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*                                                                            *|
387265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*                     The LLVM Compiler Infrastructure                       *|
487265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*                                                                            *|
587265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|* This file is distributed under the University of Illinois Open Source      *|
687265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|* License. See LICENSE.TXT for details.                                      *|
787265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*                                                                            *|
887265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*===----------------------------------------------------------------------===*|
987265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*                                                                            *|
1087265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|* This file defines the C interface to the LLVM support library.             *|
1187265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov|*                                                                            *|
1287265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov\*===----------------------------------------------------------------------===*/
1387265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov
1487265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov#ifndef LLVM_C_SUPPORT_H
1587265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov#define LLVM_C_SUPPORT_H
1687265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov
1736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/Support/DataTypes.h"
18f3ef5332fa3f4d5ec72c178a2b19dac363a19383Pirama Arumuga Nainar#include "llvm-c/Types.h"
1987265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov
2087265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov#ifdef __cplusplus
2187265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotovextern "C" {
2287265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov#endif
2387265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov
2487265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov/**
2587265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov * This function permanently loads the dynamic library at the given path.
2687265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov * It is safe to call this function multiple times for the same library.
2787265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov *
2887265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov * @see sys::DynamicLibrary::LoadLibraryPermanently()
2987265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov  */
3087265f9792a59b7107bd30fb6f114f5ce5e1273cPeter ZotovLLVMBool LLVMLoadLibraryPermanently(const char* Filename);
3187265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov
3237ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines/**
3337ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines * This function parses the given arguments using the LLVM command line parser.
3437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines * Note that the only stable thing about this function is its signature; you
3537ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines * cannot rely on any particular set of command line arguments being interpreted
3637ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines * the same way across LLVM versions.
3737ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines *
3837ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines * @see llvm::cl::ParseCommandLineOptions()
3937ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines */
4037ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hinesvoid LLVMParseCommandLineOptions(int argc, const char *const *argv,
4137ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines                                 const char *Overview);
4237ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines
436948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar/**
446948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * This function will search through all previously loaded dynamic
456948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * libraries for the symbol \p symbolName. If it is found, the address of
466948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * that symbol is returned. If not, null is returned.
476948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar *
486948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
496948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar */
506948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainarvoid *LLVMSearchForAddressOfSymbol(const char *symbolName);
516948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar
526948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar/**
536948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * This functions permanently adds the symbol \p symbolName with the
546948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * value \p symbolValue.  These symbols are searched before any
556948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * libraries.
566948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar *
576948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar * @see sys::DynamicLibrary::AddSymbol()
586948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar */
596948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainarvoid LLVMAddSymbol(const char *symbolName, void *symbolValue);
606948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar
6187265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov#ifdef __cplusplus
6287265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov}
6387265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov#endif
6487265f9792a59b7107bd30fb6f114f5ce5e1273cPeter Zotov
650f0f1ac011627aa5f90d739b4e0ccffeeb721f50NAKAMURA Takumi#endif
66