From d60a65abb6b050e10d9efdbc56dcb2e2e4772af1 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 4 Mar 2022 05:19:51 +0000 Subject: [PATCH] Fix for D119899 --- llvm/lib/TableGen/Parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/TableGen/Parser.cpp b/llvm/lib/TableGen/Parser.cpp index 47882c8524ab..0ccd564bef23 100644 --- a/llvm/lib/TableGen/Parser.cpp +++ b/llvm/lib/TableGen/Parser.cpp @@ -21,6 +21,7 @@ bool llvm::TableGenParseFile(std::unique_ptr Buffer, RecordKeeper Records; Records.saveInputFilename(Buffer->getBufferIdentifier().str()); + SrcMgr = SourceMgr(); SrcMgr.AddNewSourceBuffer(std::move(Buffer), SMLoc()); SrcMgr.setIncludeDirs(IncludeDirs); TGParser Parser(SrcMgr, /*Macros=*/None, Records);