Skip to content

Commit 763b6cb

Browse files
committed
rustc_llvm: Update the Attribute bitflags and remove OtherAttribute.
1 parent 1d7c9bd commit 763b6cb

File tree

1 file changed

+25
-40
lines changed

1 file changed

+25
-40
lines changed

src/librustc_llvm/lib.rs

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -151,41 +151,40 @@ bitflags! {
151151
const OptimizeForSize = 1 << 13,
152152
const StackProtect = 1 << 14,
153153
const StackProtectReq = 1 << 15,
154-
const Alignment = 1 << 16,
155154
const NoCapture = 1 << 21,
156155
const NoRedZone = 1 << 22,
157156
const NoImplicitFloat = 1 << 23,
158157
const Naked = 1 << 24,
159158
const InlineHint = 1 << 25,
160-
const Stack = 7 << 26,
161159
const ReturnsTwice = 1 << 29,
162160
const UWTable = 1 << 30,
163161
const NonLazyBind = 1 << 31,
164-
const OptimizeNone = 1 << 42,
165-
}
166-
}
167162

168-
169-
#[repr(u64)]
170-
#[derive(Copy, Clone)]
171-
pub enum OtherAttribute {
172-
// The following are not really exposed in
173-
// the LLVM C api so instead to add these
174-
// we call a wrapper function in RustWrapper
175-
// that uses the C++ api.
176-
SanitizeAddressAttribute = 1 << 32,
177-
MinSizeAttribute = 1 << 33,
178-
NoDuplicateAttribute = 1 << 34,
179-
StackProtectStrongAttribute = 1 << 35,
180-
SanitizeThreadAttribute = 1 << 36,
181-
SanitizeMemoryAttribute = 1 << 37,
182-
NoBuiltinAttribute = 1 << 38,
183-
ReturnedAttribute = 1 << 39,
184-
ColdAttribute = 1 << 40,
185-
BuiltinAttribute = 1 << 41,
186-
OptimizeNoneAttribute = 1 << 42,
187-
InAllocaAttribute = 1 << 43,
188-
NonNullAttribute = 1 << 44,
163+
// Some of these are missing from the LLVM C API, the rest are
164+
// present, but commented out, and preceded by the following warning:
165+
// FIXME: These attributes are currently not included in the C API as
166+
// a temporary measure until the API/ABI impact to the C API is understood
167+
// and the path forward agreed upon.
168+
const SanitizeAddress = 1 << 32;
169+
const MinSize = 1 << 33;
170+
const NoDuplicate = 1 << 34;
171+
const StackProtectStrong = 1 << 35;
172+
const SanitizeThread = 1 << 36;
173+
const SanitizeMemory = 1 << 37;
174+
const NoBuiltin = 1 << 38;
175+
const Returned = 1 << 39;
176+
const Cold = 1 << 40;
177+
const Builtin = 1 << 41;
178+
const OptimizeNone = 1 << 42;
179+
const InAlloca = 1 << 43;
180+
const NonNull = 1 << 44;
181+
const JumpTable = 1 << 45;
182+
const Convergent = 1 << 46;
183+
const SafeStack = 1 << 47;
184+
const NoRecurse = 1 << 48;
185+
const InaccessibleMemOnly = 1 << 49;
186+
const InaccessibleMemOrArgMemOnly = 1 << 50;
187+
}
189188
}
190189

191190
#[derive(Copy, Clone)]
@@ -219,20 +218,6 @@ impl AttrHelper for Attribute {
219218
}
220219
}
221220

222-
impl AttrHelper for OtherAttribute {
223-
fn apply_llfn(&self, idx: c_uint, llfn: ValueRef) {
224-
unsafe {
225-
LLVMAddFunctionAttribute(llfn, idx, *self as uint64_t);
226-
}
227-
}
228-
229-
fn apply_callsite(&self, idx: c_uint, callsite: ValueRef) {
230-
unsafe {
231-
LLVMAddCallSiteAttribute(callsite, idx, *self as uint64_t);
232-
}
233-
}
234-
}
235-
236221
impl AttrHelper for SpecialAttribute {
237222
fn apply_llfn(&self, idx: c_uint, llfn: ValueRef) {
238223
match *self {

0 commit comments

Comments
 (0)