1279 llvm 14 (#1282)

* traverse enum type on llvm 14 #1279
This commit is contained in:
Scott Fennell 2022-06-09 09:42:06 -05:00 committed by GitHub
parent ae55e7f5ab
commit 33d2a53e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 13 deletions

View File

@ -124,23 +124,12 @@ jobs:
cmake .
make
cp libgtest* /usr/lib/
tag_deps: >-
llvm-dev
libclang-dev
#-------- Debian 11-based Only Dependencies ----------------
- cfg: { arch: debian, arch_ver: 11 }
conf_pkg: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y tzdata
tag_deps: >-
llvm-dev
libclang-dev
#-------- Debian 12-based Only Dependencies ----------------
- cfg: { arch: debian, arch_ver: 12 }
tag_deps: >-
llvm-13-dev
libclang-13-dev
#-------- OS and Version Specific Dependencies ----------------
- cfg: { os: oraclelinux }
install_gtest: |

View File

@ -79,7 +79,13 @@ bool CXXRecordVisitor::TraverseDecl(clang::Decl *d) {
/* This is an embedded enumeration within a class. Only process it if is public */
if ( ed->getAccess() == clang::AS_public ) {
EnumVisitor evis(ci, hsd) ;
// Before llvm 14, TraverseDecl also traversed the type.
// llvm believed this to be a bug, so now we call TraverseType
// in addition to TraverseDecl.
evis.TraverseDecl(ed) ;
#if (LIBCLANG_MAJOR >= 14)
evis.TraverseType(clang::QualType(ed->getTypeForDecl(), 0));
#endif
pa.printEnum(evis.get_enum_data()) ;
} else {
// protected and private embedded classes cannot be used outside of their class

View File

@ -98,7 +98,13 @@ bool TranslationUnitVisitor::TraverseDecl(clang::Decl *d) {
clang::EnumDecl * ed = static_cast<clang::EnumDecl *>(d) ;
if ( isInUserCode(ci , ed->RBRACELOC(), hsd) ) {
EnumVisitor evis(ci, hsd) ;
// Before llvm 14, TraverseDecl also traversed the type.
// llvm believed this to be a bug, so now we call TraverseType
// in addition to TraverseDecl.
evis.TraverseDecl(ed) ;
#if (LIBCLANG_MAJOR >= 14)
evis.TraverseType(clang::QualType(ed->getTypeForDecl(), 0));
#endif
//if ( evis.get_enum_data() != NULL ) {
pa.printEnum(evis.get_enum_data()) ;
//}