summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2018-08-13 09:25:26 -0700
committerGitHub <noreply@github.com>2018-08-13 09:25:26 -0700
commit957b02e415f60e725da569f1d7c0e2d1276cb3fa (patch)
treee588e05f4c1fb2320f7902618f49d188d043517d /src/expr
parentb62055f1204a0846eef728b2b62e5fc77df4048c (diff)
Removing support for T* and const T* attributes. (#2297)
* Removing support for T* and const T* attributes. These are unused.
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/attribute.cpp5
-rw-r--r--src/expr/attribute.h28
-rw-r--r--src/expr/attribute_internals.h122
-rw-r--r--src/expr/attribute_unique_id.h1
4 files changed, 0 insertions, 156 deletions
diff --git a/src/expr/attribute.cpp b/src/expr/attribute.cpp
index eeb6d00a0..9481cde99 100644
--- a/src/expr/attribute.cpp
+++ b/src/expr/attribute.cpp
@@ -50,7 +50,6 @@ void AttributeManager::deleteAllAttributes(NodeValue* nv) {
deleteFromTable(d_nodes, nv);
deleteFromTable(d_types, nv);
deleteFromTable(d_strings, nv);
- deleteFromTable(d_ptrs, nv);
}
void AttributeManager::deleteAllAttributes() {
@@ -60,7 +59,6 @@ void AttributeManager::deleteAllAttributes() {
deleteAllFromTable(d_nodes);
deleteAllFromTable(d_types);
deleteAllFromTable(d_strings);
- deleteAllFromTable(d_ptrs);
}
void AttributeManager::deleteAttributes(const AttrIdVec& atids) {
@@ -98,9 +96,6 @@ void AttributeManager::deleteAttributes(const AttrIdVec& atids) {
case AttrTableString:
deleteAttributesFromTable(d_strings, ids);
break;
- case AttrTablePointer:
- deleteAttributesFromTable(d_ptrs, ids);
- break;
case AttrTableCDBool:
case AttrTableCDUInt64:
diff --git a/src/expr/attribute.h b/src/expr/attribute.h
index f564b36f8..aafe168ea 100644
--- a/src/expr/attribute.h
+++ b/src/expr/attribute.h
@@ -88,8 +88,6 @@ public:
AttrHash<TypeNode> d_types;
/** Underlying hash table for string-valued attributes */
AttrHash<std::string> d_strings;
- /** Underlying hash table for pointer-valued attributes */
- AttrHash<void*> d_ptrs;
/**
* Get a particular attribute on a particular node.
@@ -274,32 +272,6 @@ struct getTable<std::string, false> {
}
};
-/** Access the "d_ptrs" member of AttributeManager. */
-template <class T>
-struct getTable<T*, false> {
- static const AttrTableId id = AttrTablePointer;
- typedef AttrHash<void*> table_type;
- static inline table_type& get(AttributeManager& am) {
- return am.d_ptrs;
- }
- static inline const table_type& get(const AttributeManager& am) {
- return am.d_ptrs;
- }
-};
-
-/** Access the "d_ptrs" member of AttributeManager. */
-template <class T>
-struct getTable<const T*, false> {
- static const AttrTableId id = AttrTablePointer;
- typedef AttrHash<void*> table_type;
- static inline table_type& get(AttributeManager& am) {
- return am.d_ptrs;
- }
- static inline const table_type& get(const AttributeManager& am) {
- return am.d_ptrs;
- }
-};
-
}/* CVC4::expr::attr namespace */
// ATTRIBUTE MANAGER IMPLEMENTATIONS ===========================================
diff --git a/src/expr/attribute_internals.h b/src/expr/attribute_internals.h
index c21b15140..ed1769740 100644
--- a/src/expr/attribute_internals.h
+++ b/src/expr/attribute_internals.h
@@ -101,42 +101,6 @@ struct KindValueToTableValueMapping {
inline static T convertBack(const T& t) { return t; }
};
-/**
- * Specialization of KindValueToTableValueMapping<> for pointer-valued
- * attributes.
- */
-template <class T>
-struct KindValueToTableValueMapping<T*> {
- /** Table's value type is void* */
- typedef void* table_value_type;
- /** A simple reinterpret_cast<>() conversion from T* to void* */
- inline static void* convert(const T* const& t) {
- return reinterpret_cast<void*>(const_cast<T*>(t));
- }
- /** A simple reinterpret_cast<>() conversion from void* to T* */
- inline static T* convertBack(void* const& t) {
- return reinterpret_cast<T*>(t);
- }
-};
-
-/**
- * Specialization of KindValueToTableValueMapping<> for const
- * pointer-valued attributes.
- */
-template <class T>
-struct KindValueToTableValueMapping<const T*> {
- /** Table's value type is void* */
- typedef void* table_value_type;
- /** A simple reinterpret_cast<>() conversion from const T* const to void* */
- inline static void* convert(const T* const& t) {
- return reinterpret_cast<void*>(const_cast<T*>(t));
- }
- /** A simple reinterpret_cast<>() conversion from const void* const to T* */
- inline static const T* convertBack(const void* const& t) {
- return reinterpret_cast<const T*>(t);
- }
-};
-
}/* CVC4::expr::attr namespace */
// ATTRIBUTE HASH TABLES =======================================================
@@ -376,23 +340,6 @@ namespace attr {
struct NullCleanupStrategy {
};/* struct NullCleanupStrategy */
-/** Default cleanup for ManagedAttribute<> */
-template <class T>
-struct ManagedAttributeCleanupStrategy {
-};/* struct ManagedAttributeCleanupStrategy<> */
-
-/** Specialization for T* */
-template <class T>
-struct ManagedAttributeCleanupStrategy<T*> {
- static inline void cleanup(T* p) { delete p; }
-};/* struct ManagedAttributeCleanupStrategy<T*> */
-
-/** Specialization for const T* */
-template <class T>
-struct ManagedAttributeCleanupStrategy<const T*> {
- static inline void cleanup(const T* p) { delete p; }
-};/* struct ManagedAttributeCleanupStrategy<const T*> */
-
/**
* Helper for Attribute<> class below to determine whether a cleanup
* is defined or not.
@@ -422,57 +369,6 @@ void (*const getCleanupStrategy<T, NullCleanupStrategy>::fn)
(typename getCleanupStrategy<T, NullCleanupStrategy>::
mapping::table_value_type) = NULL;
-/**
- * Specialization for ManagedAttributeCleanupStrategy<T>.
- */
-template <class T>
-struct getCleanupStrategy<T, ManagedAttributeCleanupStrategy<T> > {
- typedef T value_type;
- typedef KindValueToTableValueMapping<value_type> mapping;
- static void (*const fn)(typename mapping::table_value_type);
-};/* struct getCleanupStrategy<T, ManagedAttributeCleanupStrategy<T> > */
-
-// out-of-class initialization required (because it's a non-integral type)
-template <class T>
-void (*const getCleanupStrategy<T, ManagedAttributeCleanupStrategy<T> >::fn)
- (typename getCleanupStrategy<T, ManagedAttributeCleanupStrategy<T> >::
- mapping::table_value_type) = NULL;
-
-/**
- * Specialization for ManagedAttributeCleanupStrategy<T*>.
- */
-template <class T>
-struct getCleanupStrategy<T*, ManagedAttributeCleanupStrategy<T*> > {
- typedef T* value_type;
- typedef ManagedAttributeCleanupStrategy<value_type> C;
- typedef KindValueToTableValueMapping<value_type> mapping;
- static void fn(typename mapping::table_value_type t) {
- C::cleanup(mapping::convertBack(t));
- }
-};/* struct getCleanupStrategy<T*, ManagedAttributeCleanupStrategy<T*> > */
-
-/**
- * Specialization for ManagedAttributeCleanupStrategy<const T*>.
- */
-template <class T>
-struct getCleanupStrategy<const T*,
- ManagedAttributeCleanupStrategy<const T*> > {
- typedef const T* value_type;
- typedef ManagedAttributeCleanupStrategy<value_type> C;
- typedef KindValueToTableValueMapping<value_type> mapping;
- static void fn(typename mapping::table_value_type t) {
- C::cleanup(mapping::convertBack(t));
- }
-};/* struct getCleanupStrategy<const T*,
- ManagedAttributeCleanupStrategy<const T*> > */
-
-/**
- * Cause compile-time error for improperly-instantiated
- * getCleanupStrategy<>.
- */
-template <class T, class U>
-struct getCleanupStrategy<T, ManagedAttributeCleanupStrategy<U> >;
-
}/* CVC4::expr::attr namespace */
// ATTRIBUTE IDENTIFIER ASSIGNMENT TEMPLATE ====================================
@@ -650,24 +546,6 @@ public:
}
};/* class Attribute<..., bool, ...> */
-/**
- * This is a managed attribute kind (the only difference between
- * ManagedAttribute<> and Attribute<> is the default cleanup function
- * and the fact that ManagedAttributes cannot be context-dependent).
- * In the default ManagedAttribute cleanup function, the value is
- * destroyed with the delete operator. If the value is allocated with
- * the array version of new[], an alternate cleanup function should be
- * provided that uses array delete[]. It is an error to create a
- * ManagedAttribute<> kind with a non-pointer value_type if you don't
- * also supply a custom cleanup function.
- */
-template <class T,
- class value_type,
- class CleanupStrategy =
- attr::ManagedAttributeCleanupStrategy<value_type> >
-struct ManagedAttribute :
- public Attribute<T, value_type, CleanupStrategy, false> {};
-
// ATTRIBUTE IDENTIFIER ASSIGNMENT =============================================
/** Assign unique IDs to attributes at load time. */
diff --git a/src/expr/attribute_unique_id.h b/src/expr/attribute_unique_id.h
index 3ba53bede..1a6220db2 100644
--- a/src/expr/attribute_unique_id.h
+++ b/src/expr/attribute_unique_id.h
@@ -35,7 +35,6 @@ enum AttrTableId {
AttrTableNode,
AttrTableTypeNode,
AttrTableString,
- AttrTablePointer,
AttrTableCDBool,
AttrTableCDUInt64,
AttrTableCDTNode,
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback