[PATCH] D87999: [EHStreamer] Ensure CallSiteEntry::{BeginLabel,EndLabel} are non-null. NFC

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 09:32:31 PDT 2020


rahmanl added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp:272
       if (SawPotentiallyThrowing && Asm->MAI->usesCFIForEH()) {
-        CallSiteEntry Site = { LastLabel, BeginLabel, nullptr, 0 };
-        CallSites.push_back(Site);
+        CallSites.push_back({Asm->getFunctionBegin(), BeginLabel, nullptr, 0});
         PreviousIsInvoke = false;
----------------
I am not sure if this is correct. When reaching the end of one MBB, we must be able to use the end label of that MBB and the begin label here.

Instead, why don't you change the definition of LastLabel to
MCSymbol *LastLabel = Asm->getFunctionBegin();

Then you don't need to change this LastLabel argument here and the line below.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp:517
 
-      MCSymbol *BeginLabel = S.BeginLabel;
-      if (!BeginLabel)
----------------
Good cleanup!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87999/new/

https://reviews.llvm.org/D87999



More information about the llvm-commits mailing list