IRgen optimization: cache the value of 'this' and 'vtt' instead of

repeatedly reloading from an alloca.  We still need to create the alloca
for debug info purposes (although we currently create it in all cases
because of some abstraction boundaries that're hard to break down).

llvm-svn: 96403
This commit is contained in:
John McCall
2010-02-16 22:04:33 +00:00
parent 37f106e18c
commit 347132b32f
4 changed files with 19 additions and 25 deletions

View File

@@ -1405,11 +1405,3 @@ void CodeGenFunction::InitializeVtablePtrsRecursive(
// Store address point
Builder.CreateStore(VtableAddressPoint, VtableField);
}
llvm::Value *CodeGenFunction::LoadCXXVTT() {
assert((isa<CXXConstructorDecl>(CurFuncDecl) ||
isa<CXXDestructorDecl>(CurFuncDecl)) &&
"Must be in a C++ ctor or dtor to load the vtt parameter");
return Builder.CreateLoad(LocalDeclMap[CXXVTTDecl], "vtt");
}