[TableGen][SourceMgr] Fix obvious mistake in D141220
authorMarkus Böck <markus.boeck02@gmail.com>
Mon, 9 Jan 2023 10:16:56 +0000 (11:16 +0100)
committerMarkus Böck <markus.boeck02@gmail.com>
Mon, 9 Jan 2023 10:16:56 +0000 (11:16 +0100)
It now tried to open the IncludedFile instead of the Filename, which was not intended.

llvm/lib/Support/SourceMgr.cpp

index 7fdd217..8065f0a 100644 (file)
@@ -53,7 +53,7 @@ ErrorOr<std::unique_ptr<MemoryBuffer>>
 SourceMgr::OpenIncludeFile(const std::string &Filename,
                            std::string &IncludedFile) {
   ErrorOr<std::unique_ptr<MemoryBuffer>> NewBufOrErr =
-      MemoryBuffer::getFile(IncludedFile);
+      MemoryBuffer::getFile(Filename);
 
   SmallString<64> Buffer(Filename);
   // If the file didn't exist directly, see if it's in an include path.