[PATCH] D12943: [WinEH] Add a funclet layout pass

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 13:35:32 PDT 2015


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm


================
Comment at: lib/CodeGen/FuncletLayout.cpp:69
@@ +68,3 @@
+
+bool FuncletLayout::runOnMachineFunction(MachineFunction &F) {
+  SmallVector<MachineBasicBlock *, 16> FuncletBlocks;
----------------
You can do:
  if (!F.getMMI().hasEHFunclets())
    return false;

================
Comment at: lib/CodeGen/FuncletLayout.cpp:72
@@ +71,3 @@
+  for (MachineBasicBlock &MBB : F)
+    if (MBB.isEHPad())
+      FuncletBlocks.push_back(&MBB);
----------------
MBB.isEHFuncletEntry()

================
Comment at: lib/CodeGen/FuncletLayout.cpp:76
@@ +75,3 @@
+  // We don't have anything to do if there aren't any EH pads.
+  if (FuncletBlocks.empty())
+    return false;
----------------
Now you can assert !empty

================
Comment at: test/CodeGen/X86/funclet-layout.ll:31
@@ +30,3 @@
+
+; The entry funclet is contains %entry and %try.cont
+; CHECK: # %entry
----------------
s/is contains/contains/

================
Comment at: test/CodeGen/X86/funclet-layout.ll:32
@@ +31,3 @@
+; The entry funclet is contains %entry and %try.cont
+; CHECK: # %entry
+; CHECK: # %try.cont
----------------
Maybe throw in
  CHECK-LABEL: _f:

================
Comment at: test/CodeGen/X86/funclet-layout.ll:34
@@ +33,3 @@
+; CHECK: # %try.cont
+
+; The catch funclet is contains %catch and %catchret
----------------
  CHECK: retl

================
Comment at: test/CodeGen/X86/funclet-layout.ll:35
@@ +34,3 @@
+
+; The catch funclet is contains %catch and %catchret
+; CHECK: # %catch
----------------
ditto


http://reviews.llvm.org/D12943





More information about the llvm-commits mailing list