[PATCH] D49466: Initial implementation of -fmacro-prefix-map and -ffile-prefix-map

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 20:14:58 PST 2019


MaskRay added a comment.

Does this work on Windows?

  --- i/clang/test/Preprocessor/file_test.c
  +++ w/clang/test/Preprocessor/file_test.c
  @@ -1,8 +1,7 @@
  -// XFAIL: system-windows
   // RUN: %clang -E -ffile-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
   // RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH/empty -c -o - %s | FileCheck %s
   // RUN: %clang -E -fmacro-prefix-map=%p=/UNLIKELY_PATH=empty -c -o - %s | FileCheck %s -check-prefix CHECK-EVIL
  -// RUN: %clang -E -fmacro-prefix-map=%p/= -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
  +// RUN: %clang -E -fmacro-prefix-map=%/p/= -c -o - %/s | FileCheck %s --check-prefix CHECK-REMOVE

`startswith` is not ideal because `/t` will match `/tmp`. However, gcc appears to use something similar to `startswith`, see:

  % gcc -c -g -fdebug-prefix-map=/t=x /tmp/c/a.c -o /tmp/c/a.o
  % llvm-dwarfdump /tmp/c/a.o | grep -m 1 DW_AT_name
                DW_AT_name        ("xmp/c/a.c")


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D49466/new/

https://reviews.llvm.org/D49466





More information about the cfe-commits mailing list