[cfe-dev] "should not see dependent types here" in AST traversal

Julian Mueller via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 23 08:34:43 PST 2018


Hi.
I am programming a clang tool, that traverses the ASTs for multiple files
generating info on memberusages.
Naturally when parsing an AST the visitors traverse through each included
h/hpp file even if it is not a user made file but something like glfw.
Since eventually I want to make sourcefile transformations, I want to
exclude those kinds of files.
Therefore I use an AST matcher *file_match*:

isExpansionInFileMatching("foo.c|bar.c|include/*")

I use it like this:
cxxRecordDecl(file_match, hasDefinition(), unless(isUnion())).bind
(coop_class_s);

This used to work as intended until I tried to parse a bigger existing
project - not a mere test file.
Not only will my matchers match on 'non-user' files like: type_traits, I
also get an error message:

.../llvm/tools/clang/include/clang/AST/TypeNodes.def:87: clang::TypeInfo
clang::ASTContext::getTypeInfoImpl(const clang::Type*) const: Assertion
`!T->isDependentType() && "should not see dependent types here"'

TypeNodes.def:87:
NON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOfExpr, Type)

I don't have an understanding of what those def files are and I also can't
see what this assertion type is supposed to mean.
And I have no idea how my matcher seems to be ignored.

Could someone help?

-- 
Mit freundlichen Grüßen,
Julian Müller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181123/3e3f9dc9/attachment.html>


More information about the cfe-dev mailing list