Skip to content

Commit 5414921

Browse files
[MC] Use StringRef::consume_back (NFC)
1 parent 34dd8ec commit 5414921

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/MC/MCAsmStreamer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,8 +2470,7 @@ void MCAsmStreamer::emitAddrsigSym(const MCSymbol *Sym) {
24702470
/// the specified string in the output .s file. This capability is
24712471
/// indicated by the hasRawTextSupport() predicate.
24722472
void MCAsmStreamer::emitRawTextImpl(StringRef String) {
2473-
if (!String.empty() && String.back() == '\n')
2474-
String = String.substr(0, String.size()-1);
2473+
String.consume_back("\n");
24752474
OS << String;
24762475
EmitEOL();
24772476
}

0 commit comments

Comments
 (0)