[LLVMdev] AsmPrinter question

Bill Wendling isanbard at gmail.com
Fri Jan 30 19:25:53 PST 2009


On Jan 29, 2009, at 6:31 PM, <Sachin.Punyani at microchip.com> <Sachin.Punyani at microchip.com 
 > wrote:

>> Hi Sachin,
>>
>> The declaration of functions called via the "call" instruction is a
>> GlobalValue in your Module. You can go through all of the
>> GlobalValues, look for those that are Function declarations (use the
>> "Function::isDeclaration()" method), and then placing them in the
>> appropriate place in your assembly file.
>>
>> Would that work?
>
> Hi Bill,
>
> Function definitions and declarations that are parsed by clang make  
> part
> of the FunctionList in Module. However the libcalls that are created
> during the lowering do not make part of this list.
>
> For example PIC16 does not support shift operation of 16 bits. For  
> this
> LLVM generates the libcall. For creating such a call it uses
> ExternalSymbol and therefore it is not available in the FunctionList.
>
> I need to emit declaration for these libcalls. So FunctionList does  
> not
> provide me the information. Is there any other way I can get the
> information of these libcalls in AsmPrinter?
>
I'm not sure. I suppose that they would have to be in a list  
somewhere, because they would need to be printed in the ASM file. Try  
grepping around in the AsmPrinter stuff to see what prints them out.  
See if there's a list and then go from there.

Good luck!

-bw



More information about the llvm-dev mailing list