diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-07 15:45:00 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-07 15:45:00 +0000 |
commit | 3044ac058bdc7ee960fb4c084d2f8affd2b9c8c4 (patch) | |
tree | 82ba7c45ae9eeab30d53145b5b1d605e38149fcf /llvm/lib/CodeGen | |
parent | ab8c8da60928cae277942f4fda2e63626ec7b863 (diff) | |
download | bcm5719-llvm-3044ac058bdc7ee960fb4c084d2f8affd2b9c8c4.tar.gz bcm5719-llvm-3044ac058bdc7ee960fb4c084d2f8affd2b9c8c4.zip |
Avoid use-after-move warnings by using swap instead. NFCI.
Swap should be as quick in these cases, and leaves the original variables in a known (empty) state.
llvm-svn: 360164
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 489bcb4e859..ea75df8e47d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -8858,8 +8858,11 @@ TargetLowering::LowerCallTo(TargetLowering::CallLoweringInfo &CLI) const { if (CLI.IsPostTypeLegalization) { // If we are lowering a libcall after legalization, split the return type. - SmallVector<EVT, 4> OldRetTys = std::move(RetTys); - SmallVector<uint64_t, 4> OldOffsets = std::move(Offsets); + SmallVector<EVT, 4> OldRetTys; + SmallVector<uint64_t, 4> OldOffsets; + RetTys.swap(OldRetTys); + Offsets.swap(OldOffsets); + for (size_t i = 0, e = OldRetTys.size(); i != e; ++i) { EVT RetVT = OldRetTys[i]; uint64_t Offset = OldOffsets[i]; |