mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Remove 'ModuleInst'.
Module values could never be used for anything, and we have SILUndef now, so when SILGen sees a ModuleExpr, we can just emit 'undef'. Swift SVN r10548
This commit is contained in:
@@ -594,10 +594,6 @@ public:
|
||||
return insert(new (F.getModule()) ProtocolMetatypeInst(Loc, Metatype,Base));
|
||||
}
|
||||
|
||||
ModuleInst *createModule(SILLocation Loc, SILType ModuleType) {
|
||||
return insert(new (F.getModule()) ModuleInst(Loc, ModuleType));
|
||||
}
|
||||
|
||||
StrongRetainInst *createStrongRetain(SILLocation Loc, SILValue Operand) {
|
||||
return insert(new (F.getModule()) StrongRetainInst(Loc, Operand));
|
||||
}
|
||||
|
||||
@@ -621,14 +621,6 @@ SILCloner<ImplClass>::visitProtocolMetatypeInst(ProtocolMetatypeInst *Inst) {
|
||||
getOpValue(Inst->getOperand())));
|
||||
}
|
||||
|
||||
template<typename ImplClass>
|
||||
void
|
||||
SILCloner<ImplClass>::visitModuleInst(ModuleInst *Inst) {
|
||||
doPostProcess(Inst,
|
||||
Builder.createModule(getOpLocation(Inst->getLoc()),
|
||||
getOpType(Inst->getType())));
|
||||
}
|
||||
|
||||
template<typename ImplClass>
|
||||
void
|
||||
SILCloner<ImplClass>::visitTupleExtractInst(TupleExtractInst *Inst) {
|
||||
|
||||
@@ -1344,23 +1344,6 @@ public:
|
||||
: UnaryInstructionBase(Loc, Base, Metatype) {}
|
||||
};
|
||||
|
||||
/// ModuleInst - Represents a reference to a module as a value.
|
||||
class ModuleInst : public SILInstruction {
|
||||
public:
|
||||
|
||||
ModuleInst(SILLocation Loc, SILType ModuleType);
|
||||
|
||||
/// getType() is ok since this is known to only have one type.
|
||||
SILType getType(unsigned i = 0) const { return ValueBase::getType(i); }
|
||||
|
||||
ArrayRef<Operand> getAllOperands() const { return {}; }
|
||||
MutableArrayRef<Operand> getAllOperands() { return {}; }
|
||||
|
||||
static bool classof(const ValueBase *V) {
|
||||
return V->getKind() == ValueKind::ModuleInst;
|
||||
}
|
||||
};
|
||||
|
||||
/// Extract a numbered element out of a value of tuple type.
|
||||
class TupleExtractInst
|
||||
: public UnaryInstructionBase<ValueKind::TupleExtractInst>
|
||||
|
||||
@@ -106,7 +106,6 @@ ABSTRACT_VALUE(SILInstruction, ValueBase)
|
||||
INST(FloatLiteralInst, SILInstruction, None)
|
||||
INST(StringLiteralInst, SILInstruction, None)
|
||||
INST(BuiltinZeroInst, SILInstruction, None)
|
||||
INST(ModuleInst, SILInstruction, None)
|
||||
|
||||
// Dynamic Dispatch
|
||||
ABSTRACT_VALUE(MethodInst, SILInstruction)
|
||||
|
||||
Reference in New Issue
Block a user