aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-31 07:33:07 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-31 07:33:07 +0000
commit4c40d98ab7acf5f27fa89b17bd8fc0ef7683df37 (patch)
treed4d40dc8719612b86724f6df0f0850057ec3b843 /lib/CodeGen/CodeGenFunction.h
parent1baf2f778c26a71d1353ff2cc1701fcd1dbeaf76 (diff)
Teach IR generation to return 'this' from constructors and destructors
under the ARM ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index f54a0113e7..fc741f8ef0 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -70,6 +70,7 @@ namespace CodeGen {
class CGFunctionInfo;
class CGRecordLayout;
class CGBlockInfo;
+ class CGCXXABI;
/// A branch fixup. These are required when emitting a goto to a
/// label which hasn't been emitted yet. The goto is optimistically
@@ -406,6 +407,8 @@ public:
class CodeGenFunction : public BlockFunction {
CodeGenFunction(const CodeGenFunction&); // DO NOT IMPLEMENT
void operator=(const CodeGenFunction&); // DO NOT IMPLEMENT
+
+ friend class CGCXXABI;
public:
/// A jump destination is an abstract label, branching to which may
/// require a jump out through normal cleanups.
@@ -1034,10 +1037,16 @@ public:
void StartBlock(const char *N);
/// GetAddrOfStaticLocalVar - Return the address of a static local variable.
- llvm::Constant *GetAddrOfStaticLocalVar(const VarDecl *BVD);
+ llvm::Constant *GetAddrOfStaticLocalVar(const VarDecl *BVD) {
+ return cast<llvm::Constant>(GetAddrOfLocalVar(BVD));
+ }
/// GetAddrOfLocalVar - Return the address of a local variable.
- llvm::Value *GetAddrOfLocalVar(const VarDecl *VD);
+ llvm::Value *GetAddrOfLocalVar(const VarDecl *VD) {
+ llvm::Value *Res = LocalDeclMap[VD];
+ assert(Res && "Invalid argument to GetAddrOfLocalVar(), no decl!");
+ return Res;
+ }
/// getAccessedFieldNo - Given an encoded value and a result number, return
/// the input field number being accessed.