[VFS] Fix status() of opened redirected file
Make RedirectedFileSystem::openFilForRead(path)->status() the same as
RedirectedFileSystem::status(path). Previously we would just get the
status of the underlying real file, which would not have the IsVFSMapped
bit set.
This fixes rebuilding a module that has an include that is relative to
the includer where we will lookup the real path of that file before we
lookup the VFS location.
rdar://problem/23640339
llvm-svn: 255312
diff --git a/clang/test/VFS/Inputs/public_header.h b/clang/test/VFS/Inputs/public_header.h
index 09d9969..cc7bcb5 100644
--- a/clang/test/VFS/Inputs/public_header.h
+++ b/clang/test/VFS/Inputs/public_header.h
@@ -1,2 +1,3 @@
#import <SomeFramework/public_header2.h>
+#import "public_header3.h" // includer-relative
void from_framework(void);
diff --git a/clang/test/VFS/Inputs/public_header3.h b/clang/test/VFS/Inputs/public_header3.h
new file mode 100644
index 0000000..ac9deac
--- /dev/null
+++ b/clang/test/VFS/Inputs/public_header3.h
@@ -0,0 +1 @@
+// public_header3.h
diff --git a/clang/test/VFS/Inputs/vfsoverlay.yaml b/clang/test/VFS/Inputs/vfsoverlay.yaml
index f395d45..504a153 100644
--- a/clang/test/VFS/Inputs/vfsoverlay.yaml
+++ b/clang/test/VFS/Inputs/vfsoverlay.yaml
@@ -22,7 +22,9 @@
{ 'name': 'public_header.h', 'type': 'file',
'external-contents': 'INPUT_DIR/public_header.h' },
{ 'name': 'public_header2.h', 'type': 'file',
- 'external-contents': 'INPUT_DIR/public_header2.h' }
+ 'external-contents': 'INPUT_DIR/public_header2.h' },
+ { 'name': 'public_header3.h', 'type': 'file',
+ 'external-contents': 'INPUT_DIR/public_header3.h' }
]
}
]
diff --git a/clang/test/VFS/real-path-found-first.m b/clang/test/VFS/real-path-found-first.m
index 3b37a64..5838aa3 100644
--- a/clang/test/VFS/real-path-found-first.m
+++ b/clang/test/VFS/real-path-found-first.m
@@ -70,5 +70,6 @@
#ifndef WITH_PREFIX
#import <SomeFramework/public_header.h> // expected-warning{{treating}}
#import <SomeFramework/public_header2.h> // expected-warning{{treating}}
+#import <SomeFramework/public_header3.h> // expected-warning{{treating}}
@import SomeFramework.public_header2;
#endif