diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /lib/CodeGen/CGCall.h | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
Diffstat (limited to 'lib/CodeGen/CGCall.h')
-rw-r--r-- | lib/CodeGen/CGCall.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/lib/CodeGen/CGCall.h b/lib/CodeGen/CGCall.h index 532cb59c..9510a1c 100644 --- a/lib/CodeGen/CGCall.h +++ b/lib/CodeGen/CGCall.h @@ -56,6 +56,8 @@ namespace CodeGen { class CallArgList : public SmallVector<CallArg, 16> { public: + CallArgList() : StackBase(nullptr), StackBaseMem(nullptr) {} + struct Writeback { /// The original argument. Note that the argument l-value /// is potentially null. @@ -97,9 +99,12 @@ namespace CodeGen { bool hasWritebacks() const { return !Writebacks.empty(); } - typedef SmallVectorImpl<Writeback>::const_iterator writeback_iterator; - writeback_iterator writeback_begin() const { return Writebacks.begin(); } - writeback_iterator writeback_end() const { return Writebacks.end(); } + typedef llvm::iterator_range<SmallVectorImpl<Writeback>::const_iterator> + writeback_const_range; + + writeback_const_range writebacks() const { + return writeback_const_range(Writebacks.begin(), Writebacks.end()); + } void addArgCleanupDeactivation(EHScopeStack::stable_iterator Cleanup, llvm::Instruction *IsActiveIP) { @@ -113,6 +118,14 @@ namespace CodeGen { return CleanupsToDeactivate; } + void allocateArgumentMemory(CodeGenFunction &CGF); + llvm::Instruction *getStackBase() const { return StackBase; } + void freeArgumentMemory(CodeGenFunction &CGF) const; + + /// \brief Returns if we're using an inalloca struct to pass arguments in + /// memory. + bool isUsingInAlloca() const { return StackBase; } + private: SmallVector<Writeback, 1> Writebacks; @@ -120,6 +133,17 @@ namespace CodeGen { /// is used to cleanup objects that are owned by the callee once the call /// occurs. SmallVector<CallArgCleanup, 1> CleanupsToDeactivate; + + /// The stacksave call. It dominates all of the argument evaluation. + llvm::CallInst *StackBase; + + /// The alloca holding the stackbase. We need it to maintain SSA form. + llvm::AllocaInst *StackBaseMem; + + /// The iterator pointing to the stack restore cleanup. We manually run and + /// deactivate this cleanup after the call in the unexceptional case because + /// it doesn't run in the normal order. + EHScopeStack::stable_iterator StackCleanup; }; /// FunctionArgList - Type for representing both the decl and type |