Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newer Clang versions (>= 16) #23

Open
dc-mak opened this issue Nov 3, 2024 · 0 comments
Open

Support newer Clang versions (>= 16) #23

dc-mak opened this issue Nov 3, 2024 · 0 comments

Comments

@dc-mak
Copy link
Collaborator

dc-mak commented Nov 3, 2024

In file included from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:82:
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp: In member function ‘void Traverser::down_casted(const clang::DesignatedInitExpr*, int)’:
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp:340:32: error: ‘const class clang::DesignatedInitExpr::Designator’ has no member named ‘getField’; did you mean ‘getFieldLoc’?
  340 |                 traverse(child.getField(), depth + 1);
      |                                ^~~~~~~~
      |                                getFieldLoc

Not backwards compatible, since 17: Rename clang::DesignatedInitExpr::Designator::getField() => getFieldDecl() (see llvm/llvm-project@b51a03e#diff-03e60ab06f82e27e971dc7c0816e51e2a984da855607560e33c94094ac1622c9R5177).

/home/dhruv/c-tree-carver/cpp/src/traverser.hpp: In member function ‘void Traverser::down_casted(const clang::TypeOfType*, int)’:
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp:435:24: error: ‘const class clang::TypeOfType’ has no member named ‘getUnderlyingType’
  435 |         traverse(type->getUnderlyingType(), depth);
      |                        ^~~~~~~~~~~~~~~~~

Not backwards compatible, since 16: Rename class clang::TypeOfType::getUnderlyingType() => getUnmodifiedType() (see llvm/llvm-project@60727d8#diff-c4d7904edf8b990b1744903f7bda4ba256bd6709519f5a85d3015eb141506dfaR4614).

/home/dhruv/c-tree-carver/cpp/src/traverser.hpp: In member function ‘void Traverser::down_casted(const clang::TemplateSpecializationType*, int)’:
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp:472:33: error: ‘begin’ was not declared in this scope
  472 |         for (const auto &arg : *type) {
      |                                 ^~~~
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp:472:33: note: suggested alternatives:
In file included from /usr/include/c++/11/array:41,
                 from /usr/include/c++/11/tuple:39,
                 from /usr/include/c++/11/functional:54,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/lib/llvm-19/include/llvm/ADT/Hashing.h:52,
                 from /usr/lib/llvm-19/include/llvm/ADT/ArrayRef.h:12,
                 from /usr/lib/llvm-19/include/llvm/ADT/APFloat.h:19,
                 from /usr/lib/llvm-19/include/clang/AST/APNumericStorage.h:12,
                 from /usr/lib/llvm-19/include/clang/AST/Decl.h:16,
                 from /home/dhruv/c-tree-carver/cpp/src/debug_printers.hpp:42,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.hpp:82,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:79:
/usr/include/c++/11/bits/range_access.h:108:37: note:   ‘std::begin’
  108 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
In file included from /usr/include/c++/11/utility:76,
                 from /usr/include/c++/11/optional:36,
                 from /usr/lib/llvm-19/include/llvm/ADT/APInt.h:24,
                 from /usr/lib/llvm-19/include/llvm/ADT/APFloat.h:18,
                 from /usr/lib/llvm-19/include/clang/AST/APNumericStorage.h:12,
                 from /usr/lib/llvm-19/include/clang/AST/Decl.h:16,
                 from /home/dhruv/c-tree-carver/cpp/src/debug_printers.hpp:42,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.hpp:82,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:79:
/usr/include/c++/11/initializer_list:90:5: note:   ‘std::begin’
   90 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
In file included from /usr/lib/llvm-19/include/llvm/Support/VirtualFileSystem.h:27,
                 from /usr/lib/llvm-19/include/clang/Basic/FileManager.h:30,
                 from /usr/lib/llvm-19/include/clang/Basic/SourceManager.h:39,
                 from /home/dhruv/c-tree-carver/cpp/src/debug_printers.hpp:43,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.hpp:82,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:79:
/usr/lib/llvm-19/include/llvm/Support/Path.h:122:16: note:   ‘llvm::sys::path::begin’
  122 | const_iterator begin(StringRef path, Style style = Style::native);
      |                ^~~~~
In file included from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:82:
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp:472:33: error: ‘end’ was not declared in this scope
  472 |         for (const auto &arg : *type) {
      |                                 ^~~~
/home/dhruv/c-tree-carver/cpp/src/traverser.hpp:472:33: note: suggested alternatives:
In file included from /usr/include/c++/11/array:41,
                 from /usr/include/c++/11/tuple:39,
                 from /usr/include/c++/11/functional:54,
                 from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/lib/llvm-19/include/llvm/ADT/Hashing.h:52,
                 from /usr/lib/llvm-19/include/llvm/ADT/ArrayRef.h:12,
                 from /usr/lib/llvm-19/include/llvm/ADT/APFloat.h:19,
                 from /usr/lib/llvm-19/include/clang/AST/APNumericStorage.h:12,
                 from /usr/lib/llvm-19/include/clang/AST/Decl.h:16,
                 from /home/dhruv/c-tree-carver/cpp/src/debug_printers.hpp:42,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.hpp:82,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:79:
/usr/include/c++/11/bits/range_access.h:110:37: note:   ‘std::end’
  110 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
In file included from /usr/include/c++/11/utility:76,
                 from /usr/include/c++/11/optional:36,
                 from /usr/lib/llvm-19/include/llvm/ADT/APInt.h:24,
                 from /usr/lib/llvm-19/include/llvm/ADT/APFloat.h:18,
                 from /usr/lib/llvm-19/include/clang/AST/APNumericStorage.h:12,
                 from /usr/lib/llvm-19/include/clang/AST/Decl.h:16,
                 from /home/dhruv/c-tree-carver/cpp/src/debug_printers.hpp:42,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.hpp:82,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:79:
/usr/include/c++/11/initializer_list:101:5: note:   ‘std::end’
  101 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
In file included from /usr/lib/llvm-19/include/llvm/Support/VirtualFileSystem.h:27,
                 from /usr/lib/llvm-19/include/clang/Basic/FileManager.h:30,
                 from /usr/lib/llvm-19/include/clang/Basic/SourceManager.h:39,
                 from /home/dhruv/c-tree-carver/cpp/src/debug_printers.hpp:43,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.hpp:82,
                 from /home/dhruv/c-tree-carver/cpp/src/reachability_analyzer.cpp:79:
/usr/lib/llvm-19/include/llvm/Support/Path.h:127:16: note:   ‘llvm::sys::path::end’
  127 | const_iterator end(StringRef path);
      |                ^~~

Backwards compatible, since 16: Move clang::TemplateSpecializationType::begin() => template_arguments() (see llvm/llvm-project@1acffe8#diff-c4d7904edf8b990b1744903f7bda4ba256bd6709519f5a85d3015eb141506dfaR5415).

@dc-mak dc-mak changed the title Support newer Clang versions Support newer Clang versions (16, 17) Nov 3, 2024
@dc-mak dc-mak changed the title Support newer Clang versions (16, 17) Support newer Clang versions (>= 16) Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant