From 7df1234c2e62b2a23dc4417e527f941c20ebe858 Mon Sep 17 00:00:00 2001 From: Jordy Rose Date: Sun, 21 Aug 2011 05:25:15 +0000 Subject: [analyzer] Replace calls to getNameAsString() with StringRef equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138215 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Core/BugReporter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp') diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index b82d12310e..31786dd002 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -438,10 +438,11 @@ public: FullSourceLoc L(S->getLocStart(), BR.getSourceManager()); if (Loc::isLocType(VD->getType())) { - std::string msg = "'" + std::string(VD->getNameAsString()) + - "' now aliases '" + MostRecent->getNameAsString() + "'"; + llvm::SmallString<64> buf; + llvm::raw_svector_ostream os(buf); + os << '\'' << VD << "' now aliases '" << MostRecent << '\''; - PD.push_front(new PathDiagnosticEventPiece(L, msg)); + PD.push_front(new PathDiagnosticEventPiece(L, os.str())); } return true; -- cgit v1.2.3-70-g09d2