Specifically:
1. Converted llvm::errs() -> llvm::dbgs() when using LLVM_DEBUG.
2. Converted a dump method on errs to be a print method on dbgs that is called from dump with print(llvm::dbgs()).
This ensures that we actually handle all instructions. I already found that we
are not handling ~106 cases... but to make this just a refactoring patch, I just
put in a default + a break + left in the error.
rdar://115367810
Previously before this patch, the logic for constructing TrackableSILValue was
split inbetween TrackableSILValue and the PartitionOpTranslator. A lot of
routines were also just utility routines that did not depend on the state in
either of the constructs.
With that in mind in this patch I:
1. Moved the utility functions that did not depend on internal state of those
functions into utility functions in the utility section.
2. Moved the logic in TrackableSILValue's constructor that depended on state
inside PartitionOpTranslator into PartitionOpTranslator itself.
3. Made TrackableSILValue a simple POD type used for storing state.
4. I changed capturedUIValues to just store within it a SILValue. It actually
does not care about isAliased or isSendable... it is just used as a way to check
if we have a uniquely identified value. In a forthcoming patch, I am going to
try to do similar things with the other maps that use TrackableSILValues since
by making the TrackableSILValues our keys/sets it allows for us to potentially
store multiple versions of the same TrackableSILValues if their aliased/sendable
state differ... which would lead to bugs.
Specifically, the two routines we were importing relatively were:
1. TypeChecker::conformsToProtocol. I moved this onto a helper routine on
SILType.
2. swift::findOriginalValueType(Expr *). This routine just looks through various
implicit conversions to find the original underlying type. I moved it to a
helper method on Expr.