Displaying 4 results from an estimated 4 matches for "_z3sum2a1s_".
2012 Dec 01
2
[LLVMdev] operator overloading fails while debugging with gdb for i386
...code)
struct A1 {
int x;
int y;
};
A1 sum(const A1 one, const A1 two)
{
A1 plus = {0,0};
plus.x = one.x + two.x;
plus.y = one.y + two.y;
return (plus);
}
int main (void)
{
A1 one= {2,3};
A1 two= {4,5};
A1 three = sum(one,two);
return 0;
}
gcc assembley (snippet of sum function)
_Z3sum2A1S_:
.loc 1 8 0
pushl %ebp
movl %esp, %ebp
.loc 1 9 0
movl 8(%ebp), %eax
movl $0, (%eax)
movl 8(%ebp), %eax
movl $0, 4(%eax)
.loc 1 10 0
movl 12(%ebp), %edx
movl 20(%ebp), %eax
addl %eax, %edx
movl 8(%ebp), %eax
movl...
2012 Dec 01
0
[LLVMdev] operator overloading fails while debugging with gdb for i386
...code)
struct A1 {
int x;
int y;
};
A1 sum(const A1 one, const A1 two)
{
A1 plus = {0,0};
plus.x = one.x + two.x;
plus.y = one.y + two.y;
return (plus);
}
int main (void)
{
A1 one= {2,3};
A1 two= {4,5};
A1 three = sum(one,two);
return 0;
}
gcc assembley (snippet of sum function)
_Z3sum2A1S_:
.loc 1 8 0
pushl %ebp
movl %esp, %ebp
.loc 1 9 0
movl 8(%ebp), %eax
movl $0, (%eax)
movl 8(%ebp), %eax
movl $0, 4(%eax)
.loc 1 10 0
movl 12(%ebp), %edx
movl 20(%ebp), %eax
addl %eax, %edx
movl 8(%ebp), %eax
movl...
2012 Nov 29
2
[LLVMdev] operator overloading fails while debugging with gdb for i386
For the given test:
class A1 {
int x;
int y;
public:
A1(int a, int b)
{
x=a;
y=b;
}
A1 operator+(const A1&);
};
A1 A1::operator+(const A1& second)
{
A1 sum(0,0);
sum.x = x + second.x;
sum.y = y + second.y;
return (sum);
}
int main (void)
{
A1 one(2,3);
A1 two(4,5);
return 0;
}
when the exectable of this code is debugged in gdb for i386, we dont get the
2012 Dec 02
0
[LLVMdev] operator overloading fails while debugging with gdb for i386
Hi,
As you told that function ends up returning void, I just confirmed it in
the IR, the function is defined as:
define *void* @_Z3sum2A1S_(*%struct.A1* noalias sret %agg.result*,
%struct.A1* byval align 4 %one, %struct.A1* byval align 4 %two).
But when i checked the register values in g++, eax contains an address of
stack, which points to the value (object) returned by sum. That is if we
print the contents of the address stored in ea...