[clang-scan-deps] Fix for headers having the same name as a directory
authorAlex Lorenz <arphaman@gmail.com>
Fri, 13 Sep 2019 22:12:02 +0000 (22:12 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 13 Sep 2019 22:12:02 +0000 (22:12 +0000)
commitee30b0ecc245a5c50e47de19fa21491b50427ae2
tree544eb35443e90cf8326accf44ee9fe7c9f00788d
parent573863ea180b7ce73dda4e019ad94fddf2222363
[clang-scan-deps] Fix for headers having the same name as a directory

Scan deps tool crashes when called on a C++ file, containing an include
that has the same name as a directory.
The tool crashes since it finds foo/dir and tries to read that as a file and fails.

Patch by: kousikk (Kousik Kumar)

Differential Revision: https://reviews.llvm.org/D67091

llvm-svn: 371903
clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp
clang/test/ClangScanDeps/Inputs/foodir [new file with mode: 0644]
clang/test/ClangScanDeps/Inputs/headerwithdirname.json [new file with mode: 0644]
clang/test/ClangScanDeps/headerwithdirname.cpp [new file with mode: 0644]