how to access the branch statement to use in fxcop?

hi,

i am writing a rule to check is declaration avoided in inside loops. For that i am checking is declaration avoided inside branching statements of MSIL. For that i need to access br.s and blt.s opcodes. I dont know how to access them... Can any one help me?

Thanks in advance...

[304 byte] By [Guns] at [2007-12-21]
# 1

Hi Guns,

loop detection and assignment inside loops is more complicated than just looking for branches. This usually is done with dataflow. Trying to implement this by just looking at instructions will probably be very tough.

However, if you want to see all MSIL instructions in a method, use Method.Instructions. Each instruction object will have an OpCode property which is typed as the OpCode enum.

Regards,

Jeffrey

JeffreyvanGogh-MSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Code Analysis and Code Metrics...

Visual Studio Team System

Site Classified