mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[sil-cloner] Always call doPreProcess when visiting SILInstructions.
It is important to call doPreProcess to correctly setup the available opened archetypes which were referenced from the original instruction being copied. This fixes a concrete bug in LoopRotate optimization and potential bugs related to cloning. rdar://27659420
This commit is contained in:
@@ -31,7 +31,15 @@ class SILVisitor {
|
||||
public:
|
||||
ImplClass &asImpl() { return static_cast<ImplClass &>(*this); }
|
||||
|
||||
// Peform any required pre-processing before visiting.
|
||||
// Sub-classes can override it to provide their custom
|
||||
// pre-processing steps.
|
||||
void beforeVisit(ValueBase *V) {
|
||||
}
|
||||
|
||||
ValueRetTy visit(ValueBase *V) {
|
||||
asImpl().beforeVisit(V);
|
||||
|
||||
switch (V->getKind()) {
|
||||
#define VALUE(CLASS, PARENT) \
|
||||
case ValueKind::CLASS: \
|
||||
|
||||
Reference in New Issue
Block a user