]> granicus.if.org Git - llvm/commitdiff
[MIR Parser] Fix Build!
authorMehdi Amini <mehdi.amini@apple.com>
Sat, 17 Sep 2016 05:41:02 +0000 (05:41 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sat, 17 Sep 2016 05:41:02 +0000 (05:41 +0000)
Last-second refactoring before push was bad idea...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281812 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MIRParser/MIRParser.cpp

index 35614d3b77b501382b3d7b47d68617568173efe8..9b0c50996800de7be080471577d5339e42cefe9c 100644 (file)
@@ -828,6 +828,7 @@ std::unique_ptr<MIRParser> llvm::createMIRParserFromFile(StringRef Filename,
 std::unique_ptr<MIRParser>
 llvm::createMIRParser(std::unique_ptr<MemoryBuffer> Contents,
                       LLVMContext &Context) {
+  auto Filename = Contents->getBufferIdentifier();
   if (Context.shouldDiscardValueNames()) {
     Context.diagnose(DiagnosticInfoMIRParser(
         DS_Error,
@@ -836,7 +837,6 @@ llvm::createMIRParser(std::unique_ptr<MemoryBuffer> Contents,
             "Can't read MIR with a Context that discards named Values")));
     return nullptr;
   }
-  auto Filename = Contents->getBufferIdentifier();
   return llvm::make_unique<MIRParser>(
       llvm::make_unique<MIRParserImpl>(std::move(Contents), Filename, Context));
 }