summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp')
-rw-r--r--TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp79
1 files changed, 33 insertions, 46 deletions
diff --git a/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp b/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp
index 28c74f05ee6..65e0bd266f9 100644
--- a/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp
+++ b/TAO/orbsvcs/IFR_Service/ifr_removing_visitor.cpp
@@ -6,7 +6,8 @@
ACE_RCSID(IFR_Service, ifr_removing_visitor, "$Id$")
-ifr_removing_visitor::ifr_removing_visitor (void)
+ifr_removing_visitor::ifr_removing_visitor (CORBA::Environment &ACE_TRY_ENV)
+ : ifr_visitor (ACE_TRY_ENV)
{
}
@@ -26,59 +27,45 @@ ifr_removing_visitor::visit_scope (UTL_Scope *node)
AST_Decl *d = 0;
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ // Continue until each element is visited.
+ while (!si.is_done ())
{
- // Continue until each element is visited.
- while (!si.is_done ())
- {
- d = si.item ();
-
- if (d == 0)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- ACE_TEXT ("(%N:%l) ifr_removing_visitor::visit_scope -")
- ACE_TEXT (" bad node in this scope\n")
- ),
- -1
- );
- }
+ d = si.item ();
- if (d->node_type () == AST_Decl::NT_pre_defined)
- {
- // We can skip these - they don't get destroyed in the IfR.
- si.next ();
- continue;
- }
+ if (d == 0)
+ {
+ ACE_ERROR_RETURN ((
+ LM_ERROR,
+ ACE_TEXT ("(%N:%l) ifr_removing_visitor::visit_scope -")
+ ACE_TEXT (" bad node in this scope\n")
+ ),
+ -1
+ );
+ }
- IR_Contained_var top_level =
- be_global->repository ()->lookup_id (d->repoID (),
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ if (d->node_type () == AST_Decl::NT_pre_defined)
+ {
+ // We can skip these - they don't get destroyed in the IfR.
+ si.next ();
+ continue;
+ }
- if (!CORBA::is_nil (top_level.in ()))
- {
- // All we have to do is call destroy() on each IR object
- // in the global scope, because destroy() works on all
- // the contents recursively.
- top_level->destroy (ACE_TRY_ENV);
- ACE_TRY_CHECK;
- }
+ IR_Contained_var top_level =
+ be_global->repository ()->lookup_id (d->repoID (),
+ this->env_);
+ TAO_IFR_CHECK_RETURN (-1);
- si.next ();
+ if (!CORBA::is_nil (top_level.in ()))
+ {
+ // All we have to do is call destroy() on each IR object
+ // in the global scope, because destroy() works on all
+ // the contents recursively.
+ top_level->destroy (this->env_);
+ TAO_IFR_CHECK_RETURN (-1);
}
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (
- ACE_ANY_EXCEPTION,
- ACE_TEXT ("ifr_removing_visitor::visit_scope")
- );
- return -1;
+ si.next ();
}
- ACE_ENDTRY;
}
return 0;