@@ -68,7 +68,7 @@ pub const False: Bool = 0 as Bool;
68
68
69
69
// Consts for the LLVM CallConv type, pre-cast to uint.
70
70
71
- #[ deriving( PartialEq ) ]
71
+ #[ deriving( Copy , PartialEq ) ]
72
72
pub enum CallConv {
73
73
CCallConv = 0 ,
74
74
FastCallConv = 8 ,
@@ -78,20 +78,18 @@ pub enum CallConv {
78
78
X86_64_Win64 = 79 ,
79
79
}
80
80
81
- impl Copy for CallConv { }
82
-
81
+ #[ deriving( Copy ) ]
83
82
pub enum Visibility {
84
83
LLVMDefaultVisibility = 0 ,
85
84
HiddenVisibility = 1 ,
86
85
ProtectedVisibility = 2 ,
87
86
}
88
87
89
- impl Copy for Visibility { }
90
-
91
88
// This enum omits the obsolete (and no-op) linkage types DLLImportLinkage,
92
89
// DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
93
90
// LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
94
91
// they've been removed in upstream LLVM commit r203866.
92
+ #[ deriving( Copy ) ]
95
93
pub enum Linkage {
96
94
ExternalLinkage = 0 ,
97
95
AvailableExternallyLinkage = 1 ,
@@ -106,19 +104,15 @@ pub enum Linkage {
106
104
CommonLinkage = 14 ,
107
105
}
108
106
109
- impl Copy for Linkage { }
110
-
111
107
#[ repr( C ) ]
112
- #[ deriving( Show ) ]
108
+ #[ deriving( Copy , Show ) ]
113
109
pub enum DiagnosticSeverity {
114
110
Error ,
115
111
Warning ,
116
112
Remark ,
117
113
Note ,
118
114
}
119
115
120
- impl Copy for DiagnosticSeverity { }
121
-
122
116
bitflags ! {
123
117
flags Attribute : u32 {
124
118
const ZExtAttribute = 1 << 0 ,
@@ -152,6 +146,7 @@ bitflags! {
152
146
153
147
154
148
#[ repr( u64 ) ]
149
+ #[ deriving( Copy ) ]
155
150
pub enum OtherAttribute {
156
151
// The following are not really exposed in
157
152
// the LLVM c api so instead to add these
@@ -172,22 +167,18 @@ pub enum OtherAttribute {
172
167
NonNullAttribute = 1 << 44 ,
173
168
}
174
169
175
- impl Copy for OtherAttribute { }
176
-
170
+ #[ deriving( Copy ) ]
177
171
pub enum SpecialAttribute {
178
172
DereferenceableAttribute ( u64 )
179
173
}
180
174
181
- impl Copy for SpecialAttribute { }
182
-
183
175
#[ repr( C ) ]
176
+ #[ deriving( Copy ) ]
184
177
pub enum AttributeSet {
185
178
ReturnIndex = 0 ,
186
179
FunctionIndex = !0
187
180
}
188
181
189
- impl Copy for AttributeSet { }
190
-
191
182
pub trait AttrHelper {
192
183
fn apply_llfn ( & self , idx : c_uint , llfn : ValueRef ) ;
193
184
fn apply_callsite ( & self , idx : c_uint , callsite : ValueRef ) ;
@@ -274,6 +265,7 @@ impl AttrBuilder {
274
265
}
275
266
276
267
// enum for the LLVM IntPredicate type
268
+ #[ deriving( Copy ) ]
277
269
pub enum IntPredicate {
278
270
IntEQ = 32 ,
279
271
IntNE = 33 ,
@@ -287,9 +279,8 @@ pub enum IntPredicate {
287
279
IntSLE = 41 ,
288
280
}
289
281
290
- impl Copy for IntPredicate { }
291
-
292
282
// enum for the LLVM RealPredicate type
283
+ #[ deriving( Copy ) ]
293
284
pub enum RealPredicate {
294
285
RealPredicateFalse = 0 ,
295
286
RealOEQ = 1 ,
@@ -309,11 +300,9 @@ pub enum RealPredicate {
309
300
RealPredicateTrue = 15 ,
310
301
}
311
302
312
- impl Copy for RealPredicate { }
313
-
314
303
// The LLVM TypeKind type - must stay in sync with the def of
315
304
// LLVMTypeKind in llvm/include/llvm-c/Core.h
316
- #[ deriving( PartialEq ) ]
305
+ #[ deriving( Copy , PartialEq ) ]
317
306
#[ repr( C ) ]
318
307
pub enum TypeKind {
319
308
Void = 0 ,
@@ -334,9 +323,8 @@ pub enum TypeKind {
334
323
X86_MMX = 15 ,
335
324
}
336
325
337
- impl Copy for TypeKind { }
338
-
339
326
#[ repr( C ) ]
327
+ #[ deriving( Copy ) ]
340
328
pub enum AtomicBinOp {
341
329
AtomicXchg = 0 ,
342
330
AtomicAdd = 1 ,
@@ -351,9 +339,8 @@ pub enum AtomicBinOp {
351
339
AtomicUMin = 10 ,
352
340
}
353
341
354
- impl Copy for AtomicBinOp { }
355
-
356
342
#[ repr( C ) ]
343
+ #[ deriving( Copy ) ]
357
344
pub enum AtomicOrdering {
358
345
NotAtomic = 0 ,
359
346
Unordered = 1 ,
@@ -365,17 +352,15 @@ pub enum AtomicOrdering {
365
352
SequentiallyConsistent = 7
366
353
}
367
354
368
- impl Copy for AtomicOrdering { }
369
-
370
355
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
371
356
#[ repr( C ) ]
357
+ #[ deriving( Copy ) ]
372
358
pub enum FileType {
373
359
AssemblyFileType = 0 ,
374
360
ObjectFileType = 1
375
361
}
376
362
377
- impl Copy for FileType { }
378
-
363
+ #[ deriving( Copy ) ]
379
364
pub enum MetadataType {
380
365
MD_dbg = 0 ,
381
366
MD_tbaa = 1 ,
@@ -385,17 +370,14 @@ pub enum MetadataType {
385
370
MD_tbaa_struct = 5
386
371
}
387
372
388
- impl Copy for MetadataType { }
389
-
390
373
// Inline Asm Dialect
374
+ #[ deriving( Copy ) ]
391
375
pub enum AsmDialect {
392
376
AD_ATT = 0 ,
393
377
AD_Intel = 1
394
378
}
395
379
396
- impl Copy for AsmDialect { }
397
-
398
- #[ deriving( PartialEq , Clone ) ]
380
+ #[ deriving( Copy , PartialEq , Clone ) ]
399
381
#[ repr( C ) ]
400
382
pub enum CodeGenOptLevel {
401
383
CodeGenLevelNone = 0 ,
@@ -404,9 +386,7 @@ pub enum CodeGenOptLevel {
404
386
CodeGenLevelAggressive = 3 ,
405
387
}
406
388
407
- impl Copy for CodeGenOptLevel { }
408
-
409
- #[ deriving( PartialEq ) ]
389
+ #[ deriving( Copy , PartialEq ) ]
410
390
#[ repr( C ) ]
411
391
pub enum RelocMode {
412
392
RelocDefault = 0 ,
@@ -415,9 +395,8 @@ pub enum RelocMode {
415
395
RelocDynamicNoPic = 3 ,
416
396
}
417
397
418
- impl Copy for RelocMode { }
419
-
420
398
#[ repr( C ) ]
399
+ #[ deriving( Copy ) ]
421
400
pub enum CodeGenModel {
422
401
CodeModelDefault = 0 ,
423
402
CodeModelJITDefault = 1 ,
@@ -427,9 +406,8 @@ pub enum CodeGenModel {
427
406
CodeModelLarge = 5 ,
428
407
}
429
408
430
- impl Copy for CodeGenModel { }
431
-
432
409
#[ repr( C ) ]
410
+ #[ deriving( Copy ) ]
433
411
pub enum DiagnosticKind {
434
412
DK_InlineAsm = 0 ,
435
413
DK_StackSize ,
@@ -441,8 +419,6 @@ pub enum DiagnosticKind {
441
419
DK_OptimizationFailure ,
442
420
}
443
421
444
- impl Copy for DiagnosticKind { }
445
-
446
422
// Opaque pointer types
447
423
#[ allow( missing_copy_implementations) ]
448
424
pub enum Module_opaque { }
@@ -537,6 +513,7 @@ pub mod debuginfo {
537
513
pub type DIArray = DIDescriptor ;
538
514
pub type DISubrange = DIDescriptor ;
539
515
516
+ #[ deriving( Copy ) ]
540
517
pub enum DIDescriptorFlags {
541
518
FlagPrivate = 1 << 0 ,
542
519
FlagProtected = 1 << 1 ,
@@ -555,8 +532,6 @@ pub mod debuginfo {
555
532
FlagLValueReference = 1 << 14 ,
556
533
FlagRValueReference = 1 << 15
557
534
}
558
-
559
- impl Copy for DIDescriptorFlags { }
560
535
}
561
536
562
537
0 commit comments