diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index edb34be203f..b7c4ce1f1ff 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -132,8 +132,7 @@ bool Inliner::runOnSCC(const std::vector &SCC) { // Attempt to inline the function... if (InlineCallIfPossible(CS, CG, SCCFunctions)) { // Remove this call site from the list. - std::swap(CallSites[CSi], CallSites.back()); - CallSites.pop_back(); + CallSites.erase(CallSites.begin()+CSi); --CSi; ++NumInlined;