diff options
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Object/IRObjectFile.h | 3 | ||||
-rw-r--r-- | llvm/lib/Object/IRObjectFile.cpp | 13 |
2 files changed, 6 insertions, 10 deletions
diff --git a/llvm/include/llvm/Object/IRObjectFile.h b/llvm/include/llvm/Object/IRObjectFile.h index 0cf31d91582..9fe011e17d6 100644 --- a/llvm/include/llvm/Object/IRObjectFile.h +++ b/llvm/include/llvm/Object/IRObjectFile.h @@ -67,8 +67,7 @@ public: /// symbol found and the associated flags. static void CollectAsmUndefinedRefs( const Triple &TheTriple, StringRef InlineAsm, - const std::function<void(StringRef, BasicSymbolRef::Flags)> & - AsmUndefinedRefs); + function_ref<void(StringRef, BasicSymbolRef::Flags)> AsmUndefinedRefs); /// \brief Finds and returns bitcode in the given memory buffer (which may /// be either a bitcode file or a native object file with embedded bitcode), diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp index f4f332ab563..42c8ecd62da 100644 --- a/llvm/lib/Object/IRObjectFile.cpp +++ b/llvm/lib/Object/IRObjectFile.cpp @@ -38,20 +38,17 @@ using namespace object; IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod) : SymbolicFile(Binary::ID_IR, Object), M(std::move(Mod)) { Mang.reset(new Mangler()); - CollectAsmUndefinedRefs( - Triple(M->getTargetTriple()), M->getModuleInlineAsm(), - [this](StringRef Name, BasicSymbolRef::Flags Flags) { - AsmSymbols.push_back( - std::make_pair<std::string, uint32_t>(Name, std::move(Flags))); - }); + CollectAsmUndefinedRefs(Triple(M->getTargetTriple()), M->getModuleInlineAsm(), + [this](StringRef Name, BasicSymbolRef::Flags Flags) { + AsmSymbols.emplace_back(Name, std::move(Flags)); + }); } // Parse inline ASM and collect the list of symbols that are not defined in // the current module. This is inspired from IRObjectFile. void IRObjectFile::CollectAsmUndefinedRefs( const Triple &TT, StringRef InlineAsm, - const std::function<void(StringRef, BasicSymbolRef::Flags)> & - AsmUndefinedRefs) { + function_ref<void(StringRef, BasicSymbolRef::Flags)> AsmUndefinedRefs) { if (InlineAsm.empty()) return; |