aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2021-03-12 18:42:17 +0100
committerserge-sans-paille <sguelton@redhat.com>2021-03-12 18:43:59 +0100
commit1ce2b584543a6ae350d976ec3db667e7265ee3fe (patch)
tree6423dc6916328d1c37b730c153ce7c59635035d8
parent96716e6749c31493f5a3b57685d4686ba9cdd8fe (diff)
downloadllvm-1ce2b584543a6ae350d976ec3db667e7265ee3fe.zip
llvm-1ce2b584543a6ae350d976ec3db667e7265ee3fe.tar.gz
llvm-1ce2b584543a6ae350d976ec3db667e7265ee3fe.tar.bz2
[NFC] Use llvm::raw_string_ostream instead of std::stringstream
That's more efficient and we don't loose any valuable feature when doing so.
-rw-r--r--llvm/lib/Analysis/InlineAdvisor.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/InlineAdvisor.cpp b/llvm/lib/Analysis/InlineAdvisor.cpp
index 9a2276a1..469ec4c 100644
--- a/llvm/lib/Analysis/InlineAdvisor.cpp
+++ b/llvm/lib/Analysis/InlineAdvisor.cpp
@@ -24,8 +24,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
-#include <sstream>
-
using namespace llvm;
#define DEBUG_TYPE "inline"
@@ -279,8 +277,7 @@ shouldBeDeferred(Function *Caller, InlineCost IC, int &TotalSecondaryCost,
}
namespace llvm {
-static std::basic_ostream<char> &operator<<(std::basic_ostream<char> &R,
- const ore::NV &Arg) {
+static raw_ostream &operator<<(raw_ostream &R, const ore::NV &Arg) {
return R << Arg.Val;
}
@@ -302,7 +299,8 @@ RemarkT &operator<<(RemarkT &&R, const InlineCost &IC) {
} // namespace llvm
std::string llvm::inlineCostStr(const InlineCost &IC) {
- std::stringstream Remark;
+ std::string Buffer;
+ raw_string_ostream Remark(Buffer);
Remark << IC;
return Remark.str();
}
@@ -383,7 +381,8 @@ llvm::shouldInline(CallBase &CB,
}
std::string llvm::getCallSiteLocation(DebugLoc DLoc) {
- std::ostringstream CallSiteLoc;
+ std::string Buffer;
+ raw_string_ostream CallSiteLoc(Buffer);
bool First = true;
for (DILocation *DIL = DLoc.get(); DIL; DIL = DIL->getInlinedAt()) {
if (!First)