I'm trying to detect field usages inside of method bodies using CCI. For this I am currently using the
Visit (IOperation operation)
method to get all "Ldfld", "Ldsfld", "Stfld", ... Operations that operate on Fields.
Unfortunately, when using Events and Properties, the compiler generates a lot of backing fields, etc like
and of course the Visit method is called each and every time one of these compiler generated fields are accessed.
Is there a way to distinguish these fields from normal fields?
I can get to the FieldDefinition from the Operation, but I can't seem to find something like the IsCompilerGenerated in the object tree.
Thanks for your help,