// Consts for the LLVM CallConv type, pre-cast to uint.
-#[deriving(PartialEq)]
+#[deriving(Copy, PartialEq)]
pub enum CallConv {
CCallConv = 0,
FastCallConv = 8,
X86_64_Win64 = 79,
}
-impl Copy for CallConv {}
-
+#[deriving(Copy)]
pub enum Visibility {
LLVMDefaultVisibility = 0,
HiddenVisibility = 1,
ProtectedVisibility = 2,
}
-impl Copy for Visibility {}
-
// This enum omits the obsolete (and no-op) linkage types DLLImportLinkage,
// DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
// LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
// they've been removed in upstream LLVM commit r203866.
+#[deriving(Copy)]
pub enum Linkage {
ExternalLinkage = 0,
AvailableExternallyLinkage = 1,
CommonLinkage = 14,
}
-impl Copy for Linkage {}
-
#[repr(C)]
-#[deriving(Show)]
+#[deriving(Copy, Show)]
pub enum DiagnosticSeverity {
Error,
Warning,
Note,
}
-impl Copy for DiagnosticSeverity {}
-
bitflags! {
flags Attribute : u32 {
const ZExtAttribute = 1 << 0,
#[repr(u64)]
+#[deriving(Copy)]
pub enum OtherAttribute {
// The following are not really exposed in
// the LLVM c api so instead to add these
NonNullAttribute = 1 << 44,
}
-impl Copy for OtherAttribute {}
-
+#[deriving(Copy)]
pub enum SpecialAttribute {
DereferenceableAttribute(u64)
}
-impl Copy for SpecialAttribute {}
-
#[repr(C)]
+#[deriving(Copy)]
pub enum AttributeSet {
ReturnIndex = 0,
FunctionIndex = !0
}
-impl Copy for AttributeSet {}
-
pub trait AttrHelper {
fn apply_llfn(&self, idx: c_uint, llfn: ValueRef);
fn apply_callsite(&self, idx: c_uint, callsite: ValueRef);
}
// enum for the LLVM IntPredicate type
+#[deriving(Copy)]
pub enum IntPredicate {
IntEQ = 32,
IntNE = 33,
IntSLE = 41,
}
-impl Copy for IntPredicate {}
-
// enum for the LLVM RealPredicate type
+#[deriving(Copy)]
pub enum RealPredicate {
RealPredicateFalse = 0,
RealOEQ = 1,
RealPredicateTrue = 15,
}
-impl Copy for RealPredicate {}
-
// The LLVM TypeKind type - must stay in sync with the def of
// LLVMTypeKind in llvm/include/llvm-c/Core.h
-#[deriving(PartialEq)]
+#[deriving(Copy, PartialEq)]
#[repr(C)]
pub enum TypeKind {
Void = 0,
X86_MMX = 15,
}
-impl Copy for TypeKind {}
-
#[repr(C)]
+#[deriving(Copy)]
pub enum AtomicBinOp {
AtomicXchg = 0,
AtomicAdd = 1,
AtomicUMin = 10,
}
-impl Copy for AtomicBinOp {}
-
#[repr(C)]
+#[deriving(Copy)]
pub enum AtomicOrdering {
NotAtomic = 0,
Unordered = 1,
SequentiallyConsistent = 7
}
-impl Copy for AtomicOrdering {}
-
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
#[repr(C)]
+#[deriving(Copy)]
pub enum FileType {
AssemblyFileType = 0,
ObjectFileType = 1
}
-impl Copy for FileType {}
-
+#[deriving(Copy)]
pub enum MetadataType {
MD_dbg = 0,
MD_tbaa = 1,
MD_tbaa_struct = 5
}
-impl Copy for MetadataType {}
-
// Inline Asm Dialect
+#[deriving(Copy)]
pub enum AsmDialect {
AD_ATT = 0,
AD_Intel = 1
}
-impl Copy for AsmDialect {}
-
-#[deriving(PartialEq, Clone)]
+#[deriving(Copy, PartialEq, Clone)]
#[repr(C)]
pub enum CodeGenOptLevel {
CodeGenLevelNone = 0,
CodeGenLevelAggressive = 3,
}
-impl Copy for CodeGenOptLevel {}
-
-#[deriving(PartialEq)]
+#[deriving(Copy, PartialEq)]
#[repr(C)]
pub enum RelocMode {
RelocDefault = 0,
RelocDynamicNoPic = 3,
}
-impl Copy for RelocMode {}
-
#[repr(C)]
+#[deriving(Copy)]
pub enum CodeGenModel {
CodeModelDefault = 0,
CodeModelJITDefault = 1,
CodeModelLarge = 5,
}
-impl Copy for CodeGenModel {}
-
#[repr(C)]
+#[deriving(Copy)]
pub enum DiagnosticKind {
DK_InlineAsm = 0,
DK_StackSize,
DK_OptimizationFailure,
}
-impl Copy for DiagnosticKind {}
-
// Opaque pointer types
#[allow(missing_copy_implementations)]
pub enum Module_opaque {}
pub type DIArray = DIDescriptor;
pub type DISubrange = DIDescriptor;
+ #[deriving(Copy)]
pub enum DIDescriptorFlags {
FlagPrivate = 1 << 0,
FlagProtected = 1 << 1,
FlagLValueReference = 1 << 14,
FlagRValueReference = 1 << 15
}
-
- impl Copy for DIDescriptorFlags {}
}