Fix io code for classes with excluded parents

Check the return value of CXXRecordVisitor::TraverseCXXRecordDecl and
don't add information from excluded parents.
Add a parameter to PrintAttributes::isHeaderExcluded to toggle exlusion
of TRICK_EXT_LIB_DIRS paths. When traversing a CXX record, we don't
actually want to skip these paths since their io code should exist in
the Trickified library.
Fix memory leak.

Refs #435
This commit is contained in:
Derek Bankieris
2017-05-24 09:57:07 -05:00
parent 56bdafc68b
commit 1dbeb3e2d4
4 changed files with 26 additions and 25 deletions

View File

@ -481,7 +481,7 @@ bool PrintAttributes::isIgnored(ConstructValues& constructValues) {
return ignored;
}
bool PrintAttributes::isHeaderExcluded(const std::string& header) {
bool PrintAttributes::isHeaderExcluded(const std::string& header, bool exclude_ext_libs) {
char* temp = almostRealPath(header.c_str());
if (!temp) {
return true;
@ -494,7 +494,7 @@ bool PrintAttributes::isHeaderExcluded(const std::string& header) {
* - in system directories
* - in TRICK_EXCLUDE directories
* - in TRICK_ICG_EXCLUDE directories
* - in TRICK_EXT_LIB_DIRS directories
* - in TRICK_EXT_LIB_DIRS directories (if requested)
* - whose Trick header comments preclude ICG
*/
if (!hsd.isPathInUserDir(path)) {
@ -515,7 +515,7 @@ bool PrintAttributes::isHeaderExcluded(const std::string& header) {
return true;
}
if (hsd.isPathInExtLib(path)) {
if (hsd.isPathInExtLib(path) && exclude_ext_libs) {
if (verboseBuild) {
std::cout << skipping << "TRICK_EXT_LIB_DIRS: " << underline(path, hsd.getPathInExtLib(path).size()) << std::endl;
}