[WinEH] Require token linkage in EH pad/ret signatures

Summary:
WinEHPrepare is going to require that cleanuppad and catchpad produce values
of token type which are consumed by any cleanupret or catchret exiting the
pad.  This change updates the signatures of those operators to require/enforce
that the type produced by the pads is token type and that the rets have an
appropriate argument.

The catchpad argument of a `CatchReturnInst` must be a `CatchPadInst` (and
similarly for `CleanupReturnInst`/`CleanupPadInst`).  To accommodate that
restriction, this change adds a notion of an operator constraint to both
LLParser and BitcodeReader, allowing appropriate sentinels to be constructed
for forward references and appropriate error messages to be emitted for
illegal inputs.

Also add a verifier rule (noted in LangRef) that a catchpad with a catchpad
predecessor must have no other predecessors; this ensures that WinEHPrepare
will see the expected linear relationship between sibling catches on the
same try.

Lastly, remove some superfluous/vestigial casts from instruction operand
setters operating on BasicBlocks.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12108

llvm-svn: 245797
diff --git a/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll b/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll
index 84b56fe..fcbb8bd 100644
--- a/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-statenumbering.ll
@@ -37,7 +37,7 @@
           to label %unreachable.for.entry unwind label %catch.dispatch
 
 catch.dispatch:                                   ; preds = %entry
-  %1 = catchpad token [i8* null, i8* null] to label %catch unwind label %catchendblock
+  %1 = catchpad [i8* null, i8* null] to label %catch unwind label %catchendblock
 
 catch:                                            ; preds = %catch.dispatch
   ; CHECK: catch:
@@ -47,7 +47,7 @@
           to label %unreachable unwind label %catch.dispatch.1
 
 catch.dispatch.1:                                 ; preds = %catch
-  %2 = catchpad token [i8* null, i8* null] to label %catch.3 unwind label %catchendblock.2
+  %2 = catchpad [i8* null, i8* null] to label %catch.3 unwind label %catchendblock.2
 
 catch.3:                                          ; preds = %catch.dispatch.1
   ; CHECK: catch.3:
@@ -57,7 +57,7 @@
           to label %invoke.cont unwind label %catchendblock.2
 
 invoke.cont:                                      ; preds = %catch.3
-  catchret token %2 to label %try.cont
+  catchret %2 to label %try.cont
 
 try.cont:                                         ; preds = %invoke.cont
   ; CHECK: try.cont: