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

Peter Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 11 07:32:22 PST 2019


Lekensteyn added a comment.

It would be nice to have this for Clang 8.0, the branch date is within 5 days :)



================
Comment at: lib/Driver/ToolChains/Clang.cpp:617
     if (Map.find('=') == StringRef::npos)
-      D.Diag(diag::err_drv_invalid_argument_to_fdebug_prefix_map) << Map;
+      D.Diag(diag::err_drv_invalid_argument_to_prefix_map) << Map << "debug";
     else
----------------
For `clang -ffile-prefix-map=foo`, wouldn't this report `invalid argument 'foo' to -fdebug-prefix-map`? If so, perhaps some method of `A` or `A->getOption()` can be used?


================
Comment at: lib/Driver/ToolChains/Clang.cpp:630
+    if (Map.find('=') == StringRef::npos)
+      D.Diag(diag::err_drv_invalid_argument_to_prefix_map) << Map << "macro";
+    else
----------------
Same concern here about `-ffile-prefix-map=foo` showing an error message about `-fmacro-prefix-map`.


================
Comment at: test/Preprocessor/file_test.c:5
+// RUN: %clang -E -fmacro-prefix-map=%p/= -c -o - %s | FileCheck %s --check-prefix CHECK-REMOVE
+//This is a comment
+
----------------
Any reason to keep this comment?


Repository:
  rC Clang

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

https://reviews.llvm.org/D49466





More information about the cfe-commits mailing list