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:
Joe Groff
2013-11-18 21:36:08 +00:00
parent f09950390c
commit f6b1745650
15 changed files with 4 additions and 100 deletions

View File

@@ -20,6 +20,7 @@
#include "swift/Basic/SourceManager.h"
#include "swift/Basic/type_traits.h"
#include "swift/SIL/SILArgument.h"
#include "swift/SIL/SILUndef.h"
#include "swift/SIL/TypeLowering.h"
#include "Initialization.h"
#include "LValue.h"
@@ -1167,8 +1168,9 @@ RValue RValueEmitter::visitDotSyntaxBaseIgnoredExpr(
}
RValue RValueEmitter::visitModuleExpr(ModuleExpr *E, SGFContext C) {
SILValue module =
SGF.B.createModule(E, SGF.getLoweredLoadableType(E->getType()));
// Produce an undef value. The module value should never actually be used.
SILValue module = SILUndef::get(SGF.getLoweredLoadableType(E->getType()),
SGF.SGM.M);
return RValue(SGF, ManagedValue(module, ManagedValue::Unmanaged), E);
}