[ms-cxxabi] Construct and destroy call arguments in the correct order
Summary: MSVC destroys arguments in the callee from left to right. Because C++ objects have to be destroyed in the reverse order of construction, Clang has to construct arguments from right to left and destroy arguments from left to right. This patch fixes the ordering by reversing the order of evaluation of all call arguments under the MS C++ ABI. Fixes PR18035. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2275 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196402 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/TargetCXXABI.h 2 additions, 2 deletionsinclude/clang/Basic/TargetCXXABI.h
- lib/CodeGen/CGCall.cpp 57 additions, 9 deletionslib/CodeGen/CGCall.cpp
- lib/CodeGen/CGClass.cpp 5 additions, 20 deletionslib/CodeGen/CGClass.cpp
- lib/CodeGen/CGDecl.cpp 1 addition, 1 deletionlib/CodeGen/CGDecl.cpp
- lib/CodeGen/CGExprCXX.cpp 4 additions, 27 deletionslib/CodeGen/CGExprCXX.cpp
- lib/CodeGen/CodeGenFunction.h 53 additions, 43 deletionslib/CodeGen/CodeGenFunction.h
- lib/Sema/SemaChecking.cpp 3 additions, 2 deletionslib/Sema/SemaChecking.cpp
- test/CodeGen/tbaa-ms-abi.cpp 2 additions, 2 deletionstest/CodeGen/tbaa-ms-abi.cpp
- test/CodeGenCXX/microsoft-abi-arg-order.cpp 41 additions, 0 deletionstest/CodeGenCXX/microsoft-abi-arg-order.cpp
- test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm 20 additions, 0 deletionstest/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
Loading
Please register or sign in to comment