summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/stringconstant.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-11 20:31:37 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-11 20:31:37 +0100
commitc0f241e80f95f196ef2aa031156cb38daf7e5241 (patch)
tree31898fa7b591de310b2fe7ca591803035f15dd25 /compilerplugins/clang/stringconstant.cxx
parente1e261fef393730b22dc2c4fe3a7d63966d8c737 (diff)
SourceManager::getFilename returns StringRef
Change-Id: I77db8565efe2e0d366afc8470308d7801a2a7337
Diffstat (limited to 'compilerplugins/clang/stringconstant.cxx')
-rw-r--r--compilerplugins/clang/stringconstant.cxx23
1 files changed, 9 insertions, 14 deletions
diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx
index d7f34f9a7fa5..8616096a4f8c 100644
--- a/compilerplugins/clang/stringconstant.cxx
+++ b/compilerplugins/clang/stringconstant.cxx
@@ -318,10 +318,8 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) {
{
// u.equalsIgnoreAsciiCaseAscii("foo") ->
// u.equalsIngoreAsciiCase("foo"):
- std::string file(
- compiler.getSourceManager().getFilename(
- compiler.getSourceManager().getSpellingLoc(
- expr->getLocStart())));
+ auto file = compiler.getSourceManager().getFilename(
+ compiler.getSourceManager().getSpellingLoc(expr->getLocStart()));
if (file == SRCDIR "/sal/qa/rtl/strings/test_oustring_compare.cxx") {
return true;
}
@@ -336,10 +334,8 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) {
{
// u.equalsIgnoreAsciiCaseAsciiL("foo", 3) ->
// u.equalsIngoreAsciiCase("foo"):
- std::string file(
- compiler.getSourceManager().getFilename(
- compiler.getSourceManager().getSpellingLoc(
- expr->getLocStart())));
+ auto file = compiler.getSourceManager().getFilename(
+ compiler.getSourceManager().getSpellingLoc(expr->getLocStart()));
if (file == SRCDIR "/sal/qa/rtl/strings/test_oustring_compare.cxx") {
return true;
}
@@ -703,10 +699,9 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) {
case 2:
{
// b.append("foo", 3) -> b.append("foo"):
- std::string file(
- compiler.getSourceManager().getFilename(
- compiler.getSourceManager().getSpellingLoc(
- expr->getLocStart())));
+ auto file = compiler.getSourceManager().getFilename(
+ compiler.getSourceManager().getSpellingLoc(
+ expr->getLocStart()));
if (file
== SRCDIR "/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx")
{
@@ -990,11 +985,11 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) {
if (dc.Operator(OO_Plus).Namespace("rtl")
.GlobalNamespace())
{
- std::string file(
+ auto file =
compiler.getSourceManager().getFilename(
compiler.getSourceManager()
.getSpellingLoc(
- expr->getLocStart())));
+ expr->getLocStart()));
if (file
== (SRCDIR
"/sal/qa/rtl/strings/test_ostring_concat.cxx")