[LLVMdev] reference to non-static member function must be called

Jin Huang 54jin.huang at gmail.com
Wed Jan 8 18:44:22 PST 2014

Sorry ,I forgot to give the definition. I define the print in the
doInitialization(Module &M); and it seems in the InstVisitor(), this can
not be identified .
What I really want to do is to get every load/store instructions's operand
address in runtime and print it out when the program is running. I wrote a
function to do the print work and make it into a dynamic library, so in the
functionPass , I define the print functiono like this :

  bool doInitialization(Module &M)
//Get the refference of the types
IntegerType* Int8Type  = IntegerType::getInt8Ty(M.getContext());
IntegerType* Int32Type = IntegerType::getInt32Ty(M.getContext());
IntegerType* Int64Type = IntegerType::getInt64Ty(M.getContext());
PointerType* VoidPtrType = PointerType::getUnqual(Int8Type);
Type* VoidType = Type::getVoidTy(M.getContext());
 //Get the function we needed in runtime
    Function *print = cast<Function>(M.getOrInsertFunction("my_print",
I thought if I define the function here ,then in the InstVisitor, I can use
it directly´╝îwithout define it in every specific InstVisitor
function()(eg:visitStoreInst() visitLoadInst(),etc).But I was wrong.
I redefine the function in the visitStoreInst(), and it works.

Is there any easy way to use the function I wrote myself in the

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140109/266f8d44/attachment.html>

More information about the llvm-dev mailing list