diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-12-07 04:38:34 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-12-07 04:38:34 +0000 |
commit | a10c22b796a5fa0bdc2b1565e375dac40dc1405a (patch) | |
tree | 19ebfeb47b8465e9cfbb234601ff8da470ee3e87 /lib/CodeGen/CGVtable.cpp | |
parent | f53df2398e07d13be9962b95aebc19b31706fa33 (diff) |
Tweak the formula for non-virtual offsets to something which appears a bit
more accurate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index d227a5e47e..43c0fe7de1 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -376,8 +376,9 @@ public: D1(printf(" vfn for %s at %d\n", MD->getNameAsString().c_str(), (int)Index[GD])); + + VCallOffset[GD] = Offset/8; if (MorallyVirtual) { - VCallOffset[GD] = Offset/8; Index_t &idx = VCall[GD]; // Allocate the first one, after that, we reuse the previous one. if (idx == 0) { @@ -844,8 +845,7 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, bool MorallyVirtual, return true; } - // FIXME: finish off - int64_t NonVirtualAdjustment = VCallOffset[OGD] - OverrideOffset/8; + int64_t NonVirtualAdjustment = -VCallOffset[OGD] + OverrideOffset/8; if (NonVirtualAdjustment) { ThunkAdjustment ThisAdjustment(NonVirtualAdjustment, 0); |