[llvm] e735620 - Revert "[AsmParser] Avoid instantiating LLVMContext if not needed. NFC"

Yevgeny Rouban via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 01:08:08 PDT 2023


Author: Yevgeny Rouban
Date: 2023-03-20T15:07:33+07:00
New Revision: e7356206122626bcfc878a24bf5aabd1e54e0729

URL: https://github.com/llvm/llvm-project/commit/e7356206122626bcfc878a24bf5aabd1e54e0729
DIFF: https://github.com/llvm/llvm-project/commit/e7356206122626bcfc878a24bf5aabd1e54e0729.diff

LOG: Revert "[AsmParser] Avoid instantiating LLVMContext if not needed. NFC"

This reverts commit c1888a370ada6e76d51cdb9c6eeefa2588a475eb
because of massive buildbolt failures.

Added: 
    

Modified: 
    llvm/lib/AsmParser/Parser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/AsmParser/Parser.cpp b/llvm/lib/AsmParser/Parser.cpp
index eded892f358a8..035eea81378e5 100644
--- a/llvm/lib/AsmParser/Parser.cpp
+++ b/llvm/lib/AsmParser/Parser.cpp
@@ -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);
 }
 


        


More information about the llvm-commits mailing list