Skip to content

Commit 8bc61cb

Browse files
authored
[Clang][ByteCode][NFC] Avoid copies by using move in Disasm.cpp (#146127)
Static analysis flagged some cases we could avoid copies by using std::move in Disasm.cpp.
1 parent f58caed commit 8bc61cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/AST/ByteCode/Disasm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ template <> inline std::string printArg<Floating>(Program &P, CodePtr &OpPC) {
6363

6464
std::string S;
6565
llvm::raw_string_ostream SS(S);
66-
SS << Result;
66+
SS << std::move(Result);
6767
return S;
6868
}
6969

@@ -81,7 +81,7 @@ inline std::string printArg<IntegralAP<false>>(Program &P, CodePtr &OpPC) {
8181

8282
std::string Str;
8383
llvm::raw_string_ostream SS(Str);
84-
SS << Result;
84+
SS << std::move(Result);
8585
return Str;
8686
}
8787

@@ -99,7 +99,7 @@ inline std::string printArg<IntegralAP<true>>(Program &P, CodePtr &OpPC) {
9999

100100
std::string Str;
101101
llvm::raw_string_ostream SS(Str);
102-
SS << Result;
102+
SS << std::move(Result);
103103
return Str;
104104
}
105105

@@ -109,7 +109,7 @@ template <> inline std::string printArg<FixedPoint>(Program &P, CodePtr &OpPC) {
109109

110110
std::string Result;
111111
llvm::raw_string_ostream SS(Result);
112-
SS << F;
112+
SS << std::move(F);
113113
return Result;
114114
}
115115

0 commit comments

Comments
 (0)