Make sure the raw_string_ostream gets flushed so we don't accidentally return an empty string.

llvm-svn: 97809
This commit is contained in:
Benjamin Kramer 2010-03-05 15:39:20 +00:00
parent 34004170c5
commit d4870700ad
1 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ std::string getClangRevision() {
std::string revision;
llvm::raw_string_ostream OS(revision);
OS << strtol(SVN_REVISION, 0, 10);
return revision;
return OS.str();
}
#endif
return "";
@ -58,7 +58,7 @@ std::string getClangFullRepositoryVersion() {
const std::string &Revision = getClangRevision();
if (!Revision.empty())
OS << ' ' << Revision;
return buf;
return OS.str();
}
std::string getClangFullVersion() {
@ -69,7 +69,7 @@ std::string getClangFullVersion() {
#endif
OS << "clang version " CLANG_VERSION_STRING " ("
<< getClangFullRepositoryVersion() << ')';
return buf;
return OS.str();
}
} // end namespace clang