[svn r119] Added the monitor data field that comes after the vtable pointer to all classes. Represented as a void* initialized to zero.

This commit is contained in:
Tomas Lindquist Olsen
2007-11-25 03:58:55 +01:00
parent 541a677a54
commit c08b0918cc
3 changed files with 70 additions and 28 deletions

View File

@@ -389,8 +389,11 @@ void ClassDeclaration::offsetToIndex(Type* t, unsigned os, std::vector<unsigned>
unsigned idx = 0;
unsigned r = LLVM_ClassOffsetToIndex(this, os, idx);
assert(r != (unsigned)-1 && "Offset not found in any aggregate field");
r++; // vtable is 0
// vtable is 0, monitor is 1
r += 2;
// interface offset further
r += vtblInterfaces->dim;
// the final index was not pushed
result.push_back(r);
}