CodeGenAction: don't duplicate entire .ll/.bc files into memory
authorAlp Toker <alp@nuanti.com>
Fri, 27 Jun 2014 04:34:44 +0000 (04:34 +0000)
committerAlp Toker <alp@nuanti.com>
Fri, 27 Jun 2014 04:34:44 +0000 (04:34 +0000)
Requires supporting changes from LLVM r211861.

llvm-svn: 211862

clang/lib/CodeGen/CodeGenAction.cpp

index f162c30..2b7fab3 100644 (file)
@@ -644,13 +644,8 @@ void CodeGenAction::ExecuteAction() {
     if (Invalid)
       return;
 
-    // FIXME: This is stupid, IRReader shouldn't take ownership.
-    llvm::MemoryBuffer *MainFileCopy =
-      llvm::MemoryBuffer::getMemBufferCopy(MainFile->getBuffer(),
-                                           getCurrentFile());
-
     llvm::SMDiagnostic Err;
-    TheModule.reset(ParseIR(MainFileCopy, Err, *VMContext));
+    TheModule.reset(ParseIR(MainFile, Err, *VMContext));
     if (!TheModule) {
       // Translate from the diagnostic info to the SourceManager location.
       SourceLocation Loc = SM.translateFileLineCol(