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.attribute;
7 
8 import std.typecons : Nullable;
9 
10 import llvm_hiwrap.types;
11 import llvm_hiwrap.value.value;
12 
13 struct Attribute {
14     import llvm;
15 
16     LxAttribute lx;
17     alias lx this;
18 
19     /**
20      * Return an unique id given the name of a enum attribute,
21      * or 0 if no attribute by that name exists.
22      *
23      * See http://llvm.org/docs/LangRef.html#parameter-attributes
24      * and http://llvm.org/docs/LangRef.html#function-attributes
25      * for the list of available attributes.
26      *
27      * NB: Attribute names and/or id are subject to change without
28      * going through the C API deprecation cycle.
29      */
30     //unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen);
31     //unsigned LLVMGetLastEnumAttributeKind(void);
32 
33     /**
34      * Create an enum attribute.
35      */
36     //LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID,
37     //                                         uint64_t Val);
38     //
39     /**
40      * Get the unique id corresponding to the enum attribute
41      * passed as argument.
42      */
43     //unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A);
44 
45     /**
46      * Get the enum attribute's value. 0 is returned if none exists.
47      */
48     //uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A);
49 
50     /**
51      * Create a string attribute.
52      */
53     //LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
54     //                                           const char *K, unsigned KLength,
55     //                                           const char *V, unsigned VLength);
56     //
57     /**
58      * Get the string attribute's kind.
59      */
60     //const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
61 
62     /**
63      * Get the string attribute's value.
64      */
65     //const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
66 
67     /**
68      * Check for the different types of attributes.
69      */
70     //LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A);
71     //LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A);
72 }