llvm-project/clang/lib
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
..
ARCMigrate Fix some Clang-tidy readability-redundant-control-flow warnings; other minor fixes. 2016-02-10 19:11:58 +00:00
AST Fix printing of anonymous struct typedefs. 2016-03-18 21:35:59 +00:00
ASTMatchers Adding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr. 2016-03-09 17:11:51 +00:00
Analysis [analyzer] Find ObjC 'self' decl even when block captures local named 'self'. 2016-02-23 22:26:04 +00:00
Basic Reapply [2] [VFS] Add 'overlay-relative' field to YAML files 2016-03-20 02:08:48 +00:00
CodeGen [TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init. 2016-03-18 23:35:21 +00:00
Driver Remove usage of LLVM_PREFIX. 2016-03-18 00:05:37 +00:00
Edit Remove autoconf support 2016-01-26 21:30:40 +00:00
Format clang-format: [JS] Make requoting of JavaScript string literals only 2016-03-17 13:03:41 +00:00
Frontend Reapply [2] [VFS] Add 'overlay-relative' field to YAML files 2016-03-20 02:08:48 +00:00
FrontendTool Make it possible for AST plugins to enable themselves by default 2016-03-15 12:51:40 +00:00
Headers Make functions in altivec.h be __inline__. As they are all also marked 2016-03-11 22:13:28 +00:00
Index [index] Make sure that declarations of builtin functions are indexed. 2016-03-17 04:28:19 +00:00
Lex Revert r263687 for ubsan bot failure. 2016-03-17 22:13:50 +00:00
Parse Revert r263687 for ubsan bot failure. 2016-03-17 22:13:50 +00:00
Rewrite Remove use of builtin comma operator. 2016-02-18 22:34:54 +00:00
Sema [Sema] Make type deduction work with some overloadable functions 2016-03-19 21:51:45 +00:00
Serialization [modules] Fix adding a templated friend functions to a namespace from another module. 2016-03-16 11:17:04 +00:00
StaticAnalyzer [analyzer] Fix missed leak from MSVC specific allocation functions 2016-03-08 01:21:51 +00:00
Tooling Add functions to apply replacements and reformat them. 2016-03-01 12:37:30 +00:00
CMakeLists.txt Fix build with various feature flag combinations 2014-07-14 22:17:22 +00:00