Use the Objective-C runtime to unique selectors in JIT'd code.

When generating IR for the JIT, use sel_registerName() to unique the
selector references we generate. Static code doesn't need this
pessimization. Fixes <rdar://problem/12764732>.


Swift SVN r3403
This commit is contained in:
Doug Gregor
2012-12-07 17:13:27 +00:00
parent 1e689a936d
commit 07be3f3e7f
4 changed files with 41 additions and 6 deletions

View File

@@ -143,7 +143,8 @@ void swift::RunImmediately(TranslationUnit *TU) {
Options.Triple = llvm::sys::getDefaultTargetTriple();
Options.OptLevel = 2;
Options.OutputKind = irgen::OutputKind::Module;
Options.UseJIT = true;
// IRGen the main module.
llvm::LLVMContext LLVMContext;
llvm::Module Module(TU->Name.str(), LLVMContext);
@@ -299,7 +300,8 @@ void swift::REPL(ASTContext &Context) {
Options.Triple = llvm::sys::getDefaultTargetTriple();
Options.OptLevel = 0;
Options.OutputKind = irgen::OutputKind::Module;
Options.UseJIT = true;
EditLineWrapper e;
char* CurBuffer = const_cast<char*>(Buffer->getBufferStart());