[LLVMdev] Fwd: LLVM Help

Tim Northover t.p.northover at gmail.com
Fri Nov 7 15:52:42 PST 2014


Hi Omar,

On 7 November 2014 15:31, Omar Abed Alkar Darwish
<omar.darwish at wmich.edu> wrote:
> fprintf(f, "NumGetElementPtrInst: %d\n, NumLoadInst: %d\n,NumStoreInst:
> %d\n,NumCallInst: %d\n,NumInvokeInst: %d\n,NumAllocaInst:
> %d\n",NumGetElementPtrInst ,
> NumLoadInst,NumStoreInst,NumCallInst,NumInvokeInst,NumAllocaInst);

These variables aren't simply integers. They're C++ class types and
because of that are being passed oddly into the variadic function
fprintf. You should be able to cast them all to "unsigned" for your
purposes.

> 2-If I changed the InstCount.cpp do I have to make llvm from the scratch or
> their is a simple way to do the make (where it doesn't take long time just
> take the minor changes)

It ought to be possible to compile your own pass to a .so file and
load it into opt dynamically. There's some kind of documentation at
http://llvm.org/docs/CMake.html#cmake-out-of-source-pass, but I've not
done it before so I don't know how reliable it is.

Cheers.

Tim.



More information about the llvm-dev mailing list