SIL refactoring: Move some functions out of SILValue and Operand

SILValue.h/.cpp just defines the SIL base classes. Referring to specific instructions is a (small) kind of layering violation.
Also I want to keep SILValue small so that it is really just a type alias of ValueBase*.
NFC.
This commit is contained in:
Erik Eckstein
2016-01-25 10:36:09 -08:00
parent 1383612ad6
commit b745691a38
21 changed files with 332 additions and 300 deletions

View File

@@ -23,6 +23,7 @@
#include "swift/SIL/SILFunction.h"
#include "swift/SIL/SILInstruction.h"
#include "swift/SIL/SILModule.h"
#include "swift/SIL/InstructionUtils.h"
#include "swift/SILOptimizer/Analysis/ClassHierarchyAnalysis.h"
#include "swift/SILOptimizer/Utils/Generics.h"
#include "swift/SILOptimizer/PassManager/Passes.h"
@@ -306,7 +307,7 @@ static bool tryToSpeculateTarget(FullApplySite AI,
// Strip any upcasts off of our 'self' value, potentially leaving us
// with a value whose type is closer (in the class hierarchy) to the
// actual dynamic type.
auto SubTypeValue = CMI->getOperand().stripUpCasts();
auto SubTypeValue = stripUpCasts(CMI->getOperand());
SILType SubType = SubTypeValue.getType();
// Bail if any generic types parameters of the class instance type are