diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2018-12-07 16:34:13 -0600 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2018-12-07 16:34:13 -0600 |
commit | 8e4b693d25779c27ce06fe31d1e5ddc63715dceb (patch) | |
tree | 4fc81c97d7ccf51855b7bff7387fb8d7af0a0aa0 | |
parent | 949dd8e0748d0594046a31116dce5bee155b9fe9 (diff) | |
download | ATCD-8e4b693d25779c27ce06fe31d1e5ddc63715dceb.tar.gz |
tao_idl: Fix AMI trying to visit annotation decl
-rw-r--r-- | TAO/TAO_IDL/ast/ast_annotation_decl.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/ast/ast_decl.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/ast_annotation_decl.h | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/ast_decl.h | 5 |
5 files changed, 28 insertions, 3 deletions
diff --git a/TAO/TAO_IDL/ast/ast_annotation_decl.cpp b/TAO/TAO_IDL/ast/ast_annotation_decl.cpp index ed8f9372f0c..5ccaba059f2 100644 --- a/TAO/TAO_IDL/ast/ast_annotation_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_annotation_decl.cpp @@ -106,3 +106,9 @@ AST_Annotation_Decl::ast_accept (ast_visitor *visitor) ACE_UNUSED_ARG (visitor); return 0; } + +bool +AST_Annotation_Decl::ami_visit () +{ + return false; +} diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index fcbd3de24ab..34648949f09 100644 --- a/TAO/TAO_IDL/ast/ast_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_decl.cpp @@ -1672,3 +1672,9 @@ AST_Decl::annotations () return *annotation_appls_; } + +bool +AST_Decl::ami_visit () +{ + return true; +} diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp index f4c58efd32a..d9b13eba963 100644 --- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp @@ -837,7 +837,7 @@ be_visitor_ami_pre_proc::visit_scope (be_scope *node) // Continue until each element is visited. while (elem_number < number_of_elements) { - AST_Decl *d = elements[elem_number]; + AST_Decl *d = elements[elem_number++]; if (!d) { @@ -850,6 +850,11 @@ be_visitor_ami_pre_proc::visit_scope (be_scope *node) } + if (!d->ami_visit()) + { + continue; + } + be_decl *bd = be_decl::narrow_from_decl (d); // Set the scope node as "node" in which the code is being @@ -859,8 +864,6 @@ be_visitor_ami_pre_proc::visit_scope (be_scope *node) // Set the node to be visited. this->ctx_->node (bd); - ++elem_number; - // Send the visitor. if (bd == 0 || bd->accept (this) == -1) diff --git a/TAO/TAO_IDL/include/ast_annotation_decl.h b/TAO/TAO_IDL/include/ast_annotation_decl.h index 2b3ad8a87d2..0ee0fd2eab7 100644 --- a/TAO/TAO_IDL/include/ast_annotation_decl.h +++ b/TAO/TAO_IDL/include/ast_annotation_decl.h @@ -50,6 +50,11 @@ public: virtual AST_Constant *fe_add_constant (AST_Constant *t); virtual int ast_accept (ast_visitor *visitor); + + /** + * Should AMI visit this node? (NO) + */ + virtual bool ami_visit (); }; #endif diff --git a/TAO/TAO_IDL/include/ast_decl.h b/TAO/TAO_IDL/include/ast_decl.h index 787dc029c20..f11e4a2f610 100644 --- a/TAO/TAO_IDL/include/ast_decl.h +++ b/TAO/TAO_IDL/include/ast_decl.h @@ -391,6 +391,11 @@ public: */ virtual AST_Annotation_Appls &annotations (); + /** + * Should AMI visit this node? + */ + virtual bool ami_visit (); + protected: // These are not private because they're used by // be_predefined_type' constructor and can be called |