search for: callinst

Displaying 20 results from an estimated 839 matches for "callinst".

2008 Apr 09
2
[LLVMdev] Compiling Stacker compiler
...es.h:374: note: candidates are: static llvm::PointerType* llvm::PointerType::get(const llvm::Type*, unsigned int) StackerCompiler.cpp: In member function 'llvm::BasicBlock* StackerCompiler::handle_if(char*, char*)': StackerCompiler.cpp:750: error: no matching function for call to 'llvm::CallInst::CallInst(llvm::Function*&, llvm::Value**, size_t)' /opt/src-llvm/include/llvm/Instructions.h:900: note: candidates are: llvm::CallInst::CallInst(llvm::Value*, const std::string&, llvm::BasicBlock*) /opt/src-llvm/include/llvm/Instructions.h:899: note: llvm::CallInst::CallInst(llvm::Valu...
2009 Nov 18
2
[LLVMdev] Strange error using CallInst constructor
Hi, This is probably more of a standard C++ question instead of an actual LLVM question, but here it goes anyway. I'm trying to invoke the following constructor: CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr, BasicBlock *InsertAtEnd); My code is: using namespace llvm; void replaceByClone(Function *f, CallInst *I){ Function *clone = CloneFunction(f); BasicBlock::iterator ii(I); ReplaceInstWithInst(I->getP...
2009 Nov 19
0
[LLVMdev] Strange error using CallInst constructor
Please keep replies on the list. Now you've missed "InputIterator must be a random-access iterator pointing to contiguous storage (e.g. a std::vector<>::iterator). Checks are made for random-accessness but not for contiguous storage as that would incur runtime overhead." from CallInst's constructor (although that comment should be on Create()). Function::arg_iterator isn't random-access. You probably also want to pull the arguments out of the old CallInst, not out of the parameters of the new function. The old CallInst that you're replacing can't see the argumen...
2006 Feb 14
1
[LLVMdev] dynamic_cast error
Hello, Following statement from LLVM Programmer's Manual is not compiling. CallInst* callInst = dyn_cast<CallInst>(&*basic_block_iterator_1); The gcc version is : gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8) ============ Error message ============ llvm/include/llvm/Support/Casting.h: In function 'bool llvm::isa_impl(const From&) [with To = llvm::CallInst, From =...
2012 Jan 06
2
[LLVMdev] How to duplicate a CallInst
...2 %34) nounwind* * * i.e, two instructions exactly equal. Using clone, results in badref. Moreover, how can I get the parameters of function? This is my experimental code that not is running wich I need: for (BasicBlock::iterator Is = i->begin(), e = i->end(); Is != e; ++Is){ if(isa<CallInst>(*Is)){ CallInst *call = dyn_cast<CallInst>(&*Is); Function* ft = call->getCalledFunction(); *arguments = ????* CallInst *call2 = CallInst::Create(ft, *arguments.begin(), arguments.end()*, "", ++Is); } } Thanks, -- *Rafael Parizi* -----...
2018 Mar 23
3
Change function call name in a CallInst only in certain functions
Hello, In my module I have functions: a b c f3 calls "a" f2 calls "a" f1 calls "b" I would like to modify a CallInst in the f2. Now it calls "a", but I want changed it to "c". When loop over the instructions of the f2, I can get a CallInst to be modified, then I use "setName" to changed it to "c". Problem is, since references are updated, "a" is changed to &qu...
2007 Mar 07
3
[LLVMdev] use of CallInst()
To create a new CallInst I used to call the following constructor: CallInst(Value *F, const std::vector<Value*> &Par, const std::string &Name = "", Instruction *InsertBefore = 0); However, it seems as though that constructor has been removed. I assume that I'm suppossed to use the following...
2018 Mar 24
0
Change function call name in a CallInst only in certain functions
You are probably calling setName() on the called Function, which in-turned renamed the called Function instead of replacing the called function. Depending on your use-case, if you are certain that you only need to modify CallInsts, then you could simply call CallInst::setCalledFunction , otherwise it’s probably wiser to use CallSite as a wrapper for both CallInst and InvokeInst. Do note, however, that no matter which solution you end up using, you’ll need to update the FunctionType as well Zhang > On 23 Mar 2018, at 23:...
2010 Jun 30
2
[LLVMdev] [HEADSUP] Another attempt at CallInst operand rotation
Am 30.06.2010 um 23:31 schrieb John Criswell: > > Stupid question: is making the getOperand() method of CallInst > going to work? For example, if I have the following code: > > void > method (Instruction * I) { > I->getOperand(2); > ... > } > > void method2 (CallInst * CI) { > method (CI); > ... > } > > Will method() still work when you make CallInst...
2015 Nov 13
5
How to efficiently extract the calledFunction from a complex CallInst?
Hi all, Usually if we want to get the called Function we can directly use CallInst->getCalledFunction(), however, today i encounter an unusual CallInst as follows: %call11 = call double (...)* bitcast (double ()* @quantum_frand to double (...)*)() the original C source involve type cast: float u,v; extern double quantum_frand(); u = 2 * quantum_frand() - 1; v = 2 * q...
2005 Aug 24
1
[LLVMdev] CallInst constructor interface
...std::vector<Value*> args; args.push_back(arg1); args.push_back(arg2); ... args.push_back(argn); FunctionType *FType = FunctionType::get(RetTy, formalArgs, false); Module *M = before->getParent()->getParent()->getParent(); Function *F = M->getOrInsertFunction(FName, FType); CallInst *call = new CallInst(F, args, "func", before); It seems that for the common case you should just be able to write this: std::vector<Value*> args; args.push_back(arg1); args.push_back(arg2); ... args.push_back(argn); CallInst *call = new CallInst(RetTy, FName, args, "fun...
2012 Apr 10
4
[LLVMdev] How to explain this weird phenomenon????????
My friends, I ran a function pass on a .bc file, intending to insert a CallInst to my self-made check function. The compilation is successful. BUT after I ran that pass on the .bc file, the size of the file didn't get any bigger!! Does this mean my instrumentation work failed?? BTW the opt command I use is "opt -load ../../../Debug+Asserts/lib/Hello.so -hello <...
2007 Mar 07
0
[LLVMdev] use of CallInst()
On Tue, 2007-03-06 at 22:44 -0600, Ryan M. Lefever wrote: > To create a new CallInst I used to call the following constructor: > > CallInst(Value *F, const std::vector<Value*> &Par, const std::string > &Name = "", Instruction *InsertBefore = 0); > > However, it seems as though that constructor has been removed. I assume > that I'm...
2010 Jul 01
0
[LLVMdev] [HEADSUP] Another attempt at CallInst operand rotation
Gabor Greif wrote: > Am 30.06.2010 um 23:31 schrieb John Criswell: > > >> Stupid question: is making the getOperand() method of CallInst >> going to work? For example, if I have the following code: >> >> void >> method (Instruction * I) { >> I->getOperand(2); >> ... >> } >> >> void method2 (CallInst * CI) { >> method (CI); >> ... >> } >>...
2010 Jun 30
0
[LLVMdev] [HEADSUP] Another attempt at CallInst operand rotation
Gabor Greif wrote: > Hi all, > > I am almost ready for the last step with landing my long-standing patch. > I have converted (almost) all low-level interface users of CallInst to > respective high-level interfaces. What remains is a handful of hunks > to flip the switch. > > But before I do the final commit I'd like to coerce all external users > to code against the high-level interface too. This will (almost, but > see below) give us static guarant...
2010 Jun 30
4
[LLVMdev] [HEADSUP] Another attempt at CallInst operand rotation
Hi all, I am almost ready for the last step with landing my long-standing patch. I have converted (almost) all low-level interface users of CallInst to respective high-level interfaces. What remains is a handful of hunks to flip the switch. But before I do the final commit I'd like to coerce all external users to code against the high-level interface too. This will (almost, but see below) give us static guarantees that out-of-tree code rem...
2014 Jul 07
2
[LLVMdev] Return Type of Call Function with nested bitcast
Hi All, I am facing an issue with CallInst with nested bitcast instruction. I want to check if the return type of a call is void or non-void the below line works well for CallInst without bit cast. *cast<CallInst>(I)->getCalledFunction()->getReturnType()->isVoidTy()* But for Call instructions like *call void bitcast (void (...
2007 Mar 07
1
[LLVMdev] use of CallInst()
Thanks for the help Reid! I frequently look at the online doxygen, but sometimes its difficult to determine the correct replacement when a method is removed from LLVM. In this particular case, I knew which new CallInst constructor to use, I just couldn't figure out the proper syntax. At any rate, I really appreciate your help!! Reid Spencer wrote: > On Tue, 2007-03-06 at 22:44 -0600, Ryan M. Lefever wrote: >> To create a new CallInst I used to call the following constructor: >> >> CallI...
2012 Apr 10
0
[LLVMdev] How to explain this weird phenomenon????????
...zhenkaixd at 126.com or 846227103 at qq.com TEL: 15810729006(Beijing) Address: Room I-406, Central Building, Tsinghua University, Beijing, China. 100084. At 2012-04-10 19:34:51,15102925731 <zhenkaixd at 126.com> wrote: My friends, I ran a function pass on a .bc file, intending to insert a CallInst to my self-made check function. The compilation is successful. BUT after I ran that pass on the .bc file, the size of the file didn't get any bigger!! Does this mean my instrumentation work failed?? BTW the opt command I use is "opt -load ../../../Debug+Asserts/lib/Hello.so -hello <...
2010 Feb 07
3
[LLVMdev] Help with Mac OS X 10.6.2 build
...llvm::GlobalValue::LinkageTypes, llvm::Twine const&, llvm::Module*)", referenced from: PrototypeAST::Codegen() in ccHkdHVT.o "llvm::Instruction::Instruction(llvm::Type const*, unsigned int, llvm::Use*, unsigned int, llvm::Instruction*)", referenced from: llvm::CallInst::CallInst<__gnu_cxx::__normal_iterator<llvm::Value**, std::vector<llvm::Value*, std::allocator<llvm::Value*> > > >(llvm::Value*, __gnu_cxx::__normal_iterator<llvm::Value**, std::vector<llvm::Value*, std::allocator<llvm::Value*> > >, __gnu_cxx::__normal_iter...