[llvm] 90b5afe - [TableGen][SourceMgr] Fix obvious mistake in D141220

Markus Böck via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 02:17:10 PST 2023


Author: Markus Böck
Date: 2023-01-09T11:16:56+01:00
New Revision: 90b5afeb652e4073d72a513dbdff9c6e1ec10688

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

LOG: [TableGen][SourceMgr] Fix obvious mistake in D141220

It now tried to open the IncludedFile instead of the Filename, which was not intended.

Added: 
    

Modified: 
    llvm/lib/Support/SourceMgr.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp
index 7fdd217f861f7..8065f0ad663a9 100644
--- a/llvm/lib/Support/SourceMgr.cpp
+++ b/llvm/lib/Support/SourceMgr.cpp
@@ -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.


        


More information about the llvm-commits mailing list