[cfe-dev] How to determine if Decl is a RecordDecl?

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 11 07:24:22 PST 2020


You can either do a isa<RecordDecl>(MyDecl), or dyn_cast<RecordDecl>(MyDecl)

-----Original Message-----
From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Marcel Schaible via cfe-dev
Sent: Wednesday, November 11, 2020 7:21 AM
To: cfe-dev at lists.llvm.org
Subject: [cfe-dev] How to determine if Decl is a RecordDecl?

Hi,

I am currently devoloping a tool, which collects Decl with a user-defined attribute.

At the moement I am storing these Decls in a vector.

Afterwards I want to iterate over the vector of Decls and want to determine if a element is e.g. of type RecordDecl or CxxRecordDecl

What is the preferred way for achieving this?

Thanks

Marcel
_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list