]> granicus.if.org Git - clang/commitdiff
Convert a few more uses of std::string& to llvm::StringRef.
authorTed Kremenek <kremenek@apple.com>
Fri, 15 Jan 2010 07:43:59 +0000 (07:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 15 Jan 2010 07:43:59 +0000 (07:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93506 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/BugReporter.h
lib/Analysis/BugReporter.cpp

index 071016782a0a2433a3056676b016f2b182235cdf..6f6681a3629becbddc1c3e424aa0b5854487cfb7 100644 (file)
@@ -103,9 +103,9 @@ public:
   // 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 @@ public:
   // 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(); }
index e6482698dd43d94dd3a1cac626ff39349646245f..13b7f4510d474068b6df2d05391e9daa1c3759f3 100644 (file)
@@ -1819,7 +1819,7 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) {
   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!");