Skip to content

Commit 9359be7

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163670 b: refs/heads/snap-stage3 c: 463475b h: refs/heads/master v: v3
1 parent 5f8985e commit 9359be7

File tree

3 files changed

+23
-50
lines changed

3 files changed

+23
-50
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: db45be2616edb658427fb4986d2418b22150cb16
4+
refs/heads/snap-stage3: 463475b7fa95cfeddbe9e153b1fdf408965252da
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_llvm/diagnostic.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ use libc::c_char;
1717

1818
use {ValueRef, TwineRef, DebugLocRef, DiagnosticInfoRef};
1919

20+
#[deriving(Copy)]
2021
pub enum OptimizationDiagnosticKind {
2122
OptimizationRemark,
2223
OptimizationMissed,
2324
OptimizationAnalysis,
2425
OptimizationFailure,
2526
}
2627

27-
impl Copy for OptimizationDiagnosticKind {}
28-
2928
impl OptimizationDiagnosticKind {
3029
pub fn describe(self) -> &'static str {
3130
match self {
@@ -69,15 +68,14 @@ impl OptimizationDiagnostic {
6968
}
7069
}
7170

71+
#[deriving(Copy)]
7272
pub enum Diagnostic {
7373
Optimization(OptimizationDiagnostic),
7474

7575
/// LLVM has other types that we do not wrap here.
7676
UnknownDiagnostic(DiagnosticInfoRef),
7777
}
7878

79-
impl Copy for Diagnostic {}
80-
8179
impl Diagnostic {
8280
pub unsafe fn unpack(di: DiagnosticInfoRef) -> Diagnostic {
8381
let kind = super::LLVMGetDiagInfoKind(di);

branches/snap-stage3/src/librustc_llvm/lib.rs

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub const False: Bool = 0 as Bool;
6868

6969
// Consts for the LLVM CallConv type, pre-cast to uint.
7070

71-
#[deriving(PartialEq)]
71+
#[deriving(Copy, PartialEq)]
7272
pub enum CallConv {
7373
CCallConv = 0,
7474
FastCallConv = 8,
@@ -78,20 +78,18 @@ pub enum CallConv {
7878
X86_64_Win64 = 79,
7979
}
8080

81-
impl Copy for CallConv {}
82-
81+
#[deriving(Copy)]
8382
pub enum Visibility {
8483
LLVMDefaultVisibility = 0,
8584
HiddenVisibility = 1,
8685
ProtectedVisibility = 2,
8786
}
8887

89-
impl Copy for Visibility {}
90-
9188
// This enum omits the obsolete (and no-op) linkage types DLLImportLinkage,
9289
// DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
9390
// LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
9491
// they've been removed in upstream LLVM commit r203866.
92+
#[deriving(Copy)]
9593
pub enum Linkage {
9694
ExternalLinkage = 0,
9795
AvailableExternallyLinkage = 1,
@@ -106,19 +104,15 @@ pub enum Linkage {
106104
CommonLinkage = 14,
107105
}
108106

109-
impl Copy for Linkage {}
110-
111107
#[repr(C)]
112-
#[deriving(Show)]
108+
#[deriving(Copy, Show)]
113109
pub enum DiagnosticSeverity {
114110
Error,
115111
Warning,
116112
Remark,
117113
Note,
118114
}
119115

120-
impl Copy for DiagnosticSeverity {}
121-
122116
bitflags! {
123117
flags Attribute : u32 {
124118
const ZExtAttribute = 1 << 0,
@@ -152,6 +146,7 @@ bitflags! {
152146

153147

154148
#[repr(u64)]
149+
#[deriving(Copy)]
155150
pub enum OtherAttribute {
156151
// The following are not really exposed in
157152
// the LLVM c api so instead to add these
@@ -172,22 +167,18 @@ pub enum OtherAttribute {
172167
NonNullAttribute = 1 << 44,
173168
}
174169

175-
impl Copy for OtherAttribute {}
176-
170+
#[deriving(Copy)]
177171
pub enum SpecialAttribute {
178172
DereferenceableAttribute(u64)
179173
}
180174

181-
impl Copy for SpecialAttribute {}
182-
183175
#[repr(C)]
176+
#[deriving(Copy)]
184177
pub enum AttributeSet {
185178
ReturnIndex = 0,
186179
FunctionIndex = !0
187180
}
188181

189-
impl Copy for AttributeSet {}
190-
191182
pub trait AttrHelper {
192183
fn apply_llfn(&self, idx: c_uint, llfn: ValueRef);
193184
fn apply_callsite(&self, idx: c_uint, callsite: ValueRef);
@@ -274,6 +265,7 @@ impl AttrBuilder {
274265
}
275266

276267
// enum for the LLVM IntPredicate type
268+
#[deriving(Copy)]
277269
pub enum IntPredicate {
278270
IntEQ = 32,
279271
IntNE = 33,
@@ -287,9 +279,8 @@ pub enum IntPredicate {
287279
IntSLE = 41,
288280
}
289281

290-
impl Copy for IntPredicate {}
291-
292282
// enum for the LLVM RealPredicate type
283+
#[deriving(Copy)]
293284
pub enum RealPredicate {
294285
RealPredicateFalse = 0,
295286
RealOEQ = 1,
@@ -309,11 +300,9 @@ pub enum RealPredicate {
309300
RealPredicateTrue = 15,
310301
}
311302

312-
impl Copy for RealPredicate {}
313-
314303
// The LLVM TypeKind type - must stay in sync with the def of
315304
// LLVMTypeKind in llvm/include/llvm-c/Core.h
316-
#[deriving(PartialEq)]
305+
#[deriving(Copy, PartialEq)]
317306
#[repr(C)]
318307
pub enum TypeKind {
319308
Void = 0,
@@ -334,9 +323,8 @@ pub enum TypeKind {
334323
X86_MMX = 15,
335324
}
336325

337-
impl Copy for TypeKind {}
338-
339326
#[repr(C)]
327+
#[deriving(Copy)]
340328
pub enum AtomicBinOp {
341329
AtomicXchg = 0,
342330
AtomicAdd = 1,
@@ -351,9 +339,8 @@ pub enum AtomicBinOp {
351339
AtomicUMin = 10,
352340
}
353341

354-
impl Copy for AtomicBinOp {}
355-
356342
#[repr(C)]
343+
#[deriving(Copy)]
357344
pub enum AtomicOrdering {
358345
NotAtomic = 0,
359346
Unordered = 1,
@@ -365,17 +352,15 @@ pub enum AtomicOrdering {
365352
SequentiallyConsistent = 7
366353
}
367354

368-
impl Copy for AtomicOrdering {}
369-
370355
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
371356
#[repr(C)]
357+
#[deriving(Copy)]
372358
pub enum FileType {
373359
AssemblyFileType = 0,
374360
ObjectFileType = 1
375361
}
376362

377-
impl Copy for FileType {}
378-
363+
#[deriving(Copy)]
379364
pub enum MetadataType {
380365
MD_dbg = 0,
381366
MD_tbaa = 1,
@@ -385,17 +370,14 @@ pub enum MetadataType {
385370
MD_tbaa_struct = 5
386371
}
387372

388-
impl Copy for MetadataType {}
389-
390373
// Inline Asm Dialect
374+
#[deriving(Copy)]
391375
pub enum AsmDialect {
392376
AD_ATT = 0,
393377
AD_Intel = 1
394378
}
395379

396-
impl Copy for AsmDialect {}
397-
398-
#[deriving(PartialEq, Clone)]
380+
#[deriving(Copy, PartialEq, Clone)]
399381
#[repr(C)]
400382
pub enum CodeGenOptLevel {
401383
CodeGenLevelNone = 0,
@@ -404,9 +386,7 @@ pub enum CodeGenOptLevel {
404386
CodeGenLevelAggressive = 3,
405387
}
406388

407-
impl Copy for CodeGenOptLevel {}
408-
409-
#[deriving(PartialEq)]
389+
#[deriving(Copy, PartialEq)]
410390
#[repr(C)]
411391
pub enum RelocMode {
412392
RelocDefault = 0,
@@ -415,9 +395,8 @@ pub enum RelocMode {
415395
RelocDynamicNoPic = 3,
416396
}
417397

418-
impl Copy for RelocMode {}
419-
420398
#[repr(C)]
399+
#[deriving(Copy)]
421400
pub enum CodeGenModel {
422401
CodeModelDefault = 0,
423402
CodeModelJITDefault = 1,
@@ -427,9 +406,8 @@ pub enum CodeGenModel {
427406
CodeModelLarge = 5,
428407
}
429408

430-
impl Copy for CodeGenModel {}
431-
432409
#[repr(C)]
410+
#[deriving(Copy)]
433411
pub enum DiagnosticKind {
434412
DK_InlineAsm = 0,
435413
DK_StackSize,
@@ -441,8 +419,6 @@ pub enum DiagnosticKind {
441419
DK_OptimizationFailure,
442420
}
443421

444-
impl Copy for DiagnosticKind {}
445-
446422
// Opaque pointer types
447423
#[allow(missing_copy_implementations)]
448424
pub enum Module_opaque {}
@@ -537,6 +513,7 @@ pub mod debuginfo {
537513
pub type DIArray = DIDescriptor;
538514
pub type DISubrange = DIDescriptor;
539515

516+
#[deriving(Copy)]
540517
pub enum DIDescriptorFlags {
541518
FlagPrivate = 1 << 0,
542519
FlagProtected = 1 << 1,
@@ -555,8 +532,6 @@ pub mod debuginfo {
555532
FlagLValueReference = 1 << 14,
556533
FlagRValueReference = 1 << 15
557534
}
558-
559-
impl Copy for DIDescriptorFlags {}
560535
}
561536

562537

0 commit comments

Comments
 (0)