[PATCH] C API: Add functions to get or set a GlobalValue's DLLStorageClass.
Reid Kleckner
rnk at google.com
Tue Mar 4 18:40:54 PST 2014
Looks good, committed in r202928.
On Sun, Mar 2, 2014 at 12:36 PM, Manuel Jacob <me at manueljacob.de> wrote:
> http://llvm-reviews.chandlerc.com/D2918
>
> Files:
> include/llvm-c/Core.h
> lib/IR/Core.cpp
>
> Index: include/llvm-c/Core.h
> ===================================================================
> --- include/llvm-c/Core.h
> +++ include/llvm-c/Core.h
> @@ -300,6 +300,12 @@
> } LLVMVisibility;
>
> typedef enum {
> + LLVMDefaultStorageClass = 0,
> + LLVMDLLImportStorageClass = 1, /**< Function to be imported from DLL. */
> + LLVMDLLExportStorageClass = 2 /**< Function to be accessible from DLL.
> */
> +} LLVMDLLStorageClass;
> +
> +typedef enum {
> LLVMCCallConv = 0,
> LLVMFastCallConv = 8,
> LLVMColdCallConv = 9,
> @@ -1689,6 +1695,8 @@
> void LLVMSetSection(LLVMValueRef Global, const char *Section);
> LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
> void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
> +LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global);
> +void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass
> Class);
>
> /**
> * @defgroup LLVMCCoreValueWithAlignment Values with alignment
> Index: lib/IR/Core.cpp
> ===================================================================
> --- lib/IR/Core.cpp
> +++ lib/IR/Core.cpp
> @@ -1252,6 +1252,16 @@
> ->setVisibility(static_cast<GlobalValue::VisibilityTypes>(Viz));
> }
>
> +LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global) {
> + return static_cast<LLVMDLLStorageClass>(
> + unwrap<GlobalValue>(Global)->getDLLStorageClass());
> +}
> +
> +void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass
> Class) {
> + unwrap<GlobalValue>(Global)
> +
> ->setDLLStorageClass(static_cast<GlobalValue::DLLStorageClassTypes>(Class));
> +}
> +
> /*--.. Operations on global variables, load and store instructions
> .........--*/
>
> unsigned LLVMGetAlignment(LLVMValueRef V) {
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140304/7350291f/attachment.html>
More information about the llvm-commits
mailing list