Convert a few more uses of std::string& to llvm::StringRef.

llvm-svn: 93506
This commit is contained in:
Ted Kremenek 2010-01-15 07:43:59 +00:00
parent 1a234c0aee
commit 959990b840
2 changed files with 4 additions and 4 deletions

View 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(); }

View 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!");