aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-27 20:47:55 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-27 20:47:55 +0000
commitd6b07fb9ca2c3207773de1d8e305f99076598a2e (patch)
tree818e885b5fbc77c2b5a07c52e837ff7b56c793fd /lib/CodeGen/CGVtable.h
parent83d5a2a7d5f933cfdba756e76b6c5cc2f61ac37e (diff)
Don't build the entire vtable when all we want is the index of a virtual method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.h')
-rw-r--r--lib/CodeGen/CGVtable.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/CGVtable.h b/lib/CodeGen/CGVtable.h
index daf49d31b3..ac3cdee63b 100644
--- a/lib/CodeGen/CGVtable.h
+++ b/lib/CodeGen/CGVtable.h
@@ -80,6 +80,17 @@ class CGVtableInfo {
VirtualBaseClassIndiciesTy VirtualBaseClassIndicies;
llvm::DenseMap<const CXXRecordDecl *, llvm::Constant *> Vtables;
+
+ /// NumVirtualFunctionPointers - Contains the number of virtual function
+ /// pointers in the vtable for a given record decl.
+ llvm::DenseMap<const CXXRecordDecl *, uint64_t> NumVirtualFunctionPointers;
+
+ /// getNumVirtualFunctionPointers - Return the number of virtual function
+ /// pointers in the vtable for a given record decl.
+ uint64_t getNumVirtualFunctionPointers(const CXXRecordDecl *RD);
+
+ void ComputeMethodVtableIndices(const CXXRecordDecl *RD);
+
public:
CGVtableInfo(CodeGenModule &CGM)
: CGM(CGM) { }
@@ -87,7 +98,7 @@ public:
/// getMethodVtableIndex - Return the index (relative to the vtable address
/// point) where the function pointer for the given virtual function is
/// stored.
- int64_t getMethodVtableIndex(GlobalDecl GD);
+ uint64_t getMethodVtableIndex(GlobalDecl GD);
/// getVirtualBaseOffsetIndex - Return the index (relative to the vtable
/// address point) where the offset of the virtual base that contains the