diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-02-25 15:35:56 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-03-17 21:51:51 +0200 |
| commit | 763b6cba37438d16156f7b3c372e2f34f2def623 (patch) | |
| tree | ca034f7e062b2f8603833927265da50ac39a960d | |
| parent | 1d7c9bd137b883623921a7befb57ed8781a0e614 (diff) | |
rustc_llvm: Update the Attribute bitflags and remove OtherAttribute.
| -rw-r--r-- | src/librustc_llvm/lib.rs | 65 |
1 files changed, 25 insertions, 40 deletions
diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index e216dcd1c97..aa7fdfaf676 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -151,41 +151,40 @@ bitflags! { const OptimizeForSize = 1 << 13, const StackProtect = 1 << 14, const StackProtectReq = 1 << 15, - const Alignment = 1 << 16, const NoCapture = 1 << 21, const NoRedZone = 1 << 22, const NoImplicitFloat = 1 << 23, const Naked = 1 << 24, const InlineHint = 1 << 25, - const Stack = 7 << 26, const ReturnsTwice = 1 << 29, const UWTable = 1 << 30, const NonLazyBind = 1 << 31, - const OptimizeNone = 1 << 42, - } -} - -#[repr(u64)] -#[derive(Copy, Clone)] -pub enum OtherAttribute { - // The following are not really exposed in - // the LLVM C api so instead to add these - // we call a wrapper function in RustWrapper - // that uses the C++ api. - SanitizeAddressAttribute = 1 << 32, - MinSizeAttribute = 1 << 33, - NoDuplicateAttribute = 1 << 34, - StackProtectStrongAttribute = 1 << 35, - SanitizeThreadAttribute = 1 << 36, - SanitizeMemoryAttribute = 1 << 37, - NoBuiltinAttribute = 1 << 38, - ReturnedAttribute = 1 << 39, - ColdAttribute = 1 << 40, - BuiltinAttribute = 1 << 41, - OptimizeNoneAttribute = 1 << 42, - InAllocaAttribute = 1 << 43, - NonNullAttribute = 1 << 44, + // Some of these are missing from the LLVM C API, the rest are + // present, but commented out, and preceded by the following warning: + // FIXME: These attributes are currently not included in the C API as + // a temporary measure until the API/ABI impact to the C API is understood + // and the path forward agreed upon. + const SanitizeAddress = 1 << 32; + const MinSize = 1 << 33; + const NoDuplicate = 1 << 34; + const StackProtectStrong = 1 << 35; + const SanitizeThread = 1 << 36; + const SanitizeMemory = 1 << 37; + const NoBuiltin = 1 << 38; + const Returned = 1 << 39; + const Cold = 1 << 40; + const Builtin = 1 << 41; + const OptimizeNone = 1 << 42; + const InAlloca = 1 << 43; + const NonNull = 1 << 44; + const JumpTable = 1 << 45; + const Convergent = 1 << 46; + const SafeStack = 1 << 47; + const NoRecurse = 1 << 48; + const InaccessibleMemOnly = 1 << 49; + const InaccessibleMemOrArgMemOnly = 1 << 50; + } } #[derive(Copy, Clone)] @@ -219,20 +218,6 @@ impl AttrHelper for Attribute { } } -impl AttrHelper for OtherAttribute { - fn apply_llfn(&self, idx: c_uint, llfn: ValueRef) { - unsafe { - LLVMAddFunctionAttribute(llfn, idx, *self as uint64_t); - } - } - - fn apply_callsite(&self, idx: c_uint, callsite: ValueRef) { - unsafe { - LLVMAddCallSiteAttribute(callsite, idx, *self as uint64_t); - } - } -} - impl AttrHelper for SpecialAttribute { fn apply_llfn(&self, idx: c_uint, llfn: ValueRef) { match *self { |
