<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 26, 2011, at 2:55 PM, David Blaikie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "> // Strip the directory and suffix from BaseInput.<br>
-static const char *getBaseName (const char *BaseInput) {<br>
+static std::string getBaseName (const char *BaseInput) {<br>
   std::pair<StringRef, StringRef> Split = StringRef(BaseInput).rsplit('/');<br>
   if (Split.second != "")<br>
-    return Split.second.split('.').first.str().c_str();<br>
+    return Split.second.split('.').first.str();<br>
   else<br>
-    return Split.first.split('.').first.str().c_str();<br>
+    return Split.first.split('.').first.str();<br>
 }<br><br></blockquote><div><br></div><div>Shouldn't this just return StringRef instead? what's the reason you're converting to std::string at all here?</div></div></blockquote><div><br></div><div>Actually, Benjamin pointed out that llvm::sys::path::filename() was already doing the bulk of what I needed.  Cleanup committed clang revision <span class="Apple-style-span" style="font-size: 12px; ">r138670, thanks.</span></div><br><blockquote type="cite"><div class="gmail_quote"><div>- David </div></div>
</blockquote></div><br></body></html>