printing constants

Sir,

Given code like:

   X = add int Y, 1
   Z = mul int X, 17

while I iterate over the operands of the first
instruction i want to print the variable x ,as well as
the constant 1 and while i iterate over the second
instruction i want to print variable x and constant
17.
what should I do?

thanking you,

yours sincerely,
anubham suresh
TU-Darmstadt

Given code like:

   X = add int Y, 1
   Z = mul int X, 17

while I iterate over the operands of the first
instruction i want to print the variable x ,as well as
the constant 1 and while i iterate over the second
instruction i want to print variable x and constant
17.
what should I do?

Use op_begin()/op_end():
http://llvm.cs.uiuc.edu/docs/ProgrammersManual.html#iterate_chains

-Chris