mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 10:32:48 +02:00
[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.
This commit is contained in:
parent
d1f2a244f8
commit
8a1cc679e3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user