diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp b/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp --- a/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp +++ b/llvm/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp @@ -763,7 +763,7 @@ ThenBB = Builder.GetInsertBlock(); // Emit else block. - TheFunction->getBasicBlockList().push_back(ElseBB); + TheFunction->insert(TheFunction->end(), ElseBB); Builder.SetInsertPoint(ElseBB); Value *ElseV = Else->Codegen(); @@ -774,7 +774,7 @@ ElseBB = Builder.GetInsertBlock(); // Emit merge block. - TheFunction->getBasicBlockList().push_back(MergeBB); + TheFunction->insert(TheFunction->end(), MergeBB); Builder.SetInsertPoint(MergeBB); PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp"); diff --git a/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp --- a/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp +++ b/llvm/examples/Kaleidoscope/MCJIT/cached/toy.cpp @@ -1127,7 +1127,7 @@ ThenBB = Builder.GetInsertBlock(); // Emit else block. - TheFunction->getBasicBlockList().push_back(ElseBB); + TheFunction->insert(TheFunction->end(), ElseBB); Builder.SetInsertPoint(ElseBB); Value *ElseV = Else->Codegen(); @@ -1138,7 +1138,7 @@ ElseBB = Builder.GetInsertBlock(); // Emit merge block. - TheFunction->getBasicBlockList().push_back(MergeBB); + TheFunction->insert(TheFunction->end(), MergeBB); Builder.SetInsertPoint(MergeBB); PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp"); diff --git a/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp --- a/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp +++ b/llvm/examples/Kaleidoscope/MCJIT/complete/toy.cpp @@ -1205,7 +1205,7 @@ ThenBB = Builder.GetInsertBlock(); // Emit else block. - TheFunction->getBasicBlockList().push_back(ElseBB); + TheFunction->insert(TheFunction->end(), ElseBB); Builder.SetInsertPoint(ElseBB); Value *ElseV = Else->Codegen(); @@ -1216,7 +1216,7 @@ ElseBB = Builder.GetInsertBlock(); // Emit merge block. - TheFunction->getBasicBlockList().push_back(MergeBB); + TheFunction->insert(TheFunction->end(), MergeBB); Builder.SetInsertPoint(MergeBB); PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp"); diff --git a/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp --- a/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp +++ b/llvm/examples/Kaleidoscope/MCJIT/initial/toy.cpp @@ -985,7 +985,7 @@ ThenBB = Builder.GetInsertBlock(); // Emit else block. - TheFunction->getBasicBlockList().push_back(ElseBB); + TheFunction->insert(TheFunction->end(), ElseBB); Builder.SetInsertPoint(ElseBB); Value *ElseV = Else->Codegen(); @@ -996,7 +996,7 @@ ElseBB = Builder.GetInsertBlock(); // Emit merge block. - TheFunction->getBasicBlockList().push_back(MergeBB); + TheFunction->insert(TheFunction->end(), MergeBB); Builder.SetInsertPoint(MergeBB); PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp"); diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp --- a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp +++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp @@ -745,7 +745,7 @@ ThenBB = Builder.GetInsertBlock(); // Emit else block. - TheFunction->getBasicBlockList().push_back(ElseBB); + TheFunction->insert(TheFunction->end(), ElseBB); Builder.SetInsertPoint(ElseBB); Value *ElseV = Else->Codegen(); @@ -756,7 +756,7 @@ ElseBB = Builder.GetInsertBlock(); // Emit merge block. - TheFunction->getBasicBlockList().push_back(MergeBB); + TheFunction->insert(TheFunction->end(), MergeBB); Builder.SetInsertPoint(MergeBB); PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp"); diff --git a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp --- a/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp +++ b/llvm/examples/Kaleidoscope/MCJIT/lazy/toy.cpp @@ -1025,7 +1025,7 @@ ThenBB = Builder.GetInsertBlock(); // Emit else block. - TheFunction->getBasicBlockList().push_back(ElseBB); + TheFunction->insert(TheFunction->end(), ElseBB); Builder.SetInsertPoint(ElseBB); Value *ElseV = Else->Codegen(); @@ -1036,7 +1036,7 @@ ElseBB = Builder.GetInsertBlock(); // Emit merge block. - TheFunction->getBasicBlockList().push_back(MergeBB); + TheFunction->insert(TheFunction->end(), MergeBB); Builder.SetInsertPoint(MergeBB); PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(TheContext), 2, "iftmp"); diff --git a/llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp b/llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp --- a/llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp +++ b/llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp @@ -191,8 +191,7 @@ FF[NamedFeatureIndex::IsLocal] = F.hasLocalLinkage(); FF[NamedFeatureIndex::IsLinkOnceODR] = F.hasLinkOnceODRLinkage(); FF[NamedFeatureIndex::IsLinkOnce] = F.hasLinkOnceLinkage(); - FF[NamedFeatureIndex::Blocks] = - std::distance(F.getBasicBlockList().begin(), F.getBasicBlockList().end()); + FF[NamedFeatureIndex::Blocks] = F.size(); auto &LI = FAM.getResult(F); FF[NamedFeatureIndex::Loops] = std::distance(LI.begin(), LI.end()); for (auto &L : LI)