about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorLukas Zaoral <lzaoral@redhat.com>2020-09-10 17:12:28 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-12-04 20:35:47 +0000
commitb398c94c821edd3e8699026dc00501062eafd5b2 (patch)
tree862f321cb7e784e28a861f23701e443deeb5ebfe /lib/Module
parent4ca5a80836de48036e47f611a6ea610a6fb2b54b (diff)
downloadklee-b398c94c821edd3e8699026dc00501062eafd5b2.tar.gz
llvm11: Make conversions from StringRef to std::string explicit
The same applies to SmallString.

See: llvm/llvm-project@777180a#diff-497ba4c0c527a125d382b51a34f32542
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/InstructionInfoTable.cpp4
-rw-r--r--lib/Module/ModuleUtil.cpp11
2 files changed, 7 insertions, 8 deletions
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>(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>(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<std::string> &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<std::string> &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