[PATCH] D12108: [WinEH] Require token linkage in EH pad/ret signatures
Joseph Tremoulet via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 21:37:27 PDT 2015
JosephTremoulet marked 4 inline comments as done.
================
Comment at: include/llvm/IR/Instructions.h:3617
@@ -3721,3 +3616,3 @@
assert(NewDest);
Op<-1>() = NewDest;
}
----------------
I dug deeper into this. It turned out that the case MSVC was rejecting was in CleanupReturnInst::setCleanupPad, which was in fact quite reasonable since at that point CleanupPadInst was just forward-referenced, not defined, so of course it couldn't have known how to statically cast it, let alone realize that it could do so implicitly. Obvious in hindsight :/ I moved CleanupReturnInst later in the file and removed the cast.
I also took a closer look at the similar casts in the file. I was incorrect when I said "the rest of this file (outside the new EH instructions) all the setters that take BasicBlock * use reinterpret_cast<Value *>, " -- what was actually the case was that `switch` and `invoke` used reinterpret_cast, and `br` and `indirectbr` used c-style casts. I looked back through the history of `InvokeInst`, and it actually has bounced back and forth between c-style and reinterpret casts, but the commit messages don't discuss it. At any rate, either kind of cast appears unnecessary now (Instructions.h #includes Function.h which #includes BasicBlock.h), so I've removed those as well.
http://reviews.llvm.org/D12108
More information about the llvm-commits
mailing list