[cfe-commits] r93506 - in /cfe/trunk: include/clang/Analysis/PathSensitive/BugReporter.h lib/Analysis/BugReporter.cpp

Ted Kremenek kremenek at apple.com
Thu Jan 14 23:43:59 PST 2010


Author: kremenek
Date: Fri Jan 15 01:43:59 2010
New Revision: 93506

URL: http://llvm.org/viewvc/llvm-project?rev=93506&view=rev
Log:
Convert a few more uses of std::string& to llvm::StringRef.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
    cfe/trunk/lib/Analysis/BugReporter.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h?rev=93506&r1=93505&r2=93506&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h Fri Jan 15 01:43:59 2010
@@ -103,9 +103,9 @@
   // BugReporter.
   const Stmt* getStmt() const;
 
-  const std::string& getDescription() const { return Description; }
+  const llvm::StringRef getDescription() const { return Description; }
 
-  const std::string& getShortDescription() const {
+  const llvm::StringRef getShortDescription() const {
     return ShortDescription.empty() ? Description : ShortDescription;
   }
 
@@ -443,7 +443,7 @@
   // FIXME: Move out-of-line (virtual function).
   SourceLocation getLocation() const { return L; }
 
-  void addString(const std::string& s) { Strs.push_back(s); }
+  void addString(llvm::StringRef s) { Strs.push_back(s); }
 
   typedef std::list<std::string>::const_iterator str_iterator;
   str_iterator str_begin() const { return Strs.begin(); }

Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=93506&r1=93505&r2=93506&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Fri Jan 15 01:43:59 2010
@@ -1819,7 +1819,7 @@
   Diagnostic& Diag = getDiagnostic();
   FullSourceLoc L(R->getLocation(), getSourceManager());
   unsigned ErrorDiag = Diag.getCustomDiagID(Diagnostic::Warning,
-                                            R->getShortDescription().c_str());
+                                            R->getShortDescription());
 
   switch (End-Beg) {
     default: assert(0 && "Don't handle this many ranges yet!");





More information about the cfe-commits mailing list