JinHuang
2014-Jan-09 02:11 UTC
[LLVMdev] reference to non-static member function must be called
I'm using LLVM 3.3 Release. From the Class Reference Page. CallInst has a member function : static CallInst * Create (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0) This is what I want to use! the default name is "" and I also use that . Thanks! ----- Kind Regards! -JinHuang -- View this message in context: http://llvm.1065342.n5.nabble.com/reference-to-non-static-member-function-must-be-called-tp64865p64894.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Jin Huang
2014-Jan-09 02:15 UTC
[LLVMdev] reference to non-static member function must be called
I'm using LLVM 3.3 Release. From the Class Reference Page. CallInst has a member function : static CallInst * Create (Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=0) This is what I want to use! the default name is "" and I also use that . Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140109/770f5ca0/attachment.html>
Jin Huang
2014-Jan-09 02:44 UTC
[LLVMdev] reference to non-static member function must be called
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",
VoidType,
Int32Type,
VoidPtrType
));
};
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
instVisitor?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20140109/266f8d44/attachment.html>