Displaying 19 results from an estimated 19 matches for "getprev".
2007 May 11
0
[LLVMdev] Instruction::getNext and Instruction::getPrev are private
Hi,
I switched to the upcoming version 2.0 branch and porting my code from
1.9. Thanks there is not a lot to do. I found that
Instruction::getNext and Instruction::getPrev are private. Is this
intentional? If yes, what would you recommend instead using them?
Thanks,
Ferad
2007 May 11
0
[LLVMdev] Instruction::getNext and Instruction::getPrev are private
...iterator instead..
On 5/11/07, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> Hello, Ferad.
>
> > I switched to the upcoming version 2.0 branch and porting my code from
> > 1.9. Thanks there is not a lot to do. I found that
> > Instruction::getNext and Instruction::getPrev are private. Is this
> > intentional?
> Yes, incorrect usage of them caused hard-tracking bugs (e.g. calling
> getNext() on terminator returns you the last "dummy" instruction in the
> list, and so on).
>
> > If yes, what would you recommend instead using them?
&g...
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 option.
On Thu, Dec 20, 2012...
2007 May 11
0
[LLVMdev] Instruction::getNext and Instruction::getPrev are private
Hi Ferad!
the change has been made with
<http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-
Mon-20070416/047931.html>
You have to use iterators now and "operator ++" etc.
Hope this helps,
cheers,
Gabor
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 current-...
2005 Aug 13
1
[LLVMdev] Adding instructions to loop
...tructions before and after all loops. To do
this, I've added a simple function as follows:
void addToAllLoops(Loop * IL) {
addToAllLoops(IL);
BasicBlock * PH = IL->getLoopPreheader();
Instruction *InstrCallPre = new CallInst(PrintLoopBegin, "",
PH->getPrev());
return;
}
The function added is trivial:
void printloopbegin() {
fprintf (stderr,"Loop Beginning\n");
}
The function is called from runOnFunction() as follows:
PrintLoopBegin = F.getParent()->getOrInsertFunction("printloopbegin",...
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
"...
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 head. I don't see any method
> like hasPrevNode.
> It can be a weird problem because "current->getPrevNode()" is indic...
2012 Dec 20
3
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
...ne 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;
errs()<<"AAA\n";
if(*current->getPrevNode()*)
{
errs()<<"BBB\n";
previous = current->getPrevNode();
ok=1;
}
if (ok){
errs()<<"CCC\n";
........
It does print AAA, but then I have the segfault. So when I am evaluatin...
2007 May 20
2
[LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
...ould be able to use -fno-builtins to disable
> this.
Thanks, that did the trick.
Some final remarks (my app works again :-)):
* llvm.va_start and similar intrinsics now have an i8* arg instead
of an sbyte**
* For some reason the Arguments of a Function are now circularly
linked, i.e. getPrev()/Next() does not yield 0 when the first
Argument is reached, but jumps back to the last one. I experienced
this with a loop I was using to find out the index of an Argument. It
relied on the fact that getPrev() would eventually give 0, which
worked in previous LLVM versions.
On a related...
2007 May 23
0
[LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
...sable
>> this.
>
> Thanks, that did the trick.
>
> Some final remarks (my app works again :-)):
> * llvm.va_start and similar intrinsics now have an i8* arg instead
> of an sbyte**
ok
> * For some reason the Arguments of a Function are now circularly
> linked, i.e. getPrev()/Next() does not yield 0 when the first
> Argument is reached, but jumps back to the last one. I experienced
> this with a loop I was using to find out the index of an Argument. It
> relied on the fact that getPrev() would eventually give 0, which
> worked in previous LLVM versions.
A...
2007 May 18
0
[LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
On Sat, 19 May 2007, Anton Korobeynikov wrote:
>> * It seems that a C-call like printf("---\n") is transformed to puts
>> ("---") in the LLVM IR instead of keeping it a printf. What are the
>> circumstances in which this happens? Do other similar conversions
>> occur? Can this be turned off (lower optimisation level?)? Manually
>> replacing the
2007 May 18
1
[LLVMdev] API changes (was Antw.: 2.0 Pre-release tarballs online)
Hello, Bram
> * It seems that a C-call like printf("---\n") is transformed to puts
> ("---") in the LLVM IR instead of keeping it a printf. What are the
> circumstances in which this happens? Do other similar conversions
> occur? Can this be turned off (lower optimisation level?)? Manually
> replacing the puts-calls by a printf-call is not
2009 Jan 16
1
[LLVMdev] Problem using ilist container
...tachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090116/18390546/attachment.html>
-------------- next part --------------
/usr/local/llvm/src/include/llvm/ADT/ilist.h: In static member function 'static NodeTy* llvm::ilist_nextprev_traits<NodeTy>::getPrev(NodeTy*) [with NodeTy = llvm::Instruction*]':
/usr/local/llvm/src/include/llvm/ADT/ilist.h:268: instantiated from 'NodeTy* llvm::iplist<NodeTy, Traits>::getTail() [with NodeTy = llvm::Instruction*, Traits = llvm::ilist_traits<llvm::Instruction*>]'
/usr/local/llvm/src/inclu...
2011 Nov 14
0
[LLVMdev] ilist::getPrevNode asserts on list head
Hi all,
I am finding a SEGFAULT in one of my passes when using getPrevNode on an
instruction that is the only one in a BasicBlock. I was expecting
getPrevNode to return 0 in that case (as per docs), but it breaks.
I guess the code in in ilist_node.h:
NodeTy *getPrevNode() {
NodeTy *Prev = this->getPrev();
// Check for sentinel.
if (!Prev->getNext())...
2007 Jan 13
1
[LLVMdev] Value* as used by the non-JITted interpreter
Hi all,
I've now got my LLVM-based model checker more or less working, but I'm
seeing something a bit strange happening.
As you may remember, I started with the lli code and extended it
considerably. I have retained something that looks vaguely like the
original ExecutionContext stack, though I now have one stack per thread,
and the whole data structure is implemented with custom
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 Mar 30
1
[LLVMdev] load instruction memory operands value null
Hi,
For a custom target, there is a pass to perform memory dependence analysis, where, i need to get memory pointer for "load instruction". I want to check the pointer alias behavior. I am getting this by considering the memoperands for the load instruction.
For "load instruction", Machine Instruction dumps as below:
vr12<def> = LD_Iri %vr2<kill>, 0;
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