[PATCH] D11968: Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.

Ivan Krasin via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 18:11:03 PDT 2015


krasin added a comment.

In http://reviews.llvm.org/D11968#222338, @pcc wrote:

> We should also make blacklists appear in the `--show-includes` output.


Is it about Windows compatibility? Do you mean that the output of

  bin/clang-cl /Zs /showIncludes ~/lala.cc -fsanitize=address

should include the default blacklist (and any explicit blacklists, if they were specified)?


================
Comment at: lib/Frontend/DependencyFile.cpp:416-420
@@ -413,2 +415,7 @@
 
+  // Add extra dependencies to the end of the list.
+  for (auto ExtraDep : ExtraDeps) {
+    AddFilename(ExtraDep);
+  }
+
   // Write out the dependency targets, trying to avoid overly long
----------------
pcc wrote:
>  If you move this code to the constructor you won't need to add an extra data member to this class.
I considered that. In this case, extra deps will appear even before the source file itself.

Right now, for my local test code, it generates:

```
lala.o: /usr/local/google/home/krasin/lala.cc \
  /usr/local/google/home/krasin/foo.h \
  /usr/local/google/home/krasin/bar.h \
  /usr/local/google/home/krasin/blacklist.txt
```

If moved to the constructor, it will become:

```
lala.o: /usr/local/google/home/krasin/blacklist.txt \
  /usr/local/google/home/krasin/lala.cc \
  /usr/local/google/home/krasin/foo.h \
  /usr/local/google/home/krasin/bar.h
```

This decreases the readability of the generated rules, as the main source becomes harder to discover.

Please, let me know, if you think it's not a problem; I will move the code to the constructor and eliminate the extra member.



http://reviews.llvm.org/D11968





More information about the cfe-commits mailing list