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

Philip Reames listmail at philipreames.com
Wed Jan 8 09:38:29 PST 2014


Which version of LLVM are you building against?  In current TOT, there 
is no CallInst::Create function with the signature you're calling it 
with.  (You're missing the name argument.)

Philip

On 1/7/14 11:25 PM, JinHuang wrote:
> Hi,everyone.
> I'm writing a pass in which a CallInst to an external function will be
> inserted. The function is declared like this:
>
> void func(int a, unsigned chat *p);
>
> and in the Pass(a Function Pass ,and using the InstVistor template ), I
> wrote like this:
>
>   	void visitStoreInst(StoreInst &SI)
> 		{
> 				//Get the refference of the types
> 			Module *M = SI.getParent()->getParent()->getParent();
> 			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());
> 			DataLayout *TD = &getAnalysis<DataLayout>();	
>
> 			Value *Pointer = SI.getPointerOperand();
> 			Pointer = castTo(Pointer,VoidPtrType,Pointer->getName(),&SI);
> 			uint64_t size = TD->getTypeStoreSize(SI.getOperand(0)->getType());
> 			Value *StoreSize = ConstantInt::get(Int32Type, size);
> 			std::vector<Value *> args;
> 			args.push_back(StoreSize);
> 			args.push_back(Pointer);
> 			args.push_back(0);
>
> 			Instruction *inst = CallInst::Create(print,args,"",&SI);
>
> 		}
> while compiling , it came out such error:
>
> error: reference to non-static member function must be
>        called
>                          Instruction *inst =
> CallInst::Create(print,args,"",&SI);
>
> Can anyone tell me how to fix it? I can not get much useful information in
> google!
> Thank you!
>
> -JinHuang
>
>
>
> --
> View this message in context: http://llvm.1065342.n5.nabble.com/reference-to-non-static-member-function-must-be-called-tp64865.html
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list