Revert "[AsmParser] Avoid instantiating LLVMContext if not needed. NFC"
authorYevgeny Rouban <yrouban@azul.com>
Mon, 20 Mar 2023 08:04:21 +0000 (15:04 +0700)
committerYevgeny Rouban <yrouban@azul.com>
Mon, 20 Mar 2023 08:07:33 +0000 (15:07 +0700)
This reverts commit c1888a370ada6e76d51cdb9c6eeefa2588a475eb
because of massive buildbolt failures.

llvm/lib/AsmParser/Parser.cpp

index eded892..035eea8 100644 (file)
@@ -28,9 +28,9 @@ static bool parseAssemblyInto(MemoryBufferRef F, Module *M,
   std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(F);
   SM.AddNewSourceBuffer(std::move(Buf), SMLoc());
 
-  std::optional<LLVMContext> OptContext;
+  LLVMContext Context;
   return LLParser(F.getBuffer(), SM, Err, M, Index,
-                  M ? M->getContext() : OptContext.emplace(), Slots)
+                  M ? M->getContext() : Context, Slots)
       .Run(UpgradeDebugInfo, DataLayoutCallback);
 }