[NFC][Sema] Return underlying strings directly instead of OS.str()
authorLogan Smith <logan.r.smith0@gmail.com>
Thu, 9 Dec 2021 23:02:58 +0000 (15:02 -0800)
committerLogan Smith <logan.r.smith0@gmail.com>
Fri, 10 Dec 2021 00:05:46 +0000 (16:05 -0800)
commit5276002a89b9aeb4c5f920d627630b1637c68ddc
tree31c3293b160ff8f6a64bb4f5ab5c6b6614c6e503
parent0cf6f7b128dd457711ba5c0ebfcb8143dc1632f8
[NFC][Sema] 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/Sema/CodeCompleteConsumer.cpp
clang/lib/Sema/SemaAttr.cpp