diff options
Diffstat (limited to 'llvm/lib/ExecutionEngine/JITLink/JITLink.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/JITLink.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp index 6c924f889577..5105ec495148 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/JITLink.cpp @@ -10,6 +10,7 @@ #include "llvm/ExecutionEngine/JITLink/JITLink.h" #include "llvm/BinaryFormat/Magic.h" +#include "llvm/ExecutionEngine/JITLink/ELF.h" #include "llvm/ExecutionEngine/JITLink/MachO.h" #include "llvm/Support/Format.h" #include "llvm/Support/ManagedStatic.h" @@ -180,18 +181,14 @@ Block &LinkGraph::splitBlock(Block &B, size_t SplitIndex, // Copy edges to NewBlock (recording their iterators so that we can remove // them from B), and update of Edges remaining on B. std::vector<Block::edge_iterator> EdgesToRemove; - for (auto I = B.edges().begin(), E = B.edges().end(); I != E; ++I) { + for (auto I = B.edges().begin(); I != B.edges().end();) { if (I->getOffset() < SplitIndex) { NewBlock.addEdge(*I); - EdgesToRemove.push_back(I); - } else + I = B.removeEdge(I); + } else { I->setOffset(I->getOffset() - SplitIndex); - } - - // Remove edges that were transfered to NewBlock from B. - while (!EdgesToRemove.empty()) { - B.removeEdge(EdgesToRemove.back()); - EdgesToRemove.pop_back(); + ++I; + } } } @@ -304,6 +301,8 @@ void jitLink(std::unique_ptr<JITLinkContext> Ctx) { switch (Magic) { case file_magic::macho_object: return jitLink_MachO(std::move(Ctx)); + case file_magic::elf_relocatable: + return jitLink_ELF(std::move(Ctx)); default: Ctx->notifyFailed(make_error<JITLinkError>("Unsupported file format")); }; |