Adapt to "[ADT] Make StringRef's std::string conversion operator explicit"

...<https://github.com/llvm/llvm-project/commit/
777180a32b61070a10dd330b4f038bf24e916af1>.  This is just a quick fix to get
copmilerplugins buiding again with latest LLVM/Clang trunk.  Ideally, we should
get rid of as many of those (potentially expensive) conversions from
llvm::StringRef to std::string as possible.

Change-Id: I18e185e0022a06fd8e3b983a3c4f80e1f3b96746
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87682
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2020-01-29 13:26:26 +01:00
parent 3a10338f3c
commit ce1d8e20a7
14 changed files with 33 additions and 31 deletions

View File

@@ -32,7 +32,7 @@ public:
virtual void run() override
{
fn = handler.getMainFileName();
fn = handler.getMainFileName().str();
loplugin::normalizeDotDotInFilePath(fn);
// can't change these because we pass them down to the SfxItemPool stuff
if (fn == SRCDIR "/sc/source/core/data/docpool.cxx")
@@ -500,16 +500,16 @@ void UseUniquePtr::CheckDeleteLocalVar(const FunctionDecl* functionDecl, const C
if (parentName == "ScBroadcastAreaSlot")
return;
// complicated
if (any_equal(parentName, "SwFormatField", "FontPropertyBox", "SdFontPropertyBox",
if (any_equal(parentName.str(), "SwFormatField", "FontPropertyBox", "SdFontPropertyBox",
"SwHTMLParser", "PDFWriterImpl", "SbiParser", "DictionaryList", "SwGlossaryHdl", "SwGlossaryGroupDlg"))
return;
// ok
if (any_equal(parentName, "SbTreeListBox"))
if (any_equal(parentName.str(), "SbTreeListBox"))
return;
if (functionDecl->getIdentifier())
{
std::string name = functionDecl->getName();
std::string name = functionDecl->getName().str();
if (!parentName.empty())
name = std::string(parentName) + "::" + name;