summaryrefslogtreecommitdiffstats
path: root/staptree.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'staptree.cxx')
-rw-r--r--staptree.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/staptree.cxx b/staptree.cxx
index a31112cb..b6ee3fdf 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -344,6 +344,12 @@ void cast_op::print (ostream& o) const
}
+void defined_op::print (ostream& o) const
+{
+ o << "@defined(" << *operand << ")";
+}
+
+
void vardecl::print (ostream& o) const
{
o << name;
@@ -1312,6 +1318,14 @@ cast_op::visit (visitor* u)
u->visit_cast_op(this);
}
+
+void
+defined_op::visit (visitor* u)
+{
+ u->visit_defined_op(this);
+}
+
+
void
arrayindex::visit (visitor* u)
{
@@ -1687,6 +1701,13 @@ traversing_visitor::visit_cast_op (cast_op* e)
}
void
+traversing_visitor::visit_defined_op (defined_op* e)
+{
+ e->operand->visit (this);
+}
+
+
+void
traversing_visitor::visit_arrayindex (arrayindex* e)
{
for (unsigned i=0; i<e->indexes.size(); i++)
@@ -1801,6 +1822,14 @@ varuse_collecting_visitor::visit_cast_op (cast_op *e)
}
void
+varuse_collecting_visitor::visit_defined_op (defined_op *e)
+{
+ // XXX
+ functioncall_traversing_visitor::visit_defined_op (e);
+}
+
+
+void
varuse_collecting_visitor::visit_print_format (print_format* e)
{
// NB: Instead of being top-level statements, "print" and "printf"
@@ -2193,6 +2222,13 @@ throwing_visitor::visit_cast_op (cast_op* e)
}
void
+throwing_visitor::visit_defined_op (defined_op* e)
+{
+ throwone (e->tok);
+}
+
+
+void
throwing_visitor::visit_arrayindex (arrayindex* e)
{
throwone (e->tok);
@@ -2435,6 +2471,13 @@ update_visitor::visit_cast_op (cast_op* e)
}
void
+update_visitor::visit_defined_op (defined_op* e)
+{
+ replace (e->operand);
+ provide (e);
+}
+
+void
update_visitor::visit_arrayindex (arrayindex* e)
{
replace (e->base);
@@ -2672,6 +2715,12 @@ deep_copy_visitor::visit_cast_op (cast_op* e)
}
void
+deep_copy_visitor::visit_defined_op (defined_op* e)
+{
+ update_visitor::visit_defined_op(new defined_op(*e));
+}
+
+void
deep_copy_visitor::visit_arrayindex (arrayindex* e)
{
update_visitor::visit_arrayindex(new arrayindex(*e));