[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 11:53:28 PDT 2015
JosephTremoulet added inline comments.
================
Comment at: include/llvm/IR/Instructions.h:3713
@@ -3721,3 +3712,3 @@
assert(NewDest);
- Op<-1>() = NewDest;
+ Op<-1>() = reinterpret_cast<Value *>(NewDest);
}
----------------
majnemer wrote:
> Why is the `reinterpret_cast` necessary here?
Evidently it's not, or the current ToT would be broken. When I tried to omit the cast from `CatchPadInst *` or `CleanupPadInst *` to `Value *` in `setCatchPad` or `setCleanupPad`, MSVC rejected it, which I presume has to do with some rule about concatenating implicit and explicit conversions that I didn't fully dig into. I took a look, and in the rest of this file (outside the new EH instructions) all the setters that take `BasicBlock *` use `reinterpret_cast<Value *>`, so I decided to follow suit and `reinterpret_cast<Value *>` in all the new EH instruction setters taking `CatchPadInst *` or `CleanupPadInst *` or `BasicBlock *`, for fear that different host compilers accept/reject different patterns. Since this one was clearly working before, I'm happy to revert it if you want me to, but that was my reasoning.
http://reviews.llvm.org/D12108
More information about the llvm-commits
mailing list