llvm.org GIT mirror llvm / fc44a8b
function_refify. NFC. While there use emplace_back to create an expensive pair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274344 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 3 years ago
2 changed file(s) with 6 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
6666 /// symbol found and the associated flags.
6767 static void CollectAsmUndefinedRefs(
6868 const Triple &TheTriple, StringRef InlineAsm,
69 const std::function &
70 AsmUndefinedRefs);
69 function_ref AsmUndefinedRefs);
7170
7271 /// \brief Finds and returns bitcode in the given memory buffer (which may
7372 /// be either a bitcode file or a native object file with embedded bitcode),
3737 IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr Mod)
3838 : SymbolicFile(Binary::ID_IR, Object), M(std::move(Mod)) {
3939 Mang.reset(new Mangler());
40 CollectAsmUndefinedRefs(
41 Triple(M->getTargetTriple()), M->getModuleInlineAsm(),
42 [this](StringRef Name, BasicSymbolRef::Flags Flags) {
43 AsmSymbols.push_back(
44 std::make_pair(Name, std::move(Flags)));
45 });
40 CollectAsmUndefinedRefs(Triple(M->getTargetTriple()), M->getModuleInlineAsm(),
41 [this](StringRef Name, BasicSymbolRef::Flags Flags) {
42 AsmSymbols.emplace_back(Name, std::move(Flags));
43 });
4644 }
4745
4846 // Parse inline ASM and collect the list of symbols that are not defined in
4947 // the current module. This is inspired from IRObjectFile.
5048 void IRObjectFile::CollectAsmUndefinedRefs(
5149 const Triple &TT, StringRef InlineAsm,
52 const std::function &
53 AsmUndefinedRefs) {
50 function_ref AsmUndefinedRefs) {
5451 if (InlineAsm.empty())
5552 return;
5653