Mercurial > projects > ldc
comparison gen/toobj.cpp @ 115:5ba6d286c941 trunk
[svn r119] Added the monitor data field that comes after the vtable pointer to all classes. Represented as a void* initialized to zero.
author | lindquist |
---|---|
date | Sun, 25 Nov 2007 03:58:55 +0100 |
parents | 27b9f749d9fe |
children | fd7ad91fd713 |
comparison
equal
deleted
inserted
replaced
114:5880c12dba83 | 115:5ba6d286c941 |
---|---|
387 void ClassDeclaration::offsetToIndex(Type* t, unsigned os, std::vector<unsigned>& result) | 387 void ClassDeclaration::offsetToIndex(Type* t, unsigned os, std::vector<unsigned>& result) |
388 { | 388 { |
389 unsigned idx = 0; | 389 unsigned idx = 0; |
390 unsigned r = LLVM_ClassOffsetToIndex(this, os, idx); | 390 unsigned r = LLVM_ClassOffsetToIndex(this, os, idx); |
391 assert(r != (unsigned)-1 && "Offset not found in any aggregate field"); | 391 assert(r != (unsigned)-1 && "Offset not found in any aggregate field"); |
392 r++; // vtable is 0 | 392 // vtable is 0, monitor is 1 |
393 r += 2; | |
394 // interface offset further | |
393 r += vtblInterfaces->dim; | 395 r += vtblInterfaces->dim; |
396 // the final index was not pushed | |
394 result.push_back(r); | 397 result.push_back(r); |
395 } | 398 } |
396 | 399 |
397 /* ================================================================== */ | 400 /* ================================================================== */ |
398 | 401 |