llvm-project/clang/lib/Basic
Bruno Cardoso Lopes d878e28e67 Reapply [2] [VFS] Add 'overlay-relative' field to YAML files
This reapplies r261552 and r263748. Fixed testcase to reapply.

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

Differential Revision: http://reviews.llvm.org/D17457

rdar://problem/24499339

llvm-svn: 263893
2016-03-20 02:08:48 +00:00
..
Attributes.cpp Ignore the "novtable" declspec when not using the Microsoft C++ ABI. 2015-07-20 22:57:31 +00:00
Builtins.cpp Recommit: R258773 [OpenCL] Pipe builtin functions 2016-01-26 04:03:48 +00:00
CMakeLists.txt Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiagnosticsConsumer 2015-06-13 07:11:40 +00:00
CharInfo.cpp
Diagnostic.cpp Optionally demote fatal errors to non-fatal errors. 2016-03-01 10:56:19 +00:00
DiagnosticIDs.cpp Optionally demote fatal errors to non-fatal errors. 2016-03-01 10:56:19 +00:00
DiagnosticOptions.cpp Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiagnosticsConsumer 2015-06-13 07:11:40 +00:00
FileManager.cpp Remove the egregious PCHContainer layering hack that doesn't seem to be necessary anymore. 2016-02-01 13:22:39 +00:00
FileSystemStatCache.cpp [cleanup] Remove some unused #ifdef's 2015-06-11 23:34:13 +00:00
IdentifierTable.cpp [modules] Separately track whether an identifier's preprocessor information and 2016-02-05 19:03:40 +00:00
LangOptions.cpp [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a single 2016-02-19 22:25:36 +00:00
Module.cpp [modules] Simplify code logic. NFC. 2016-03-09 21:09:51 +00:00
ObjCRuntime.cpp Watch and TV OS: wire up basic ABI choices 2015-10-30 16:30:36 +00:00
OpenMPKinds.cpp [OPENMP 4.0] Initial support for 'omp declare reduction' construct. 2016-03-03 05:21:39 +00:00
OperatorPrecedence.cpp [OpenCL] Adding reserved operator logical xor for OpenCL 2016-02-03 15:17:14 +00:00
SanitizerBlacklist.cpp Replace double-negated !SourceLocation.isInvalid() with SourceLocation.isValid(). 2015-10-03 05:15:57 +00:00
Sanitizers.cpp Pull trivial SanitizerSet methods into the header. 2015-07-14 15:34:19 +00:00
SourceLocation.cpp Removing spurious semi colons; NFC. 2015-06-09 12:04:17 +00:00
SourceManager.cpp Remove use of builtin comma operator. 2016-02-18 22:34:54 +00:00
TargetInfo.cpp Make TargetInfo store an actual DataLayout instead of a string. 2016-03-04 19:00:41 +00:00
Targets.cpp Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end 2016-03-16 18:00:46 +00:00
TokenKinds.cpp [C++11] Use 'nullptr'. 2014-05-08 06:41:40 +00:00
Version.cpp Revert r223578, perf data collection depends on the old symbol name. 2014-12-10 23:49:03 +00:00
VersionTuple.cpp MS ABI: Implement driver-level support for thread-safe statics 2015-03-22 08:39:22 +00:00
VirtualFileSystem.cpp Reapply [2] [VFS] Add 'overlay-relative' field to YAML files 2016-03-20 02:08:48 +00:00
Warnings.cpp Use -Rblah, not -Wblah, to control remark diagnostics. This was always the 2014-08-07 00:24:21 +00:00