[cfe-commits] r90671 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Sat Dec 5 12:42:53 PST 2009
Author: andersca
Date: Sat Dec 5 14:42:53 2009
New Revision: 90671
URL: http://llvm.org/viewvc/llvm-project?rev=90671&view=rev
Log:
Change getCtorVtable to not return the address point offset, but the global variable.
Modified:
cfe/trunk/lib/CodeGen/CGVtable.cpp
Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=90671&r1=90670&r2=90671&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sat Dec 5 14:42:53 2009
@@ -1233,8 +1233,11 @@
init = BuildVtablePtr(vtbl, VtblClass, RD, Offset);
else {
init = CGM.getVtableInfo().getCtorVtable(Class, Base, BaseOffset);
- subvtbl = dyn_cast<llvm::Constant>(init->getOperand(0));
+
+ subvtbl = init;
subVtblClass = Base;
+
+ init = BuildVtablePtr(init, Class, Base, BaseOffset);
}
Inits.push_back(init);
}
@@ -1257,6 +1260,8 @@
VtblClass = Class;
} else {
init = CGM.getVtableInfo().getCtorVtable(Class, RD, Offset);
+ init = BuildVtablePtr(init, RD, RD, Offset);
+
VtblClass = RD;
}
llvm::Constant *vtbl = dyn_cast<llvm::Constant>(init->getOperand(0));
@@ -1301,6 +1306,7 @@
VirtualVTTs(Base);
}
}
+
public:
VTTBuilder(std::vector<llvm::Constant *> &inits, const CXXRecordDecl *c,
CodeGenModule &cgm)
@@ -1412,7 +1418,9 @@
llvm::Constant *CGVtableInfo::getCtorVtable(const CXXRecordDecl *LayoutClass,
const CXXRecordDecl *RD,
uint64_t Offset) {
- return CGM.GenerateVtable(LayoutClass, RD, Offset);
+ llvm::Constant *Vtable = CGM.GenerateVtable(LayoutClass, RD, Offset);
+
+ return cast<llvm::Constant>(Vtable->getOperand(0));
}
void CGVtableInfo::MaybeEmitVtable(GlobalDecl GD) {
More information about the cfe-commits
mailing list