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

Jan Korous via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 18:30:20 PDT 2019


jkorous marked an inline comment as done.
jkorous added inline comments.


================
Comment at: clang/test/Analysis/misc-ps.m:5-7
-#ifndef __clang_analyzer__
-#error __clang_analyzer__ not defined
-#endif
----------------
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.


================
Comment at: clang/test/Analysis/misc-ps.m:5-7
-#ifndef __clang_analyzer__
-#error __clang_analyzer__ not defined
-#endif
----------------
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).


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