[LLVMdev] Patch: MSIL backend global pointers initialization

Artur Pietrek pietreka at gmail.com
Wed Apr 15 01:43:51 PDT 2009


> So, looking for type of callee (not result, but function type!) you'll
> obtain the
> real "signature" of callee and if you'll strip all pointer cast you'll
> obtain the "declaration" (=variadic) type of the callee.

Maybe I misunderstood something but I just get the variadic declaration not
the real "signature", like this:

const CallInst *I = dyn_cast<CallInst>(A);

my CallInst looks like:
%1 = tail call i32 (i8*, ...)* @printf(i8* noalias %0, i32 123) nounwind

const Value *Callee = I->getCalledValue();
my Callee is: declare i32 @printf(i8* nocapture, ...) nounwind

const PointerType  *PTy   = cast<PointerType>(Callee->getType());
I get: i32 (i8*, ...)*

const FunctionType *FTy   = cast<FunctionType>(PTy->getElementType());
so I get: i32 (i8*, ...)

The interesting for me part of the CallInst is printf(i8* noalias %0, i32
I was diging in doxygen documentation but I really can't see the easy way to
compare those instructions and again finish with reinvented (but working)
wheel ;).
I would really appreciate help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090415/62e93a2c/attachment.html>

More information about the llvm-dev mailing list