[Serialization] Correctly handle special files when deserializing
authorJohn Brawn <john.brawn@arm.com>
Mon, 24 Apr 2023 14:35:37 +0000 (15:35 +0100)
committerJohn Brawn <john.brawn@arm.com>
Mon, 24 Apr 2023 14:35:37 +0000 (15:35 +0100)
This was supposed to be part of my previous commit, but I accidentally
pushed an old version of the patch.

clang/lib/Serialization/ASTReader.cpp

index 098ce5314ab17f19c53de849b6eef2b0556373a8..723dd99ffada2b684c428c23d01cdaa3cbae3851 100644 (file)
@@ -2523,7 +2523,8 @@ void ASTReader::ResolveImportedPath(ModuleFile &M, std::string &Filename) {
 }
 
 void ASTReader::ResolveImportedPath(std::string &Filename, StringRef Prefix) {
-  if (Filename.empty() || llvm::sys::path::is_absolute(Filename))
+  if (Filename.empty() || llvm::sys::path::is_absolute(Filename) ||
+      Filename == "<built-in>" || Filename == "<command line>")
     return;
 
   SmallString<128> Buffer;