aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-07-01 11:05:15 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-07-01 11:05:15 +0000
commitfc44a8b1e44b1856f9b1c6cf42599710d8b69240 (patch)
tree7536d0c8be6816c9fd646e66b7c4db92228cc2f6 /lib/Object/IRObjectFile.cpp
parent2619d465a52f02ca4a5f9cbfc55989ba211cb99f (diff)
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
Diffstat (limited to 'lib/Object/IRObjectFile.cpp')
-rw-r--r--lib/Object/IRObjectFile.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Object/IRObjectFile.cpp b/lib/Object/IRObjectFile.cpp
index f4f332ab563..42c8ecd62da 100644
--- a/lib/Object/IRObjectFile.cpp
+++ b/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;