diff options
author | John McCall <rjmccall@apple.com> | 2010-08-31 07:33:07 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-31 07:33:07 +0000 |
commit | 5d865c3292f2fcb349a27b7297ec300dc8d472a9 (patch) | |
tree | 1d0875f89d4e694a9f795369ea8c1404465b83ea /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 618d21978d2707de2727268eb4930cb6ce57929d (diff) | |
download | bcm5719-llvm-5d865c3292f2fcb349a27b7297ec300dc8d472a9.tar.gz bcm5719-llvm-5d865c3292f2fcb349a27b7297ec300dc8d472a9.zip |
Teach IR generation to return 'this' from constructors and destructors
under the ARM ABI.
llvm-svn: 112588
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index f54a0113e70..fc741f8ef02 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/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. |