diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-01-28 23:42:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-01-28 23:42:29 +0000 |
commit | a50e33eb0ff7b73d44aebce88de3732583a7e960 (patch) | |
tree | 24cf4825a3d316cacc20462de14338d9470fd88c /lib/CodeGen/CGVTables.cpp | |
parent | 28dadd6c88e0b93b1b99edd460548625359786b7 (diff) |
More work to support -fapple-kext regarding
indirect vf calls and addition of extra entry
at bottom of vtbls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index ff65e583bb..5df3ac52b5 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -2758,7 +2758,14 @@ void CodeGenVTables::ComputeVTableRelatedInformation(const CXXRecordDecl *RD, // Add the VTable layout. uint64_t NumVTableComponents = Builder.getNumVTableComponents(); + // -fapple-kext adds an extra entry at end of vtbl. + bool IsAppleKext = CGM.getContext().getLangOptions().AppleKext; + if (IsAppleKext) + NumVTableComponents += 1; + uint64_t *LayoutData = new uint64_t[NumVTableComponents + 1]; + if (IsAppleKext) + LayoutData[NumVTableComponents] = 0; Entry.setPointer(LayoutData); // Store the number of components. |