Add a 'use-external-names' option to VFS overlay files

Programming / Compilers / Clang - Ben Langmuir [apple.com] - 26 February 2014 18:25 UTC

When true, sets the name of the file to be the name from 'external-contents'. Otherwise, you get the virtual path that the file was looked up by. This will not affect any non-virtual paths, or fully
virtual paths (for which there is no reasonable 'external' name anyway).

The setting is available globally, but can be overriden on a per-file basis.

The goal is that this setting will control which path you see in debug info, diagnostics, etc. which are sensitive to which path is used. That will come in future patches that pass the name through to FileManager.

e40e43d Add a 'use-external-names' option to VFS overlay files
include/clang/Basic/VirtualFileSystem.h | 10 +----
lib/Basic/VirtualFileSystem.cpp | 61 ++++++++++++++++++++++-------
unittests/Basic/VirtualFileSystemTest.cpp | 54 ++++++++++++++++++++++++-
3 files changed, 99 insertions(+), 26 deletions(-)

Upstream: github.com


  • Share