about summary refs log tree commit diff
path: root/src/rustllvm/rustllvm.h
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2016-11-16 23:36:08 +0100
committerRobin Kruppe <robin.kruppe@gmail.com>2016-11-17 21:12:26 +0100
commit30daedf60355d105d92ad011b9e115b01350593e (patch)
treee7c0fa4e45b5620d621aa137844c2dc9b73fb521 /src/rustllvm/rustllvm.h
parent5887ee5018c064805a97af9e8331c3bf9571d9e5 (diff)
downloadrust-30daedf60355d105d92ad011b9e115b01350593e.tar.gz
rust-30daedf60355d105d92ad011b9e115b01350593e.zip
Use llvm::Attribute API instead of "raw value" APIs, which will be removed in LLVM 4.0.
The librustc_llvm API remains mostly unchanged, except that llvm::Attribute is no longer a bitflag but represents only a *single* attribute.
The ability to store many attributes in a small number of bits and modify them without interacting with LLVM is only used in rustc_trans::abi and closely related modules, and only attributes for function arguments are considered there.
Thus rustc_trans::abi now has its own bit-packed representation of argument attributes, which are translated to rustc_llvm::Attribute when applying the attributes.
Diffstat (limited to 'src/rustllvm/rustllvm.h')
-rw-r--r--src/rustllvm/rustllvm.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/rustllvm/rustllvm.h b/src/rustllvm/rustllvm.h
index ffe94d1e22f..346153d578c 100644
--- a/src/rustllvm/rustllvm.h
+++ b/src/rustllvm/rustllvm.h
@@ -72,6 +72,28 @@ enum class LLVMRustResult {
     Failure
 };
 
+enum LLVMRustAttribute {
+    AlwaysInline    = 0,
+    ByVal           = 1,
+    Cold            = 2,
+    InlineHint      = 3,
+    MinSize         = 4,
+    Naked           = 5,
+    NoAlias         = 6,
+    NoCapture       = 7,
+    NoInline        = 8,
+    NonNull         = 9,
+    NoRedZone       = 10,
+    NoReturn        = 11,
+    NoUnwind        = 12,
+    OptimizeForSize = 13,
+    ReadOnly        = 14,
+    SExt            = 15,
+    StructRet       = 16,
+    UWTable         = 17,
+    ZExt            = 18,
+};
+
 typedef struct OpaqueRustString *RustStringRef;
 typedef struct LLVMOpaqueTwine *LLVMTwineRef;
 typedef struct LLVMOpaqueDebugLoc *LLVMDebugLocRef;