aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-16 22:04:33 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-16 22:04:33 +0000
commit2504941793b549323f9d29c62507cf21d865fade (patch)
tree32dbfa806279e353f06a02518c75f8159021a4f9 /lib/CodeGen/CodeGenFunction.h
parentd19429f01a4169b573cafa466dd7a09a51e5fd92 (diff)
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index a4db556d39..a694b894df 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -382,11 +382,13 @@ private:
/// CXXThisDecl - When generating code for a C++ member function,
/// this will hold the implicit 'this' declaration.
ImplicitParamDecl *CXXThisDecl;
+ llvm::Value *CXXThisValue;
/// CXXVTTDecl - When generating code for a base object constructor or
/// base object destructor with virtual bases, this will hold the implicit
/// VTT parameter.
ImplicitParamDecl *CXXVTTDecl;
+ llvm::Value *CXXVTTValue;
/// CXXLiveTemporaryInfo - Holds information about a live C++ temporary.
struct CXXLiveTemporaryInfo {
@@ -745,11 +747,17 @@ public:
/// LoadCXXThis - Load the value of 'this'. This function is only valid while
/// generating code for an C++ member function.
- llvm::Value *LoadCXXThis();
+ llvm::Value *LoadCXXThis() {
+ assert(CXXThisValue && "no 'this' value for this function");
+ return CXXThisValue;
+ }
/// LoadCXXVTT - Load the VTT parameter to base constructors/destructors have
/// virtual bases.
- llvm::Value *LoadCXXVTT();
+ llvm::Value *LoadCXXVTT() {
+ assert(CXXVTTValue && "no VTT value for this function");
+ return CXXVTTValue;
+ }
/// GetAddressOfBaseOfCompleteClass - Convert the given pointer to a
/// complete class down to one of its virtual bases.