Skip to content

Commit 7419d44

Browse files
committed
Add auto generate visibility attributes to llvm-c
1 parent 52e9b1e commit 7419d44

23 files changed

+1151
-1125
lines changed

llvm/include/llvm-c/Analysis.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "llvm-c/ExternC.h"
2323
#include "llvm-c/Types.h"
24+
#include "llvm/Support/Compiler.h"
2425

2526
LLVM_C_EXTERN_C_BEGIN
2627

@@ -41,17 +42,17 @@ typedef enum {
4142
/* Verifies that a module is valid, taking the specified action if not.
4243
Optionally returns a human-readable description of any invalid constructs.
4344
OutMessage must be disposed with LLVMDisposeMessage. */
44-
LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
45+
LLVM_C_ABI LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
4546
char **OutMessage);
4647

4748
/* Verifies that a single function is valid, taking the specified action. Useful
4849
for debugging. */
49-
LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
50+
LLVM_C_ABI LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
5051

5152
/* Open up a ghostview window that displays the CFG of the current function.
5253
Useful for debugging. */
53-
void LLVMViewFunctionCFG(LLVMValueRef Fn);
54-
void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
54+
LLVM_C_ABI void LLVMViewFunctionCFG(LLVMValueRef Fn);
55+
LLVM_C_ABI void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
5556

5657
/**
5758
* @}

llvm/include/llvm-c/BitReader.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "llvm-c/ExternC.h"
2323
#include "llvm-c/Types.h"
24+
#include "llvm/Support/Compiler.h"
2425

2526
LLVM_C_EXTERN_C_BEGIN
2627

@@ -36,28 +37,28 @@ LLVM_C_EXTERN_C_BEGIN
3637
Optionally returns a human-readable error message via OutMessage.
3738
3839
This is deprecated. Use LLVMParseBitcode2. */
39-
LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
40+
LLVM_C_ABI LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
4041
char **OutMessage);
4142

4243
/* Builds a module from the bitcode in the specified memory buffer, returning a
4344
reference to the module via the OutModule parameter. Returns 0 on success. */
44-
LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
45+
LLVM_C_ABI LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
4546
LLVMModuleRef *OutModule);
4647

4748
/* This is deprecated. Use LLVMParseBitcodeInContext2. */
48-
LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
49+
LLVM_C_ABI LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
4950
LLVMMemoryBufferRef MemBuf,
5051
LLVMModuleRef *OutModule, char **OutMessage);
5152

52-
LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
53+
LLVM_C_ABI LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
5354
LLVMMemoryBufferRef MemBuf,
5455
LLVMModuleRef *OutModule);
5556

5657
/** Reads a module from the specified path, returning via the OutMP parameter
5758
a module provider which performs lazy deserialization. Returns 0 on success.
5859
Optionally returns a human-readable error message via OutMessage.
5960
This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
60-
LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
61+
LLVM_C_ABI LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
6162
LLVMMemoryBufferRef MemBuf,
6263
LLVMModuleRef *OutM, char **OutMessage);
6364

@@ -68,15 +69,15 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
6869
*
6970
* Takes ownership of \p MemBuf if (and only if) the module was read
7071
* successfully. */
71-
LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
72+
LLVM_C_ABI LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
7273
LLVMMemoryBufferRef MemBuf,
7374
LLVMModuleRef *OutM);
7475

7576
/* This is deprecated. Use LLVMGetBitcodeModule2. */
76-
LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
77+
LLVM_C_ABI LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
7778
char **OutMessage);
7879

79-
LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
80+
LLVM_C_ABI LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
8081

8182
/**
8283
* @}

llvm/include/llvm-c/BitWriter.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "llvm-c/ExternC.h"
2323
#include "llvm-c/Types.h"
24+
#include "llvm/Support/Compiler.h"
2425

2526
LLVM_C_EXTERN_C_BEGIN
2627

@@ -34,18 +35,18 @@ LLVM_C_EXTERN_C_BEGIN
3435
/*===-- Operations on modules ---------------------------------------------===*/
3536

3637
/** Writes a module to the specified path. Returns 0 on success. */
37-
int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
38+
LLVM_C_ABI int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
3839

3940
/** Writes a module to an open file descriptor. Returns 0 on success. */
40-
int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
41+
LLVM_C_ABI int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
4142
int Unbuffered);
4243

4344
/** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file
4445
descriptor. Returns 0 on success. Closes the Handle. */
45-
int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
46+
LLVM_C_ABI int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
4647

4748
/** Writes a module to a new memory buffer and returns it. */
48-
LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
49+
LLVM_C_ABI LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
4950

5051
/**
5152
* @}

llvm/include/llvm-c/Comdat.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "llvm-c/ExternC.h"
1818
#include "llvm-c/Types.h"
19+
#include "llvm/Support/Compiler.h"
1920

2021
LLVM_C_EXTERN_C_BEGIN
2122

@@ -43,35 +44,35 @@ typedef enum {
4344
*
4445
* @see llvm::Module::getOrInsertComdat()
4546
*/
46-
LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
47+
LLVM_C_ABI LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
4748

4849
/**
4950
* Get the Comdat assigned to the given global object.
5051
*
5152
* @see llvm::GlobalObject::getComdat()
5253
*/
53-
LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
54+
LLVM_C_ABI LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
5455

5556
/**
5657
* Assign the Comdat to the given global object.
5758
*
5859
* @see llvm::GlobalObject::setComdat()
5960
*/
60-
void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
61+
LLVM_C_ABI void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
6162

6263
/*
6364
* Get the conflict resolution selection kind for the Comdat.
6465
*
6566
* @see llvm::Comdat::getSelectionKind()
6667
*/
67-
LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
68+
LLVM_C_ABI LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
6869

6970
/*
7071
* Set the conflict resolution selection kind for the Comdat.
7172
*
7273
* @see llvm::Comdat::setSelectionKind()
7374
*/
74-
void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
75+
LLVM_C_ABI void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
7576

7677
/**
7778
* @}

0 commit comments

Comments
 (0)