summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp2
-rw-r--r--llvm/lib/MC/MCAssembler.cpp6
-rw-r--r--llvm/lib/MC/MCDwarf.cpp2
-rw-r--r--llvm/lib/Support/APInt.cpp2
-rw-r--r--llvm/lib/Support/LockFileManager.cpp20
-rw-r--r--llvm/lib/Support/Triple.cpp2
-rw-r--r--llvm/lib/Support/Windows/Path.inc4
7 files changed, 19 insertions, 19 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 2312cd5ea02..62f5279a84d 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -267,7 +267,7 @@ void MCAsmStreamer::EmitCommentsAndEOL() {
}
CommentStream.flush();
- StringRef Comments = CommentToEmit.str();
+ StringRef Comments = CommentToEmit;
assert(Comments.back() == '\n' &&
"Comment array not newline terminated");
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index b3e0b74e2b9..dada94b9dd3 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -789,7 +789,7 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
case MCFragment::FT_LEB: {
const MCLEBFragment &LF = cast<MCLEBFragment>(F);
- OW->WriteBytes(LF.getContents().str());
+ OW->WriteBytes(LF.getContents());
break;
}
@@ -805,12 +805,12 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
case MCFragment::FT_Dwarf: {
const MCDwarfLineAddrFragment &OF = cast<MCDwarfLineAddrFragment>(F);
- OW->WriteBytes(OF.getContents().str());
+ OW->WriteBytes(OF.getContents());
break;
}
case MCFragment::FT_DwarfFrame: {
const MCDwarfCallFrameFragment &CF = cast<MCDwarfCallFrameFragment>(F);
- OW->WriteBytes(CF.getContents().str());
+ OW->WriteBytes(CF.getContents());
break;
}
}
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 3554715bee9..ccfba6691e8 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -1293,7 +1293,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCObjectStreamer &streamer,
Augmentation += "R";
if (IsSignalFrame)
Augmentation += "S";
- streamer.EmitBytes(Augmentation.str());
+ streamer.EmitBytes(Augmentation);
}
streamer.EmitIntValue(0, 1);
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 4a2a620eab4..dc8a6525c8b 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -2297,7 +2297,7 @@ void APInt::dump() const {
void APInt::print(raw_ostream &OS, bool isSigned) const {
SmallString<40> S;
this->toString(S, 10, isSigned, /* formatAsCLiteral = */false);
- OS << S.str();
+ OS << S;
}
// This implements a variety of operations on a representation of
diff --git a/llvm/lib/Support/LockFileManager.cpp b/llvm/lib/Support/LockFileManager.cpp
index 2a0178bcc5b..a6c17d4e587 100644
--- a/llvm/lib/Support/LockFileManager.cpp
+++ b/llvm/lib/Support/LockFileManager.cpp
@@ -91,7 +91,7 @@ LockFileManager::LockFileManager(StringRef FileName)
UniqueLockFileName += "-%%%%%%%%";
int UniqueLockFileID;
if (std::error_code EC = sys::fs::createUniqueFile(
- UniqueLockFileName.str(), UniqueLockFileID, UniqueLockFileName)) {
+ UniqueLockFileName, UniqueLockFileID, UniqueLockFileName)) {
Error = EC;
return;
}
@@ -116,7 +116,7 @@ LockFileManager::LockFileManager(StringRef FileName)
// We failed to write out PID, so make up an excuse, remove the
// unique lock file, and fail.
Error = make_error_code(errc::no_space_on_device);
- sys::fs::remove(UniqueLockFileName.c_str());
+ sys::fs::remove(UniqueLockFileName);
return;
}
}
@@ -124,7 +124,7 @@ LockFileManager::LockFileManager(StringRef FileName)
while (1) {
// Create a link from the lock file name. If this succeeds, we're done.
std::error_code EC =
- sys::fs::create_link(UniqueLockFileName.str(), LockFileName.str());
+ sys::fs::create_link(UniqueLockFileName, LockFileName);
if (!EC)
return;
@@ -137,11 +137,11 @@ LockFileManager::LockFileManager(StringRef FileName)
// from the lock file.
if ((Owner = readLockFile(LockFileName))) {
// Wipe out our unique lock file (it's useless now)
- sys::fs::remove(UniqueLockFileName.str());
+ sys::fs::remove(UniqueLockFileName);
return;
}
- if (!sys::fs::exists(LockFileName.str())) {
+ if (!sys::fs::exists(LockFileName)) {
// The previous owner released the lock file before we could read it.
// Try to get ownership again.
continue;
@@ -149,7 +149,7 @@ LockFileManager::LockFileManager(StringRef FileName)
// There is a lock file that nobody owns; try to clean it up and get
// ownership.
- if ((EC = sys::fs::remove(LockFileName.str()))) {
+ if ((EC = sys::fs::remove(LockFileName))) {
Error = EC;
return;
}
@@ -171,8 +171,8 @@ LockFileManager::~LockFileManager() {
return;
// Since we own the lock, remove the lock file and our own unique lock file.
- sys::fs::remove(LockFileName.str());
- sys::fs::remove(UniqueLockFileName.str());
+ sys::fs::remove(LockFileName);
+ sys::fs::remove(UniqueLockFileName);
}
LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {
@@ -203,7 +203,7 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {
if (sys::fs::access(LockFileName.c_str(), sys::fs::AccessMode::Exist) ==
errc::no_such_file_or_directory) {
// If the original file wasn't created, somone thought the lock was dead.
- if (!sys::fs::exists(FileName.str()))
+ if (!sys::fs::exists(FileName))
return Res_OwnerDied;
return Res_Success;
}
@@ -236,5 +236,5 @@ LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {
}
std::error_code LockFileManager::unsafeRemoveLockFile() {
- return sys::fs::remove(LockFileName.str());
+ return sys::fs::remove(LockFileName);
}
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index c3955714eb7..d74173a6621 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -850,7 +850,7 @@ void Triple::setArchName(StringRef Str) {
Triple += getVendorName();
Triple += "-";
Triple += getOSAndEnvironmentName();
- setTriple(Triple.str());
+ setTriple(Triple);
}
void Triple::setVendorName(StringRef Str) {
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index d8b5702bf15..d558ff5bfae 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -599,8 +599,8 @@ std::error_code detail::directory_iterator_construct(detail::DirIterState &it,
it.IterationHandle = intptr_t(FindHandle.take());
SmallString<128> directory_entry_path(path);
- path::append(directory_entry_path, directory_entry_name_utf8.str());
- it.CurrentEntry = directory_entry(directory_entry_path.str());
+ path::append(directory_entry_path, directory_entry_name_utf8);
+ it.CurrentEntry = directory_entry(directory_entry_path);
return std::error_code();
}
OpenPOWER on IntegriCloud