Skip to content

Commit 227f190

Browse files
shafiktomtor
authored andcommitted
[Clang][ByteCode][NFC] Move APInt into pushInteger since it is being passed by value (llvm#143578)
Static analysis flagged that we could move APInt instead of copy, indeed it has a move constructor and so we should move into values for APInt.
1 parent 98424e1 commit 227f190

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ static bool interp__builtin_ia32_pdep(InterpState &S, CodePtr OpPC,
13211321
if (Mask[I])
13221322
Result.setBitVal(I, Val[P++]);
13231323
}
1324-
pushInteger(S, Result, Call->getType());
1324+
pushInteger(S, std::move(Result), Call->getType());
13251325
return true;
13261326
}
13271327

@@ -1344,7 +1344,7 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
13441344
if (Mask[I])
13451345
Result.setBitVal(P++, Val[I]);
13461346
}
1347-
pushInteger(S, Result, Call->getType());
1347+
pushInteger(S, std::move(Result), Call->getType());
13481348
return true;
13491349
}
13501350

0 commit comments

Comments
 (0)