<div dir="rtl"><div dir="ltr">Sorry! already fixed in r232623/4.</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-03-18 13:26 GMT+02:00 Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, this breaks compilation of our buildbot:<br>
<br>
<a href="http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/4283" target="_blank">http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/4283</a><br>
<br>
lib/Sema/SemaStmt.cpp:909:53: error: operands to ?: have different<br>
types ‘llvm::SmallString<16u>’ and ‘llvm::StringRef’<br>
(PrevString.empty() ? CaseValStr : PrevString);<br>
<br>
cheers,<br>
--renato<br>
<div class="HOEnZb"><div class="h5"><br>
On 18 March 2015 at 10:17, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:<br>
> Author: yrnkrn<br>
> Date: Wed Mar 18 05:17:07 2015<br>
> New Revision: 232622<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232622&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232622&view=rev</a><br>
> Log:<br>
> Remove many superfluous SmallString::str() calls.<br>
><br>
> Now that SmallString is a first-class citizen, most SmallString::str()<br>
> calls are not required. This patch removes a whole bunch of them, yet<br>
> there are lots more.<br>
><br>
> There are two use cases where str() is really needed:<br>
> 1) To use one of StringRef member functions which is not available in<br>
> SmallString.<br>
> 2) To convert to std::string, as StringRef implicitly converts while<br>
> SmallString do not. We may wish to change this, but it may introduce<br>
> ambiguity.<br>
><br>
><br>
> Modified:<br>
> llvm/trunk/include/llvm/Support/FileUtilities.h<br>
> llvm/trunk/lib/MC/MCAsmStreamer.cpp<br>
> llvm/trunk/lib/MC/MCAssembler.cpp<br>
> llvm/trunk/lib/MC/MCDwarf.cpp<br>
> llvm/trunk/lib/Support/APInt.cpp<br>
> llvm/trunk/lib/Support/LockFileManager.cpp<br>
> llvm/trunk/lib/Support/Triple.cpp<br>
> llvm/trunk/lib/Support/Windows/Path.inc<br>
> llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/FileUtilities.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileUtilities.h?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileUtilities.h?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/FileUtilities.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/FileUtilities.h Wed Mar 18 05:17:07 2015<br>
> @@ -51,7 +51,7 @@ namespace llvm {<br>
> ~FileRemover() {<br>
> if (DeleteIt) {<br>
> // Ignore problems deleting the file.<br>
> - sys::fs::remove(Filename.str());<br>
> + sys::fs::remove(Filename);<br>
> }<br>
> }<br>
><br>
> @@ -61,7 +61,7 @@ namespace llvm {<br>
> void setFile(const Twine& filename, bool deleteIt = true) {<br>
> if (DeleteIt) {<br>
> // Ignore problems deleting the file.<br>
> - sys::fs::remove(Filename.str());<br>
> + sys::fs::remove(Filename);<br>
> }<br>
><br>
> Filename.clear();<br>
><br>
> Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -267,7 +267,7 @@ void MCAsmStreamer::EmitCommentsAndEOL()<br>
> }<br>
><br>
> CommentStream.flush();<br>
> - StringRef Comments = CommentToEmit.str();<br>
> + StringRef Comments = CommentToEmit;<br>
><br>
> assert(Comments.back() == '\n' &&<br>
> "Comment array not newline terminated");<br>
><br>
> Modified: llvm/trunk/lib/MC/MCAssembler.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCAssembler.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCAssembler.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -789,7 +789,7 @@ static void writeFragment(const MCAssemb<br>
><br>
> case MCFragment::FT_LEB: {<br>
> const MCLEBFragment &LF = cast<MCLEBFragment>(F);<br>
> - OW->WriteBytes(LF.getContents().str());<br>
> + OW->WriteBytes(LF.getContents());<br>
> break;<br>
> }<br>
><br>
> @@ -805,12 +805,12 @@ static void writeFragment(const MCAssemb<br>
><br>
> case MCFragment::FT_Dwarf: {<br>
> const MCDwarfLineAddrFragment &OF = cast<MCDwarfLineAddrFragment>(F);<br>
> - OW->WriteBytes(OF.getContents().str());<br>
> + OW->WriteBytes(OF.getContents());<br>
> break;<br>
> }<br>
> case MCFragment::FT_DwarfFrame: {<br>
> const MCDwarfCallFrameFragment &CF = cast<MCDwarfCallFrameFragment>(F);<br>
> - OW->WriteBytes(CF.getContents().str());<br>
> + OW->WriteBytes(CF.getContents());<br>
> break;<br>
> }<br>
> }<br>
><br>
> Modified: llvm/trunk/lib/MC/MCDwarf.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCDwarf.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCDwarf.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -1293,7 +1293,7 @@ const MCSymbol &FrameEmitterImpl::EmitCI<br>
> Augmentation += "R";<br>
> if (IsSignalFrame)<br>
> Augmentation += "S";<br>
> - streamer.EmitBytes(Augmentation.str());<br>
> + streamer.EmitBytes(Augmentation);<br>
> }<br>
> streamer.EmitIntValue(0, 1);<br>
><br>
><br>
> Modified: llvm/trunk/lib/Support/APInt.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Support/APInt.cpp (original)<br>
> +++ llvm/trunk/lib/Support/APInt.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -2297,7 +2297,7 @@ void APInt::dump() const {<br>
> void APInt::print(raw_ostream &OS, bool isSigned) const {<br>
> SmallString<40> S;<br>
> this->toString(S, 10, isSigned, /* formatAsCLiteral = */false);<br>
> - OS << S.str();<br>
> + OS << S;<br>
> }<br>
><br>
> // This implements a variety of operations on a representation of<br>
><br>
> Modified: llvm/trunk/lib/Support/LockFileManager.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/LockFileManager.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/LockFileManager.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Support/LockFileManager.cpp (original)<br>
> +++ llvm/trunk/lib/Support/LockFileManager.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -91,7 +91,7 @@ LockFileManager::LockFileManager(StringR<br>
> UniqueLockFileName += "-%%%%%%%%";<br>
> int UniqueLockFileID;<br>
> if (std::error_code EC = sys::fs::createUniqueFile(<br>
> - UniqueLockFileName.str(), UniqueLockFileID, UniqueLockFileName)) {<br>
> + UniqueLockFileName, UniqueLockFileID, UniqueLockFileName)) {<br>
> Error = EC;<br>
> return;<br>
> }<br>
> @@ -116,7 +116,7 @@ LockFileManager::LockFileManager(StringR<br>
> // We failed to write out PID, so make up an excuse, remove the<br>
> // unique lock file, and fail.<br>
> Error = make_error_code(errc::no_space_on_device);<br>
> - sys::fs::remove(UniqueLockFileName.c_str());<br>
> + sys::fs::remove(UniqueLockFileName);<br>
> return;<br>
> }<br>
> }<br>
> @@ -124,7 +124,7 @@ LockFileManager::LockFileManager(StringR<br>
> while (1) {<br>
> // Create a link from the lock file name. If this succeeds, we're done.<br>
> std::error_code EC =<br>
> - sys::fs::create_link(UniqueLockFileName.str(), LockFileName.str());<br>
> + sys::fs::create_link(UniqueLockFileName, LockFileName);<br>
> if (!EC)<br>
> return;<br>
><br>
> @@ -137,11 +137,11 @@ LockFileManager::LockFileManager(StringR<br>
> // from the lock file.<br>
> if ((Owner = readLockFile(LockFileName))) {<br>
> // Wipe out our unique lock file (it's useless now)<br>
> - sys::fs::remove(UniqueLockFileName.str());<br>
> + sys::fs::remove(UniqueLockFileName);<br>
> return;<br>
> }<br>
><br>
> - if (!sys::fs::exists(LockFileName.str())) {<br>
> + if (!sys::fs::exists(LockFileName)) {<br>
> // The previous owner released the lock file before we could read it.<br>
> // Try to get ownership again.<br>
> continue;<br>
> @@ -149,7 +149,7 @@ LockFileManager::LockFileManager(StringR<br>
><br>
> // There is a lock file that nobody owns; try to clean it up and get<br>
> // ownership.<br>
> - if ((EC = sys::fs::remove(LockFileName.str()))) {<br>
> + if ((EC = sys::fs::remove(LockFileName))) {<br>
> Error = EC;<br>
> return;<br>
> }<br>
> @@ -171,8 +171,8 @@ LockFileManager::~LockFileManager() {<br>
> return;<br>
><br>
> // Since we own the lock, remove the lock file and our own unique lock file.<br>
> - sys::fs::remove(LockFileName.str());<br>
> - sys::fs::remove(UniqueLockFileName.str());<br>
> + sys::fs::remove(LockFileName);<br>
> + sys::fs::remove(UniqueLockFileName);<br>
> }<br>
><br>
> LockFileManager::WaitForUnlockResult LockFileManager::waitForUnlock() {<br>
> @@ -203,7 +203,7 @@ LockFileManager::WaitForUnlockResult Loc<br>
> if (sys::fs::access(LockFileName.c_str(), sys::fs::AccessMode::Exist) ==<br>
> errc::no_such_file_or_directory) {<br>
> // If the original file wasn't created, somone thought the lock was dead.<br>
> - if (!sys::fs::exists(FileName.str()))<br>
> + if (!sys::fs::exists(FileName))<br>
> return Res_OwnerDied;<br>
> return Res_Success;<br>
> }<br>
> @@ -236,5 +236,5 @@ LockFileManager::WaitForUnlockResult Loc<br>
> }<br>
><br>
> std::error_code LockFileManager::unsafeRemoveLockFile() {<br>
> - return sys::fs::remove(LockFileName.str());<br>
> + return sys::fs::remove(LockFileName);<br>
> }<br>
><br>
> Modified: llvm/trunk/lib/Support/Triple.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Support/Triple.cpp (original)<br>
> +++ llvm/trunk/lib/Support/Triple.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -850,7 +850,7 @@ void Triple::setArchName(StringRef Str)<br>
> Triple += getVendorName();<br>
> Triple += "-";<br>
> Triple += getOSAndEnvironmentName();<br>
> - setTriple(Triple.str());<br>
> + setTriple(Triple);<br>
> }<br>
><br>
> void Triple::setVendorName(StringRef Str) {<br>
><br>
> Modified: llvm/trunk/lib/Support/Windows/Path.inc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Support/Windows/Path.inc (original)<br>
> +++ llvm/trunk/lib/Support/Windows/Path.inc Wed Mar 18 05:17:07 2015<br>
> @@ -599,8 +599,8 @@ std::error_code detail::directory_iterat<br>
><br>
> it.IterationHandle = intptr_t(FindHandle.take());<br>
> SmallString<128> directory_entry_path(path);<br>
> - path::append(directory_entry_path, directory_entry_name_utf8.str());<br>
> - it.CurrentEntry = directory_entry(directory_entry_path.str());<br>
> + path::append(directory_entry_path, directory_entry_name_utf8);<br>
> + it.CurrentEntry = directory_entry(directory_entry_path);<br>
><br>
> return std::error_code();<br>
> }<br>
><br>
> Modified: llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=232622&r1=232621&r2=232622&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=232622&r1=232621&r2=232622&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp (original)<br>
> +++ llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Wed Mar 18 05:17:07 2015<br>
> @@ -1091,7 +1091,7 @@ unsigned FilterChooser::getDecoderIndex(<br>
> // overkill for now, though.<br>
><br>
> // Make sure the predicate is in the table.<br>
> - Decoders.insert(Decoder.str());<br>
> + Decoders.insert(StringRef(Decoder));<br>
> // Now figure out the index for when we write out the table.<br>
> DecoderSet::const_iterator P = std::find(Decoders.begin(),<br>
> Decoders.end(),<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>