Refactor IR helper functions into reusable helper class.

This gives us a lightweight set of primitives to use when building
IR, in the absence of fancier solutions like DSL.

In a followup CL, this helper class will be reused to synthesize an
assignment-statement in a separate section of code.

Bug: skia:14375
Change-Id: I001d75a32531ed349a2d65fca472201461bbbdcb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/709958
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
5 files changed