[cfe-commits] r96041 - in /cfe/trunk/lib: Basic/Version.cpp Frontend/PCHReader.cpp
Ted Kremenek
kremenek at apple.com
Fri Feb 12 15:31:14 PST 2010
Author: kremenek
Date: Fri Feb 12 17:31:14 2010
New Revision: 96041
URL: http://llvm.org/viewvc/llvm-project?rev=96041&view=rev
Log:
Fix bug I introduced with assinging a temporary to a StringRef.
Modified:
cfe/trunk/lib/Basic/Version.cpp
cfe/trunk/lib/Frontend/PCHReader.cpp
Modified: cfe/trunk/lib/Basic/Version.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Version.cpp?rev=96041&r1=96040&r2=96041&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Version.cpp (original)
+++ cfe/trunk/lib/Basic/Version.cpp Fri Feb 12 17:31:14 2010
@@ -55,7 +55,7 @@
std::string buf;
llvm::raw_string_ostream OS(buf);
OS << getClangRepositoryPath();
- llvm::StringRef Revision = getClangRevision();
+ const std::string &Revision = getClangRevision();
if (!Revision.empty())
OS << ' ' << Revision;
return buf;
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=96041&r1=96040&r2=96041&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Fri Feb 12 17:31:14 2010
@@ -1414,9 +1414,9 @@
break;
case pch::VERSION_CONTROL_BRANCH_REVISION: {
- llvm::StringRef CurBranch = getClangFullRepositoryVersion();
+ const std::string &CurBranch = getClangFullRepositoryVersion();
llvm::StringRef PCHBranch(BlobStart, BlobLen);
- if (CurBranch != PCHBranch) {
+ if (llvm::StringRef(CurBranch) != PCHBranch) {
Diag(diag::warn_pch_different_branch) << PCHBranch << CurBranch;
return IgnorePCH;
}
More information about the cfe-commits
mailing list