summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir/analysis/derive_copy.rs2
-rw-r--r--src/ir/comp.rs2
-rw-r--r--src/ir/context.rs40
-rw-r--r--src/ir/item.rs32
4 files changed, 38 insertions, 38 deletions
diff --git a/src/ir/analysis/derive_copy.rs b/src/ir/analysis/derive_copy.rs
index ba8ad500..ba40141e 100644
--- a/src/ir/analysis/derive_copy.rs
+++ b/src/ir/analysis/derive_copy.rs
@@ -224,7 +224,7 @@ impl<'ctx> MonotoneFramework for CannotDeriveCopy<'ctx> {
// NOTE: Take into account that while unions in C and C++ are copied by
// default, the may have an explicit destructor in C++, so we can't
// defer this check just for the union case.
- if self.ctx.lookup_item_id_has_destructor(id.expect_type_id(self.ctx)) {
+ if self.ctx.lookup_has_destructor(id.expect_type_id(self.ctx)) {
trace!(" comp has destructor which cannot derive copy");
return self.insert(id);
}
diff --git a/src/ir/comp.rs b/src/ir/comp.rs
index caa02243..c1dd369b 100644
--- a/src/ir/comp.rs
+++ b/src/ir/comp.rs
@@ -912,7 +912,7 @@ impl CompInfo {
/// Is this compound type unsized?
pub fn is_unsized(&self, ctx: &BindgenContext, id: TypeId) -> bool {
- !ctx.lookup_item_id_has_vtable(id) && self.fields().is_empty() &&
+ !ctx.lookup_has_vtable(id) && self.fields().is_empty() &&
self.base_members.iter().all(|base| {
ctx.resolve_type(base.ty).canonical_type(ctx).is_unsized(
ctx,
diff --git a/src/ir/context.rs b/src/ir/context.rs
index 0edf10be..37b71ba1 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -211,7 +211,7 @@ where
T: Copy + Into<ItemId>
{
fn can_derive_debug(&self, ctx: &BindgenContext) -> bool {
- ctx.options().derive_debug && ctx.lookup_item_id_can_derive_debug(*self)
+ ctx.options().derive_debug && ctx.lookup_can_derive_debug(*self)
}
}
@@ -221,7 +221,7 @@ where
{
fn can_derive_default(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_default &&
- ctx.lookup_item_id_can_derive_default(*self)
+ ctx.lookup_can_derive_default(*self)
}
}
@@ -230,7 +230,7 @@ where
T: Copy + Into<ItemId>
{
fn can_derive_copy(&self, ctx: &BindgenContext) -> bool {
- ctx.lookup_item_id_can_derive_copy(*self)
+ ctx.lookup_can_derive_copy(*self)
}
}
@@ -239,7 +239,7 @@ where
T: Copy + Into<ItemId>
{
fn can_derive_hash(&self, ctx: &BindgenContext) -> bool {
- ctx.options().derive_hash && ctx.lookup_item_id_can_derive_hash(*self)
+ ctx.options().derive_hash && ctx.lookup_can_derive_hash(*self)
}
}
@@ -249,7 +249,7 @@ where
{
fn can_derive_partialord(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_partialord &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(*self)
+ ctx.lookup_can_derive_partialeq_or_partialord(*self)
}
}
@@ -259,7 +259,7 @@ where
{
fn can_derive_partialeq(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_partialeq &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(*self)
+ ctx.lookup_can_derive_partialeq_or_partialord(*self)
}
}
@@ -269,8 +269,8 @@ where
{
fn can_derive_eq(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_eq &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(*self) &&
- !ctx.lookup_item_id_has_float(*self)
+ ctx.lookup_can_derive_partialeq_or_partialord(*self) &&
+ !ctx.lookup_has_float(*self)
}
}
@@ -280,8 +280,8 @@ where
{
fn can_derive_ord(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_ord &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(*self) &&
- !ctx.lookup_item_id_has_float(*self)
+ ctx.lookup_can_derive_partialeq_or_partialord(*self) &&
+ !ctx.lookup_has_float(*self)
}
}
@@ -1253,7 +1253,7 @@ impl BindgenContext {
}
/// Look up whether the item with `id` has vtable or not.
- pub fn lookup_item_id_has_vtable(&self, id: TypeId) -> bool {
+ pub fn lookup_has_vtable(&self, id: TypeId) -> bool {
assert!(
self.in_codegen_phase(),
"We only compute vtables when we enter codegen"
@@ -1272,7 +1272,7 @@ impl BindgenContext {
}
/// Look up whether the item with `id` has a destructor.
- pub fn lookup_item_id_has_destructor(&self, id: TypeId) -> bool {
+ pub fn lookup_has_destructor(&self, id: TypeId) -> bool {
assert!(
self.in_codegen_phase(),
"We only compute destructors when we enter codegen"
@@ -2289,7 +2289,7 @@ impl BindgenContext {
/// Look up whether the item with `id` can
/// derive debug or not.
- pub fn lookup_item_id_can_derive_debug<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_can_derive_debug<Id: Into<ItemId>>(&self, id: Id) -> bool {
let id = id.into();
assert!(
self.in_codegen_phase(),
@@ -2313,7 +2313,7 @@ impl BindgenContext {
/// Look up whether the item with `id` can
/// derive default or not.
- pub fn lookup_item_id_can_derive_default<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_can_derive_default<Id: Into<ItemId>>(&self, id: Id) -> bool {
let id = id.into();
assert!(
self.in_codegen_phase(),
@@ -2343,7 +2343,7 @@ impl BindgenContext {
/// Look up whether the item with `id` can
/// derive hash or not.
- pub fn lookup_item_id_can_derive_hash<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_can_derive_hash<Id: Into<ItemId>>(&self, id: Id) -> bool {
let id = id.into();
assert!(
self.in_codegen_phase(),
@@ -2365,7 +2365,7 @@ impl BindgenContext {
}
/// Look up whether the item with `id` can derive `Partial{Eq,Ord}`.
- pub fn lookup_item_id_can_derive_partialeq_or_partialord<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_can_derive_partialeq_or_partialord<Id: Into<ItemId>>(&self, id: Id) -> bool {
let id = id.into();
assert!(
self.in_codegen_phase(),
@@ -2378,7 +2378,7 @@ impl BindgenContext {
}
/// Look up whether the item with `id` can derive `Copy` or not.
- pub fn lookup_item_id_can_derive_copy<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_can_derive_copy<Id: Into<ItemId>>(&self, id: Id) -> bool {
assert!(
self.in_codegen_phase(),
"We only compute can_derive_debug when we enter codegen"
@@ -2387,7 +2387,7 @@ impl BindgenContext {
// Look up the computed value for whether the item with `id` can
// derive `Copy` or not.
let id = id.into();
- !self.lookup_item_id_has_type_param_in_array(id) &&
+ !self.lookup_has_type_param_in_array(id) &&
!self.cannot_derive_copy.as_ref().unwrap().contains(&id)
}
@@ -2400,7 +2400,7 @@ impl BindgenContext {
}
/// Look up whether the item with `id` has type parameter in array or not.
- pub fn lookup_item_id_has_type_param_in_array<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_has_type_param_in_array<Id: Into<ItemId>>(&self, id: Id) -> bool {
assert!(
self.in_codegen_phase(),
"We only compute has array when we enter codegen"
@@ -2421,7 +2421,7 @@ impl BindgenContext {
}
/// Look up whether the item with `id` has array or not.
- pub fn lookup_item_id_has_float<Id: Into<ItemId>>(&self, id: Id) -> bool {
+ pub fn lookup_has_float<Id: Into<ItemId>>(&self, id: Id) -> bool {
assert!(self.in_codegen_phase(),
"We only compute has float when we enter codegen");
diff --git a/src/ir/item.rs b/src/ir/item.rs
index 31d42080..010528b6 100644
--- a/src/ir/item.rs
+++ b/src/ir/item.rs
@@ -320,57 +320,57 @@ impl Trace for Item {
impl CanDeriveDebug for Item {
fn can_derive_debug(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_debug &&
- ctx.lookup_item_id_can_derive_debug(self.id())
+ ctx.lookup_can_derive_debug(self.id())
}
}
impl CanDeriveDefault for Item {
fn can_derive_default(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_default &&
- ctx.lookup_item_id_can_derive_default(self.id())
+ ctx.lookup_can_derive_default(self.id())
}
}
impl<'a> CanDeriveCopy<'a> for Item {
fn can_derive_copy(&self, ctx: &BindgenContext) -> bool {
- ctx.lookup_item_id_can_derive_copy(self.id())
+ ctx.lookup_can_derive_copy(self.id())
}
}
impl CanDeriveHash for Item {
fn can_derive_hash(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_hash &&
- ctx.lookup_item_id_can_derive_hash(self.id())
+ ctx.lookup_can_derive_hash(self.id())
}
}
impl CanDerivePartialOrd for Item {
fn can_derive_partialord(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_partialord &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(self.id())
+ ctx.lookup_can_derive_partialeq_or_partialord(self.id())
}
}
impl CanDerivePartialEq for Item {
fn can_derive_partialeq(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_partialeq &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(self.id())
+ ctx.lookup_can_derive_partialeq_or_partialord(self.id())
}
}
impl CanDeriveEq for Item {
fn can_derive_eq(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_eq &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(self.id()) &&
- !ctx.lookup_item_id_has_float(self.id())
+ ctx.lookup_can_derive_partialeq_or_partialord(self.id()) &&
+ !ctx.lookup_has_float(self.id())
}
}
impl CanDeriveOrd for Item {
fn can_derive_ord(&self, ctx: &BindgenContext) -> bool {
ctx.options().derive_ord &&
- ctx.lookup_item_id_can_derive_partialeq_or_partialord(self.id()) &&
- !ctx.lookup_item_id_has_float(self.id())
+ ctx.lookup_can_derive_partialeq_or_partialord(self.id()) &&
+ !ctx.lookup_has_float(self.id())
}
}
@@ -1001,7 +1001,7 @@ where
fn has_vtable(&self, ctx: &BindgenContext) -> bool {
let id: ItemId = (*self).into();
id.as_type_id(ctx)
- .map_or(false, |id| ctx.lookup_item_id_has_vtable(id))
+ .map_or(false, |id| ctx.lookup_has_vtable(id))
}
}
@@ -1009,7 +1009,7 @@ impl HasVtable for Item {
fn has_vtable(&self, ctx: &BindgenContext) -> bool {
self.id()
.as_type_id(ctx)
- .map_or(false, |id| ctx.lookup_item_id_has_vtable(id))
+ .map_or(false, |id| ctx.lookup_has_vtable(id))
}
}
@@ -1022,7 +1022,7 @@ where
ctx.in_codegen_phase(),
"You're not supposed to call this yet"
);
- ctx.lookup_item_id_has_type_param_in_array(*self)
+ ctx.lookup_has_type_param_in_array(*self)
}
}
@@ -1032,7 +1032,7 @@ impl HasTypeParamInArray for Item {
ctx.in_codegen_phase(),
"You're not supposed to call this yet"
);
- ctx.lookup_item_id_has_type_param_in_array(self.id())
+ ctx.lookup_has_type_param_in_array(self.id())
}
}
@@ -1043,7 +1043,7 @@ where
fn has_float(&self, ctx: &BindgenContext) -> bool {
debug_assert!(ctx.in_codegen_phase(),
"You're not supposed to call this yet");
- ctx.lookup_item_id_has_float(*self)
+ ctx.lookup_has_float(*self)
}
}
@@ -1051,7 +1051,7 @@ impl HasFloat for Item {
fn has_float(&self, ctx: &BindgenContext) -> bool {
debug_assert!(ctx.in_codegen_phase(),
"You're not supposed to call this yet");
- ctx.lookup_item_id_has_float(self.id())
+ ctx.lookup_has_float(self.id())
}
}