Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions clang/test/ClangScanDeps/include-tree-vfs-overlay.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// REQUIRES: ondisk_cas

// This is a reduced test for https://github.com/swiftlang/llvm-project/issues/11616

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: sed -e "s|DIR|%/t|g" %t/vfs-overlay.yaml.template > %t/vfs-overlay.yaml

// RUN: %clang -I%t -fdepscan=inline -fdepscan-include-tree -Xclang -fcas-path -Xclang %t/cas -Xclang -ivfsoverlay -Xclang %t/vfs-overlay.yaml -c %t/test.c

//--- test.c
#include "header.h"
#include "header1.h"

//--- header.h

//--- header2.h

//--- header3.h

//--- vfs-overlay.yaml.template
version: 0
case-sensitive: false
roots:
- name: "DIR"
type: directory
contents:
- name: header.h
type: file
external-contents: "DIR/header.h"
- name: header1.h
type: file
external-contents: "DIR/header2.h"
- name: header2.h
type: file
external-contents: "DIR/header3.h"

5 changes: 5 additions & 0 deletions llvm/lib/Support/VirtualFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,11 @@ class FileWithFixedStatus : public File {
std::error_code close() override { return InnerFile->close(); }

void setPath(const Twine &Path) override { S = S.copyWithNewName(S, Path); }

llvm::ErrorOr<std::optional<cas::ObjectRef>> getObjectRefForContent()
override {
return InnerFile->getObjectRefForContent();
}
};

} // namespace
Expand Down