[cfe-dev] Problem binding a fieldDecl name

Daniel QuiƱones Lopez kaos09 at hotmail.com
Thu Sep 26 11:55:52 PDT 2013


Hello, I'm trying to bind a fieldDecl name but a find some problems. I have a matcher like this:

DeclarationMatcher IHD__Matcher = recordDecl(
                    forEach(
                      fieldDecl(hasName(Name().bind("n")), hasType(type().bind("t"))).bind("ChildVar")
                    ),
                    isDerivedFrom(
                      recordDecl(
                      forEach(
                        fieldDecl(hasName(equalsBoundNode("n")), hasType(type(equalsBoundNode("t"))
                        ).bind("ParentVar")
                      )
                      )
                    )
                  ); 

It searchs for an attribute in a child class that has the same name and type as the father's attribute . I've tried using macros, but i always get conversion errors:

AST_POLYMORPHIC_MATCHER(Name, AST_POLYMORPHIC_SUPPORTED_TYPES_1(void(internal::TypeList<string>))){
        return Node.getName();
      }

There is a way to do this without using macros? I've been searching in the AST Matcher Reference, but I can't find what i need.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130926/4795cf2f/attachment.html>


More information about the cfe-dev mailing list