Skip to content

Commit

Permalink
(PreprocessingInfo) supports PreprocessingInfo::setTypeOfDirective (D…
Browse files Browse the repository at this point in the history
…irectiveType dt)

* add missing function to set directivey type
* used by ada2cpp to translate Ada comments into C++ style comments

RC-848
  • Loading branch information
chunhualiao committed Apr 19, 2021
1 parent 041e865 commit 21b1061
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/frontend/SageIII/rose_attributes_list.C
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,15 @@ PreprocessingInfo::getTypeOfDirective () const
return whatSortOfDirective;
}

void
PreprocessingInfo::setTypeOfDirective (PreprocessingInfo::DirectiveType dt)
{
// Access function for the type of directive
ROSE_ASSERT(this != NULL);
whatSortOfDirective = dt;
}


#if 0
************* OLD CODE **************
char*
Expand Down
1 change: 1 addition & 0 deletions src/frontend/SageIII/rose_attributes_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ class PreprocessingInfo
void setString ( const std::string & s );
int getStringLength() const;
DirectiveType getTypeOfDirective() const;
void setTypeOfDirective(DirectiveType);
RelativePositionType getRelativePosition(void) const;
void setRelativePosition(RelativePositionType relPos);

Expand Down
4 changes: 1 addition & 3 deletions src/frontend/SageIII/sageInterface/sageInterfaceAda.C
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,7 @@ namespace ada
comment.replace(0, 2, prefix);
comment.append(suffix);
ppinfo->setString(comment);
// \todo PreprocessingInfo does not allow to update the directive type
// possible solutions: either add new function or gen new object
// ppinfo->setTypeOfDirective(commentKind);
ppinfo->setTypeOfDirective(commentKind);
}
}

Expand Down

0 comments on commit 21b1061

Please sign in to comment.