Add operand support to the Instruction base class.  Add setOperand methods
to all the things.  Fill out the OneOperand trait class with support for
getting and setting operands, allowing DimOp to have a working
get/setOperand() method.

I'm not thrilled with the extra template argument on OneOperand, I'll will
investigate removing that in a follow-on patch.

PiperOrigin-RevId: 205679696
diff --git a/lib/IR/Operation.cpp b/lib/IR/Operation.cpp
index 765903d..92a01ba 100644
--- a/lib/IR/Operation.cpp
+++ b/lib/IR/Operation.cpp
@@ -57,6 +57,17 @@
   }
 }
 
+void Operation::setOperand(unsigned idx, SSAValue *value) {
+  if (auto *inst = dyn_cast<OperationInst>(this)) {
+    inst->setOperand(idx, cast<CFGValue>(value));
+  } else {
+    auto *stmt = cast<OperationStmt>(this);
+    (void)stmt;
+    // TODO: Add operands to OperationStmt.
+    abort();
+  }
+}
+
 /// Return the number of results this operation has.
 unsigned Operation::getNumResults() const {
   if (auto *inst = dyn_cast<OperationInst>(this)) {