[PATCH] Remap frame variables used in outlined C++ exception handlers

David Majnemer david.majnemer at gmail.com
Fri Feb 20 17:23:24 PST 2015


LGTM


REPOSITORY
  rL LLVM

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:40
@@ +39,3 @@
+struct HandlerAllocas {
+  TinyPtrVector<AllocaInst*> Allocas;
+  int ParentFrameAllocationIndex;
----------------
Please have a space between the Pointee type and the asterisk.

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:598-599
@@ +597,4 @@
+  // allocation block.
+  AllocaInst *AV = dyn_cast<AllocaInst>(V);
+  if (AV) {
+    AllocaInst *NewAlloca = Builder.CreateAlloca(
----------------
This can be folded onto one line.

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:600-602
@@ +599,5 @@
+  if (AV) {
+    AllocaInst *NewAlloca = Builder.CreateAlloca(
+        AV->getAllocatedType(), AV->getArraySize(), AV->getName());
+    FrameVarInfo[AV].Allocas.push_back(NewAlloca);
+    return NewAlloca;
----------------
Would it be wrong to call `clone` on `AV`?   This doesn't handle `inalloca` correctly.

http://reviews.llvm.org/D7770

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list