From b398c94c821edd3e8699026dc00501062eafd5b2 Mon Sep 17 00:00:00 2001 From: Lukas Zaoral Date: Thu, 10 Sep 2020 17:12:28 +0200 Subject: llvm11: Make conversions from StringRef to std::string explicit The same applies to SmallString. See: llvm/llvm-project@777180a#diff-497ba4c0c527a125d382b51a34f32542 --- lib/Module/InstructionInfoTable.cpp | 4 ++-- lib/Module/ModuleUtil.cpp | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/Module') diff --git a/lib/Module/InstructionInfoTable.cpp b/lib/Module/InstructionInfoTable.cpp index fde5ff19..05a1f7b9 100644 --- a/lib/Module/InstructionInfoTable.cpp +++ b/lib/Module/InstructionInfoTable.cpp @@ -120,7 +120,7 @@ public: if (dsub != nullptr) { auto path = dsub->getFilename(); return std::make_unique(FunctionInfo( - 0, getInternedString(path), dsub->getLine(), asmLine)); + 0, getInternedString(path.str()), dsub->getLine(), asmLine)); } // Fallback: Mark as unknown @@ -151,7 +151,7 @@ public: } } return std::make_unique(InstructionInfo( - 0, getInternedString(full_path), line, column, asmLine)); + 0, getInternedString(full_path.str()), line, column, asmLine)); } if (f != nullptr) diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp index 2316ef45..7cd66415 100644 --- a/lib/Module/ModuleUtil.cpp +++ b/lib/Module/ModuleUtil.cpp @@ -82,11 +82,11 @@ GetAllUndefinedSymbols(Module *M, std::set &UndefinedSymbols) { for (auto const &Function : *M) { if (Function.hasName()) { if (Function.isDeclaration()) - UndefinedSymbols.insert(Function.getName()); + UndefinedSymbols.insert(Function.getName().str()); else if (!Function.hasLocalLinkage()) { assert(!Function.hasDLLImportStorageClass() && "Found dllimported non-external symbol!"); - DefinedSymbols.insert(Function.getName()); + DefinedSymbols.insert(Function.getName().str()); } } } @@ -95,18 +95,17 @@ GetAllUndefinedSymbols(Module *M, std::set &UndefinedSymbols) { I != E; ++I) if (I->hasName()) { if (I->isDeclaration()) - UndefinedSymbols.insert(I->getName()); + UndefinedSymbols.insert(I->getName().str()); else if (!I->hasLocalLinkage()) { assert(!I->hasDLLImportStorageClass() && "Found dllimported non-external symbol!"); - DefinedSymbols.insert(I->getName()); + DefinedSymbols.insert(I->getName().str()); } } for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end(); I != E; ++I) if (I->hasName()) - DefinedSymbols.insert(I->getName()); - + DefinedSymbols.insert(I->getName().str()); // Prune out any defined symbols from the undefined symbols set // and other symbols we don't want to treat as an undefined symbol -- cgit 1.4.1