From b2432fd269b8f9aba6f1df6cad13f89a4e2735e2 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Thu, 15 Sep 2016 14:48:23 -0500 Subject: [PATCH] Trickified Project Libraries #309 We were ignoring classes completely if it was found in to be in an external library directory. We need to partially process it so it is included in the ICG generated class_map file which registers attributes of classes and eventually works it's way to populating the S_sie file. --- trick_source/codegen/Interface_Code_Gen/ClassVisitor.cpp | 1 - .../codegen/Interface_Code_Gen/PrintAttributes.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/trick_source/codegen/Interface_Code_Gen/ClassVisitor.cpp b/trick_source/codegen/Interface_Code_Gen/ClassVisitor.cpp index 31e01ff6..5ab32dd7 100644 --- a/trick_source/codegen/Interface_Code_Gen/ClassVisitor.cpp +++ b/trick_source/codegen/Interface_Code_Gen/ClassVisitor.cpp @@ -155,7 +155,6 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) { !hsd.isPathInUserDir(rp) || hsd.isPathInExclude(rp) || hsd.isPathInICGExclude(rp) || - hsd.isPathInExtLib(rp) || cs.hasICGNo(header_file_name) ) { return false ; } diff --git a/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp b/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp index fa6e5fc1..84f2a369 100644 --- a/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp +++ b/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp @@ -280,8 +280,12 @@ void PrintAttributes::printClass( ClassValues * cv ) { } // if we are successful in opening the map file - if ( isFileIncluded( cv->getFileName())) { - printer->printClassMap(class_map_outfile, cv) ; + char * rp = almostRealPath(cv->getFileName().c_str()) ; + if ( rp != NULL ) { + if ( isFileIncluded( cv->getFileName()) or hsd.isPathInExtLib(rp)) { + printer->printClassMap(class_map_outfile, cv) ; + } + free(rp) ; } } }