similar to: [LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*"

2012 Dec 20
3
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
Hello John, I was following your procedures and I isolated the problem. The problem are represented by the basic blocks with only one element. for (Function::iterator II = F.begin(), EE = F.end(); II != EE; ++II, ++ii) { BasicBlock* BB=II; if (BB->getTerminator()) { Instruction* current = BB->getTerminator(); Instruction* previous;
2012 Dec 20
0
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
Hello John, I was following your procedures and I isolated the problem. The problem are represented by the basic blocks with only one elements. for (Function::iterator II = F.begin(), EE = F.end(); II != EE; ++II, ++ii) { BasicBlock* BB=II; if (BB->getTerminator()) { Instruction* current = BB->getTerminator(); Instruction* previous;
2012 Dec 18
1
[LLVMdev] BasicBlock back()
PS: I works when I use Instruction* prev = current->getPrevNode(); But then I have runtime error Stack dump that is very frequent... On Mon, Dec 17, 2012 at 6:20 PM, John Criswell <criswell at illinois.edu>wrote: > On 12/17/12 10:34 AM, Alexandru Ionut Diaconescu wrote: > > Hello, > > I am a beginner of LLVM. I am trying to move among the instructions of a >
2012 Dec 17
0
[LLVMdev] BasicBlock back()
On 12/17/12 10:34 AM, Alexandru Ionut Diaconescu wrote: > Hello, > > I am a beginner of LLVM. I am trying to move among the instructions of > a BasicBlock and I cannot. In this particular example, I try to get > the previous instruction of the end instruction. I am trying 2 methods: > > > > 1. I have the following sequence of code: > > bool
2012 Dec 17
4
[LLVMdev] BasicBlock back()
Hello, I am a beginner of LLVM. I am trying to move among the instructions of a BasicBlock and I cannot. In this particular example, I try to get the previous instruction of the end instruction. I am trying 2 methods: 1. I have the following sequence of code: bool patternDC::runOnBasicBlock(BasicBlock &BB) { ... if (BB.getTerminator()) { Instruction* current =
2012 Dec 20
1
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
I solved by checking if(BB->size()>1) Thank you all for the help ! Now debugging the next segfault. On Thu, Dec 20, 2012 at 12:59 PM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>() > Get the previous node, or 0 for the list
2012 Dec 20
2
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
Hello, Thank you for your answer. If I want to use then I have error: ‘NodeTy* llvm::ilist_half_node<NodeTy>::getPrev() [with NodeTy = llvm::Instruction]’ is protected error: ‘llvm::ilist_half_node<llvm::Instruction>’ is not an accessible base of ‘llvm::Instruction’ Do you know any other method to access the previous instruction of a terminator instruction? PS: back() is not an
2012 Dec 20
0
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
I may be mistaken as I just took a quick look, but in ilist_node the function "getPrevNode()" actually calls a method on the previous node: NodeTy *getPrevNode() { NodeTy *Prev = this->getPrev(); // Check for sentinel. if (!Prev->getNext()) return 0; return Prev; } http://llvm.org/docs/doxygen/html/ilist__node_8h_source.html#l00058 Try checking if
2012 Dec 20
0
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>() Get the previous node, or 0 for the list head. I don't see any method like hasPrevNode. It can be a weird problem because "current->getPrevNode()" is indicating to "current" itself (the problem appears for the BB with only one element)? On Thu, Dec
2013 Jan 10
2
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hello everyone ! In my pass I inspect the penultimate instruction from every basic block in runOnFunction(). I am interested in ICMP instructions only. if(BB->size()>1) if(last->getPrevNode()) { previous = last->getPrevNode(); ok=1; } I want to get the operands of previous, which is of type Instruction*. Due tests based on getNumOperands, ICMP has 2 (as
2013 Jan 10
0
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hi, On 10/01/13 10:56, Alexandru Ionut Diaconescu wrote: > Hello everyone ! > > In my pass I inspect the penultimate instruction from every basic block in > runOnFunction(). I am interested in ICMP instructions only. > > |if(BB->size()>1) > if(last->getPrevNode()) > { > previous = last->getPrevNode(); > ok=1; > } > |
2013 Apr 26
2
[LLVMdev] CallGraph
Thanks for the response. I looked and I cannot see what exactly I need. I saw getCalledFunction() so I need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an instruction. It seems not easier than the "unelegant" version....if I am still at the Instruction level... I need a method that takes from a "leaf" basic block from a function (Maybe there is
2013 Apr 26
2
[LLVMdev] CallGraph
Hello, I try to make a big CFG (control flow graph) by combining all the CFG-s from all the functions of a module. I still have one problem : I want to get the links between functions. For CFG-s, I used CallGraphNode->second->getFunction, then Function_iterators and succ_iterators, so I have all the links between BBs. Now, the questions is how do I link BBs from different functions? I can
2013 Apr 26
0
[LLVMdev] CallGraph
Hi, On 26/04/13 13:17, Alexandru Ionut Diaconescu wrote: > Thanks for the response. > I looked and I cannot see what exactly I need. I saw getCalledFunction() so I > need CallSite CS(cast<Value>(II)) where II is a basic block iterator, so an > instruction. It seems not easier than the "unelegant" version....if I am still > at the Instruction level... the call graph
2013 Apr 26
0
[LLVMdev] CallGraph
Hi, On 26/04/13 11:19, Alexandru Ionut Diaconescu wrote: > Hello, > > I try to make a big CFG (control flow graph) by combining all the CFG-s from all > the functions of a module. I still have one problem : I want to get the links > between functions. > > For CFG-s, I used CallGraphNode->second->getFunction, then Function_iterators > and succ_iterators, so I have all
2011 May 20
3
[LLVMdev] convert a char * to a value
Hi all, Please i need help, I have a method that takes 2 arguments with type char *: void branchPredict(char *b1, char *b2){ --- -- } i'm supposed to add this method, in an IR basic bloc: to add it into a basic bloc i do: //i: is the basic bloc std::vector<Value*> void_43_params; Constant* tbname = ConstantArray::get(M.getContext(),i->getNameStr() , true); Constant* pbname =
2012 Dec 18
1
[LLVMdev] problem with runOnLoop
John Criswell <criswell <at> illinois.edu> writes: > > > On 12/12/11 9:59 AM, neda 8664 wrote: > > > hi all, > I want access to all basic blocks of function in a loop, so I used > the following code:bool parallel::runOnLoop(Loop *L, LPPassManager > &LPM) > { >     for
2011 May 20
0
[LLVMdev] convert a char * to a value
On 5/20/11 5:46 PM, Nabila ABDESSAIED wrote: > Hi all, > > Please i need help, I have a method that takes 2 arguments with type > char *: > void branchPredict(char *b1, char *b2){ > --- > -- > } > i'm supposed to add this method, in an IR basic bloc: > to add it into a basic bloc i do: The problem is that you are passing arrays to the function instead of
2010 Jun 25
1
[LLVMdev] redundant checking of terminator in Verifier?
Hi, The checking about that if this is a terminator that it is at the end of the block has been applied twice (bellow). One is at Verifier::visitInstruction, and the other is at Verifier::visitTerminatorInst. Since visitInstruction is called when visiting each instruction, the checking at visitTerminatorInst seems redundant to me. Did I miss any case? void Verifier::visitInstruction(Instruction
2013 Mar 05
5
[LLVMdev] LLVM load instruction query
HI, I am creating a pass that will pass loaded value by load instruction to an external function. I don't know how to do it.Please Help.