Structure field names

Hi All,
I am working on a project as part of my graduate study which uses LLVM.
I am relatively new to LLVM.
My goal is to get names of the parameters to functions. If the parameter is a structure, then I also need to name of the fields of the structure.
I assume that metadata info should provide this but so far I am unable to find any documentation regarding which would describe how to do it.
Is there a way to do this? Is this even possible?
Please let me know if any of this is confusing and I will try to describe it in detail.


if (Value->hasName())

You can iterate the elements of the struct doing this:

If (Value->getType()->isStructTy())
for(StructType::element_iterator ii = Value->element_begin(), ei = Value->element_end(); ii != ei; ++ii) {

You could do this recursively for structs with structs of structs etc and so forth. Some permutation of this should work.