Using a Bit in the CXXRecordDecl Bitfield

Howdy everyone.

My new analysis introduces annotations that are placed on class methods. I’d like a way to check types, as my analysis encounters variable declarations, to see if they have members marked with my annotations. I could iterate over all of the methods for record types to check for my annotations, but this seems expensive. The best way I can think of to accomplish this is to add a bool value to the CXXRecordDecl bitfield. I have two questions for the list: a) can anyone think of a better way to do this? and b) is there any objection to adding another bit to the field? If my count is correct there are currently 59 bits in the field.

  • Chris

If this is your own private branch, knock yourself out.

If you want this in trunk, then I think you should probably just keep a set of declarations on the side.

John.

Would there be any objection to me adding a data member to the sema::AnalysisBasedWarnings class instead? It would be used to cache some information and speed up the analysis.

And yes, we would like this to eventually be merged into trunk.

  • Chris

Would there be any objection to me adding a data member to the sema::AnalysisBasedWarnings class instead? It would be used to cache some information and speed up the analysis.

That’s more reasonable, but I’d like Ted to weigh in.

John.