diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-12-04 02:08:24 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-12-04 02:08:24 +0000 |
| commit | cdf189808616307a04f0de6a842b81788570ac7d (patch) | |
| tree | d831180f89f411346442d8086f8dc2fdeb008f05 /clang/lib/CodeGen/CGVtable.cpp | |
| parent | c7916f9ff27c834a8e2b9cc6843021bb4c5f09bc (diff) | |
| download | bcm5719-llvm-cdf189808616307a04f0de6a842b81788570ac7d.tar.gz bcm5719-llvm-cdf189808616307a04f0de6a842b81788570ac7d.zip | |
Start populating the VtableMembers structure.
llvm-svn: 90517
Diffstat (limited to 'clang/lib/CodeGen/CGVtable.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index 46a0bab035b..b8860841ab3 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/lib/CodeGen/CGVtable.cpp @@ -421,7 +421,10 @@ public: const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl()); - // else allocate a new slot. + // We didn't find an entry in the vtable that we could use, add a new + // entry. + Methods.AddMethod(GD); + Index[GD] = submethods.size(); submethods.push_back(m); D1(printf(" vfn for %s at %d\n", MD->getNameAsString().c_str(), @@ -553,9 +556,13 @@ public: methods.push_back(rtti); Index_t AddressPoint = methods.size(); + assert(submethods.size() == Methods.size() && "Method size mismatch!"); + InstallThunks(); D1(printf("============= combining methods\n")); methods.insert(methods.end(), submethods.begin(), submethods.end()); + + Methods.clear(); submethods.clear(); // and then the non-virtual bases. @@ -864,6 +871,8 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m, Adjustment.GD = GD; } + Methods.OverrideMethod(OGD, GD); + Index[GD] = i; submethods[i] = m; if (isPure) |

