summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d6e0bca)
raw | patch | inline | side by side (parent: d6e0bca)
author | Reid Kleckner <reid@kleckner.net> | |
Wed, 5 Mar 2014 02:34:23 +0000 (02:34 +0000) | ||
committer | Reid Kleckner <reid@kleckner.net> | |
Wed, 5 Mar 2014 02:34:23 +0000 (02:34 +0000) |
Patch by Manuel Jacob!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202928 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202928 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/Core.h | patch | blob | history | |
lib/IR/Core.cpp | patch | blob | history |
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index a84a0313211315d094a9d0a81836b65a353d74fc..af1e01d8e1b9287a47bf69758ca35c7c172a64fe 100644 (file)
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
LLVMProtectedVisibility /**< The GV is protected */
} 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,
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
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp
index 470fef23eb8e506ac1655ec313dc8adeea0ec69d..c78ddae60be0d3a5c80a2bc6fa6641c2483b3b4a 100644 (file)
--- a/lib/IR/Core.cpp
+++ b/lib/IR/Core.cpp
->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) {