1 /**
2 Copyright: Copyright (c) 2017, Joakim Brännström. All rights reserved.
3 License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
4 Author: Joakim Brännström (joakim.brannstrom@gmx.com)
5 */
6 module llvm_hiwrap.value.global;
7 
8 import llvm_hiwrap.types;
9 
10 struct ConstantGlobalValue {
11     LxConstantGlobalValue value;
12     alias value this;
13 
14     /**
15      * @defgroup LLVMCCoreValueConstantGlobals Global Values
16      *
17      * This group contains functions that operate on global values. Functions in
18      * this group relate to functions in the llvm::GlobalValue class tree.
19      *
20      * @see llvm::GlobalValue
21      *
22      * @{
23      */
24 
25     //LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global);
26     //LLVMBool LLVMIsDeclaration(LLVMValueRef Global);
27     //LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
28     //void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
29     //const char *LLVMGetSection(LLVMValueRef Global);
30     //void LLVMSetSection(LLVMValueRef Global, const char *Section);
31     //LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
32     //void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
33     //LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global);
34     //void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class);
35     //LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global);
36     //void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
37 
38     /**
39      * @defgroup LLVMCCoreValueWithAlignment Values with alignment
40      *
41      * Functions in this group only apply to values with alignment, i.e.
42      * global variables, load and store instructions.
43      */
44 
45     /**
46      * Obtain the preferred alignment of the value.
47      * @see llvm::AllocaInst::getAlignment()
48      * @see llvm::LoadInst::getAlignment()
49      * @see llvm::StoreInst::getAlignment()
50      * @see llvm::GlobalValue::getAlignment()
51      */
52     //unsigned LLVMGetAlignment(LLVMValueRef V);
53 
54     /**
55      * Set the preferred alignment of the value.
56      * @see llvm::AllocaInst::setAlignment()
57      * @see llvm::LoadInst::setAlignment()
58      * @see llvm::StoreInst::setAlignment()
59      * @see llvm::GlobalValue::setAlignment()
60      */
61     //void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
62 }
63 
64 struct GlobalValue {
65     LxGlobalValue value;
66     alias value this;
67 
68     /**
69      * @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
70      *
71      * This group contains functions that operate on global variable values.
72      *
73      * @see llvm::GlobalVariable
74      *
75      * @{
76      */
77     //LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
78     //LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty,
79     //                                         const char *Name,
80     //                                         unsigned AddressSpace);
81     //LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name);
82     //LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M);
83     //LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M);
84     //LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar);
85     //LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar);
86     //void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
87     //LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
88     //void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
89     //LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar);
90     //void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
91     //LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
92     //void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
93     //LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar);
94     //void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode);
95     //LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar);
96     //void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
97 }
98 
99 struct GlobalAliasValue {
100     LxGlobalAliasValue value;
101     alias value this;
102 
103     /**
104      * @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
105      *
106      * This group contains function that operate on global alias values.
107      *
108      * @see llvm::GlobalAlias
109      *
110      * @{
111      */
112     //LLVMValueRef LLVMAddAlias(LLVMModuleRef M, LLVMTypeRef Ty, LLVMValueRef Aliasee,
113     //                          const char *Name);
114 }