[PATCH] D67938: [static analyzer] Define __clang_analyzer__ macro in driver

Artem Dergachev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 19:05:10 PDT 2019


NoQ added inline comments.


================
Comment at: clang/test/Analysis/misc-ps.m:5-7
-#ifndef __clang_analyzer__
-#error __clang_analyzer__ not defined
-#endif
----------------
jkorous wrote:
> dexonsmith wrote:
> > jkorous wrote:
> > > NoQ wrote:
> > > > We can make a new test that tests the driver instead, i.e. something like
> > > > 
> > > > ```
> > > > // RUN: %clang --analyze %s
> > > > #ifndef __clang_analyzer__
> > > > #error __clang_analyzer__ not defined
> > > > #endif
> > > > ```
> > > Good idea.
> > Would it be better to add `-D__clang_analyzer__` to the `%clang_analyze_cc1` expansion?
> Good question! It seems to me I probably should (to keep implicit assumptions in tests intact).
I don't really care, we don't ever need it in tests and we don't need more than one test to test the macro itself.

P.S. Whoops, i think [[ http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/20667 | we broke clang-tidy ]]. I'm glad they had a test for this! :)  I don't know how exactly were they picking up the macro.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67938





More information about the llvm-commits mailing list