From 0e93f3b0a06fc470e37b5be99734f5105ba11232 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Mon, 9 Mar 2020 11:15:14 -0500 Subject: [PATCH] [Polly] Replace use of std::stringstream. NFC. Use of std::-style (io)streams is discouraged in the LLVM coding style (https://llvm.org/docs/CodingStandards.html#include-iostream-is-forbidden). Replace with a use of llvm::Twine (which uses llvm::raw_ostream behind the scenes). --- polly/lib/CodeGen/PerfMonitor.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/polly/lib/CodeGen/PerfMonitor.cpp b/polly/lib/CodeGen/PerfMonitor.cpp index 2639e160387b..b452dc3bcc09 100644 --- a/polly/lib/CodeGen/PerfMonitor.cpp +++ b/polly/lib/CodeGen/PerfMonitor.cpp @@ -12,8 +12,8 @@ #include "polly/CodeGen/RuntimeDebugBuilder.h" #include "polly/ScopInfo.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/Twine.h" #include "llvm/IR/IntrinsicsX86.h" -#include using namespace llvm; using namespace polly; @@ -82,13 +82,12 @@ static void TryRegisterGlobal(Module *M, const char *Name, // Generate a unique name that is usable as a LLVM name for a scop to name its // performance counter. static std::string GetScopUniqueVarname(const Scop &S) { - std::stringstream Name; std::string EntryString, ExitString; std::tie(EntryString, ExitString) = S.getEntryExitStr(); - Name << "__polly_perf_in_" << std::string(S.getFunction().getName()) - << "_from__" << EntryString << "__to__" << ExitString; - return Name.str(); + return (Twine("__polly_perf_in_") + S.getFunction().getName() + "_from__" + + EntryString + "__to__" + ExitString) + .str(); } void PerfMonitor::addScopCounter() {