diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-22 04:58:12 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-22 04:58:12 +0000 |
commit | a0cb890fb6a3f6deba8c30815fb73a02a423be8c (patch) | |
tree | 72689889b30d805669530b8e2d6fa2cd70436216 /llvm/lib/Object/IRObjectFile.cpp | |
parent | 9ff43e40fafe9cad0bd5d3e388e2a3e5c4d448a3 (diff) | |
download | bcm5719-llvm-a0cb890fb6a3f6deba8c30815fb73a02a423be8c.tar.gz bcm5719-llvm-a0cb890fb6a3f6deba8c30815fb73a02a423be8c.zip |
Clean the API for CollectAsmUndefinedRefs, taking a Triple and a String InlineAsm instead of a Module (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267106
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/IRObjectFile.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp index 0d35744f93d..76cb15630ae 100644 --- a/llvm/lib/Object/IRObjectFile.cpp +++ b/llvm/lib/Object/IRObjectFile.cpp @@ -39,7 +39,8 @@ IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod) : SymbolicFile(Binary::ID_IR, Object), M(std::move(Mod)) { Mang.reset(new Mangler()); CollectAsmUndefinedRefs( - *M, [this](StringRef Name, BasicSymbolRef::Flags Flags) { + 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))); }); @@ -48,15 +49,12 @@ IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod) // 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( - Module &TheModule, + const Triple &TT, StringRef InlineAsm, const std::function<void(StringRef, BasicSymbolRef::Flags)> & AsmUndefinedRefs) { - - const std::string &InlineAsm = TheModule.getModuleInlineAsm(); if (InlineAsm.empty()) return; - Triple TT(TheModule.getTargetTriple()); std::string Err; const Target *T = TargetRegistry::lookupTarget(TT.str(), Err); if (!T) |