Skip to content

Commit 57c1a01

Browse files
committed
Remove enum struct return workaround from LLVM bindings.
1 parent e03f17e commit 57c1a01

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/librustc/lib/llvm.rs

+40
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,62 @@ pub enum RealPredicate {
128128

129129
// The LLVM TypeKind type - must stay in sync with the def of
130130
// LLVMTypeKind in llvm/include/llvm-c/Core.h
131+
#[cfg(not(stage0))]
132+
#[deriving(Eq)]
133+
#[repr(C)]
134+
pub enum TypeKind {
135+
Void = 0,
136+
Half = 1,
137+
Float = 2,
138+
Double = 3,
139+
X86_FP80 = 4,
140+
FP128 = 5,
141+
PPC_FP128 = 6,
142+
Label = 7,
143+
Integer = 8,
144+
Function = 9,
145+
Struct = 10,
146+
Array = 11,
147+
Pointer = 12,
148+
Vector = 13,
149+
Metadata = 14,
150+
X86_MMX = 15,
151+
}
152+
153+
// NOTE remove these after snapshot. (See also #10308.)
154+
#[cfg(stage0)]
131155
pub type TypeKind = u32;
156+
#[cfg(stage0)]
132157
pub static Void: TypeKind = 0;
158+
#[cfg(stage0)]
133159
pub static Half: TypeKind = 1;
160+
#[cfg(stage0)]
134161
pub static Float: TypeKind = 2;
162+
#[cfg(stage0)]
135163
pub static Double: TypeKind = 3;
164+
#[cfg(stage0)]
136165
pub static X86_FP80: TypeKind = 4;
166+
#[cfg(stage0)]
137167
pub static FP128: TypeKind = 5;
168+
#[cfg(stage0)]
138169
pub static PPC_FP128: TypeKind = 6;
170+
#[cfg(stage0)]
139171
pub static Label: TypeKind = 7;
172+
#[cfg(stage0)]
140173
pub static Integer: TypeKind = 8;
174+
#[cfg(stage0)]
141175
pub static Function: TypeKind = 9;
176+
#[cfg(stage0)]
142177
pub static Struct: TypeKind = 10;
178+
#[cfg(stage0)]
143179
pub static Array: TypeKind = 11;
180+
#[cfg(stage0)]
144181
pub static Pointer: TypeKind = 12;
182+
#[cfg(stage0)]
145183
pub static Vector: TypeKind = 13;
184+
#[cfg(stage0)]
146185
pub static Metadata: TypeKind = 14;
186+
#[cfg(stage0)]
147187
pub static X86_MMX: TypeKind = 15;
148188

149189
#[repr(C)]

0 commit comments

Comments
 (0)