summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-10-02 23:53:18 +0000
committerMorgan Deters <mdeters@gmail.com>2010-10-02 23:53:18 +0000
commit036a23f59bbc23343dc690fd1e147541e79e9b9e (patch)
tree697cac1b21e1826b7798b69dce7f4480a26e8f77 /src/expr
parent999b496fbf50525b7245ee28e972d7f0f04a1025 (diff)
revert a workaround fix to CDMap that was committed as part of the arith-indexed-vars merge, and fix the root cause (maybe?) in attribute.cpp: previously, items from the cdnodes attribute table weren't properly being "obliterated" from the table due to a typo
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/attribute.cpp24
-rw-r--r--src/expr/attribute.h14
2 files changed, 20 insertions, 18 deletions
diff --git a/src/expr/attribute.cpp b/src/expr/attribute.cpp
index 5aaa7393a..295244473 100644
--- a/src/expr/attribute.cpp
+++ b/src/expr/attribute.cpp
@@ -38,24 +38,12 @@ void AttributeManager::deleteAllAttributes(NodeValue* nv) {
deleteFromTable(d_ptrs, nv);
// FIXME CD-bools in optimized table
- for(unsigned id = 0; id < attr::LastAttributeId<bool, true>::s_id; ++id) {
- d_cdbools.obliterate(std::make_pair(id, nv));
- }
- for(unsigned id = 0; id < attr::LastAttributeId<uint64_t, true>::s_id; ++id) {
- d_cdints.obliterate(std::make_pair(id, nv));
- }
- for(unsigned id = 0; id < attr::LastAttributeId<TNode, true>::s_id; ++id) {
- d_cdtnodes.obliterate(std::make_pair(id, nv));
- }
- for(unsigned id = 0; id < attr::LastAttributeId<TNode, true>::s_id; ++id) {
- d_cdnodes.obliterate(std::make_pair(id, nv));
- }
- for(unsigned id = 0; id < attr::LastAttributeId<std::string, true>::s_id; ++id) {
- d_cdstrings.obliterate(std::make_pair(id, nv));
- }
- for(unsigned id = 0; id < attr::LastAttributeId<void*, true>::s_id; ++id) {
- d_cdptrs.obliterate(std::make_pair(id, nv));
- }
+ deleteFromTable(d_cdbools, nv);
+ deleteFromTable(d_cdints, nv);
+ deleteFromTable(d_cdtnodes, nv);
+ deleteFromTable(d_cdnodes, nv);
+ deleteFromTable(d_cdstrings, nv);
+ deleteFromTable(d_cdptrs, nv);
}
void AttributeManager::deleteAllAttributes() {
diff --git a/src/expr/attribute.h b/src/expr/attribute.h
index 2ef34a771..0668c5f8f 100644
--- a/src/expr/attribute.h
+++ b/src/expr/attribute.h
@@ -90,6 +90,9 @@ class AttributeManager {
void deleteFromTable(AttrHash<T>& table, NodeValue* nv);
template <class T>
+ void deleteFromTable(CDAttrHash<T>& table, NodeValue* nv);
+
+ template <class T>
void deleteAllFromTable(AttrHash<T>& table);
/**
@@ -554,6 +557,17 @@ inline void AttributeManager::deleteFromTable(AttrHash<T>& table,
}
/**
+ * Obliterate a NodeValue from a (context-dependent) attribute table.
+ */
+template <class T>
+inline void AttributeManager::deleteFromTable(CDAttrHash<T>& table,
+ NodeValue* nv) {
+ for(unsigned id = 0; id < attr::LastAttributeId<T, true>::s_id; ++id) {
+ table.obliterate(std::make_pair(id, nv));
+ }
+}
+
+/**
* Remove all attributes from the table calling the cleanup function if one is defined.
*/
template <class T>
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback