diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-09-28 19:09:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-09-28 19:09:10 +0000 |
commit | 7da28aef685751f924bec4ea82195b6e19e2bfe5 (patch) | |
tree | 3b5f8f915f189a37662d367405f9232b3d0f8369 /lib/CodeGen/CGCall.h | |
parent | 6a96fd6a5252d5f6c32d116e2ca1b7a867a3db1a (diff) |
Re-commit r282556, reverted in r282564, with a fix to CallArgList::addFrom to
function correctly when targeting MS ABIs (this appears to have never mattered
prior to this change).
Update test case to always cover both 32-bit and 64-bit Windows ABIs, since
they behave somewhat differently from each other here.
Update test case to also cover operators , && and ||, which it appears are also
affected by P0145R3 (they're not explicitly called out by the design document,
but this is the emergent behavior of the existing wording).
Original commit message:
P0145R3 (C++17 evaluation order tweaks): evaluate the right-hand side of
assignment and compound-assignment operators before the left-hand side. (Even
if it's an overloaded operator.)
This completes the implementation of P0145R3 + P0400R0 for all targets except
Windows, where the evaluation order guarantees for <<, >>, and ->* are
unimplementable as the ABI requires the function arguments are evaluated from
right to left (because parameter destructors are run from left to right in the
callee).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282619 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.h')
-rw-r--r-- | lib/CodeGen/CGCall.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/CGCall.h b/lib/CodeGen/CGCall.h index aee29575bc..5e4bb5e657 100644 --- a/lib/CodeGen/CGCall.h +++ b/lib/CodeGen/CGCall.h @@ -81,10 +81,19 @@ namespace CodeGen { push_back(CallArg(rvalue, type, needscopy)); } + /// Add all the arguments from another CallArgList to this one. After doing + /// this, the old CallArgList retains its list of arguments, but must not + /// be used to emit a call. void addFrom(const CallArgList &other) { insert(end(), other.begin(), other.end()); Writebacks.insert(Writebacks.end(), other.Writebacks.begin(), other.Writebacks.end()); + CleanupsToDeactivate.insert(CleanupsToDeactivate.end(), + other.CleanupsToDeactivate.begin(), + other.CleanupsToDeactivate.end()); + assert(!(StackBase && other.StackBase) && "can't merge stackbases"); + if (!StackBase) + StackBase = other.StackBase; } void addWriteback(LValue srcLV, Address temporary, @@ -132,11 +141,6 @@ namespace CodeGen { /// The stacksave call. It dominates all of the argument evaluation. llvm::CallInst *StackBase; - - /// 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 |