From 959990b840c0ec06ed5314ad1b3e089cd31b498b Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 15 Jan 2010 07:43:59 +0000 Subject: [PATCH] Convert a few more uses of std::string& to llvm::StringRef. llvm-svn: 93506 --- clang/include/clang/Analysis/PathSensitive/BugReporter.h | 6 +++--- clang/lib/Analysis/BugReporter.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/include/clang/Analysis/PathSensitive/BugReporter.h b/clang/include/clang/Analysis/PathSensitive/BugReporter.h index 071016782a0a..6f6681a3629b 100644 --- a/clang/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/clang/include/clang/Analysis/PathSensitive/BugReporter.h @@ -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::const_iterator str_iterator; str_iterator str_begin() const { return Strs.begin(); } diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp index e6482698dd43..13b7f4510d47 100644 --- a/clang/lib/Analysis/BugReporter.cpp +++ b/clang/lib/Analysis/BugReporter.cpp @@ -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!");