projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32bd1f5
)
[AsmParser] Avoid instantiating LLVMContext if not needed. NFC
author
Yevgeny Rouban
<yrouban@azul.com>
Mon, 20 Mar 2023 07:54:10 +0000
(14:54 +0700)
committer
Yevgeny Rouban
<yrouban@azul.com>
Mon, 20 Mar 2023 07:56:57 +0000
(14:56 +0700)
Differential Revision: https://reviews.llvm.org/D142699
llvm/lib/AsmParser/Parser.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/AsmParser/Parser.cpp
b/llvm/lib/AsmParser/Parser.cpp
index
035eea8
..
eded892
100644
(file)
--- 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());
-
LLVMContext
Context;
+
std::optional<LLVMContext> Opt
Context;
return LLParser(F.getBuffer(), SM, Err, M, Index,
- M ? M->getContext() :
Context
, Slots)
+ M ? M->getContext() :
OptContext.emplace()
, Slots)
.Run(UpgradeDebugInfo, DataLayoutCallback);
}