[llvm] Fix performance bug in buildLocationList (PR #108886)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 14:51:30 PDT 2024


================
@@ -1737,6 +1737,12 @@ void AsmPrinter::emitFunctionBody() {
   bool IsEHa = MMI->getModule()->getModuleFlag("eh-asynch");
 
   bool CanDoExtraAnalysis = ORE->allowExtraAnalysis(DEBUG_TYPE);
+  /* Create a slot for the entry basic block section so that the section
+     order is preserved when iterating over MBBSectionRanges. */
+  if (!MF->empty()) {
+    MBBSectionRanges[MF->front().getSectionID()] = MBBSectionRange{CurrentFnBegin, nullptr};
+  }
----------------
adrian-prantl wrote:

Can you update this to LLVM style (// versus /**/ and get rid of the {})?

https://github.com/llvm/llvm-project/pull/108886


More information about the llvm-commits mailing list