diff --git a/trick_source/codegen/Interface_Code_Gen/CommentSaver.cpp b/trick_source/codegen/Interface_Code_Gen/CommentSaver.cpp index fbfd2915..ef5aaf4d 100644 --- a/trick_source/codegen/Interface_Code_Gen/CommentSaver.cpp +++ b/trick_source/codegen/Interface_Code_Gen/CommentSaver.cpp @@ -15,7 +15,11 @@ bool CommentSaver::HandleComment(clang::Preprocessor &PP, clang::SourceRange Com //Comment.getBegin().dump(sm) ; if ( isInUserOrTrickCode( ci , Comment.getBegin() , hsd ) ) { +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported std::string file_name = ci.getSourceManager().getBufferName(Comment.getBegin()) ; +#else + std::string file_name = ci.getSourceManager().getBufferName(Comment.getBegin()).str() ; +#endif char * resolved_path = almostRealPath( file_name.c_str() ) ; if ( resolved_path != NULL ) { unsigned int line_no = ci.getSourceManager().getSpellingLineNumber(Comment.getBegin()) ; diff --git a/trick_source/codegen/Interface_Code_Gen/FieldVisitor.cpp b/trick_source/codegen/Interface_Code_Gen/FieldVisitor.cpp index 553aa895..8c46bb1f 100644 --- a/trick_source/codegen/Interface_Code_Gen/FieldVisitor.cpp +++ b/trick_source/codegen/Interface_Code_Gen/FieldVisitor.cpp @@ -228,7 +228,8 @@ bool FieldVisitor::VisitFieldDecl( clang::FieldDecl *field ) { std::cout << "FieldVisitor VisitFieldDecl" << std::endl ; std::cout << " is_bitfield = " << fdes->isBitField() << std::endl ; std::cout << " is_canonical = " << qt.isCanonical() << std::endl ; - std::cout << " is_hidden = " << field->isHidden() << std::endl ; + // isHidden() removed in clang 11.0 + //std::cout << " is_hidden = " << field->isHidden() << std::endl ; //field->dump() ; } diff --git a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp index 5ee3aa23..4d241604 100644 --- a/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp +++ b/trick_source/codegen/Interface_Code_Gen/HeaderSearchDirs.cpp @@ -226,7 +226,11 @@ bool HeaderSearchDirs::isPathInUserDir (const std::string& in_dir ) { clang::HeaderSearch::search_dir_iterator sdi ; for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) { +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported std::string curr_dir = (*sdi).getName() ; +#else + std::string curr_dir = (*sdi).getName().str() ; +#endif if ( ! in_dir.compare(0, curr_dir.size(), curr_dir)) { return false ; } @@ -244,7 +248,11 @@ bool HeaderSearchDirs::isPathInUserOrTrickDir (const std::string& in_dir ) { clang::HeaderSearch::search_dir_iterator sdi ; for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) { +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported std::string curr_dir = (*sdi).getName() ; +#else + std::string curr_dir = (*sdi).getName().str() ; +#endif if ( ! in_dir.compare(0, curr_dir.size(), curr_dir)) { return false ; } diff --git a/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp b/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp index f91ea391..279626de 100644 --- a/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp +++ b/trick_source/codegen/Interface_Code_Gen/PrintAttributes.cpp @@ -393,7 +393,11 @@ std::set PrintAttributes::getEmptyFiles() { std::set emptyFiles; for (auto fi = ci.getSourceManager().fileinfo_begin() ; fi != ci.getSourceManager().fileinfo_end() ; ++fi ) { const clang::FileEntry * fe = (*fi).first ; +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported std::string header_file_name = fe->getName() ; +#else + std::string header_file_name = fe->getName().str() ; +#endif if ( visited_files.find(header_file_name) != visited_files.end() ) { continue; diff --git a/trick_source/codegen/Interface_Code_Gen/Utilities.cpp b/trick_source/codegen/Interface_Code_Gen/Utilities.cpp index 666d1d9c..e5ee3bcf 100644 --- a/trick_source/codegen/Interface_Code_Gen/Utilities.cpp +++ b/trick_source/codegen/Interface_Code_Gen/Utilities.cpp @@ -66,7 +66,11 @@ bool isInUserCode( clang::CompilerInstance & ci , clang::SourceLocation sl , Hea if ( ! fid.isInvalid() ) { const clang::FileEntry * fe = ci.getSourceManager().getFileEntryForID(fid) ; if ( fe != NULL ) { +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported char * resolved_path = almostRealPath( fe->getName() ) ; +#else + char * resolved_path = almostRealPath( fe->getName().str() ) ; +#endif if ( resolved_path != NULL ) { if ( hsd.isPathInUserDir(resolved_path)) { ret = true ; @@ -84,7 +88,11 @@ bool isInUserOrTrickCode( clang::CompilerInstance & ci , clang::SourceLocation s if ( ! fid.isInvalid() ) { const clang::FileEntry * fe = ci.getSourceManager().getFileEntryForID(fid) ; if ( fe != NULL ) { +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported char * resolved_path = almostRealPath( fe->getName() ) ; +#else + char * resolved_path = almostRealPath( fe->getName().str() ) ; +#endif if ( resolved_path != NULL ) { if ( hsd.isPathInUserOrTrickDir(resolved_path)) { ret = true ; @@ -103,7 +111,11 @@ std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl if ( ! fid.isInvalid() ) { const clang::FileEntry * fe = ci.getSourceManager().getFileEntryForID(fid) ; if ( fe != NULL ) { +#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported char * resolved_path = almostRealPath( fe->getName() ) ; +#else + char * resolved_path = almostRealPath( fe->getName().str() ) ; +#endif if ( resolved_path != NULL and hsd.isPathInUserDir(resolved_path)) { file_name.append(resolved_path); }