getFunction() of DISubprogram return 0?

Hi,

I'd like to get the Function* that is described by a DISubprogram. I found this method getFunction() in the class. However, when I use it in my code, the function always returns 0. I tried to dig into it and saw that a mysterious number 16 is used in getFunctionField(16). I'm wondering if my failure of the function was caused by my incorrect use, e.g., without fulfilling necessary assumptions by running some passes first, or by that this number was planned but not implemented yet.

Thanks.
Lu

Hi,