[LLVMbugs] [Bug 6995] New: C++ classes get lowered to gross IR types
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Apr 30 13:31:55 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=6995
Summary: C++ classes get lowered to gross IR types
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: clattner at apple.com
CC: llvmbugs at cs.uiuc.edu
In some thing like the example below, we compile the struct types to this:
%0 = type { i8*, i8* }
%1 = type { i8*, i8*, i32, i32, i8*, i64, i8*, i64 }
%2 = type { i8*, i8*, i8* }
%struct.A = type { i8** }
%struct.B = type { i8** }
%struct.C = type { [16 x i8] }
%struct.D = type { [16 x i8] }
This is really nasty, llvm-gcc produces something much more friendly to the
optimizers:
%struct.A = type { i32 (...)** }
%struct.B = type { i32 (...)** }
%struct.C = type { %struct.A, %struct.A }
%struct.D = type { %struct.C }
struct A {
virtual int f() { return 1; }
};
struct B {
virtual int f() { return 2; }
};
struct C : A, B {
virtual int f() { return 3; }
};
struct D : C {
virtual int f() { return 4; }
};
static int f(D* d) {
B* b = d;
return b->f();
};
int g() {
D d;
return f(&d);
}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list