From 0cf6f7b128dd457711ba5c0ebfcb8143dc1632f8 Mon Sep 17 00:00:00 2001 From: Logan Smith Date: Thu, 9 Dec 2021 15:02:35 -0800 Subject: [NFC][clang] Return underlying strings directly instead of OS.str() This avoids an unnecessary copy required by 'return OS.str()', allowing instead for NRVO or implicit move. The .str() call (which flushes the stream) is no longer required since 65b13610a5226b84889b923bae884ba395ad084d, which made raw_string_ostream unbuffered by default. Differential Revision: https://reviews.llvm.org/D115374 --- clang/lib/Frontend/TestModuleFileExtension.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp') diff --git a/clang/lib/Frontend/TestModuleFileExtension.cpp b/clang/lib/Frontend/TestModuleFileExtension.cpp index ea737e6..2d5145d 100644 --- a/clang/lib/Frontend/TestModuleFileExtension.cpp +++ b/clang/lib/Frontend/TestModuleFileExtension.cpp @@ -133,5 +133,5 @@ std::string TestModuleFileExtension::str() const { llvm::raw_string_ostream OS(Buffer); OS << BlockName << ":" << MajorVersion << ":" << MinorVersion << ":" << Hashed << ":" << UserInfo; - return OS.str(); + return Buffer; } -- cgit v1.1