[PATCH] D85319: [analyzer][RFC] Get info from the LLVM IR for precision

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 08:38:15 PDT 2020


martong marked 3 inline comments as done.
martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp:30
+  // markers which are used by some LLVM analysis (e.g. AliasAnalysis).
+  CGO.OptimizationLevel = 2; // -O2
+
----------------
xazax.hun wrote:
> martong wrote:
> > TODO overwrite ALL optimization related config.
> > 
> > Artem:
> > > we should not be taking -O flags into account at all, but pick some default -O2 regardless of flags; and ideally all flags should be ignored by default, to ensure experience as consistent as possible.
> > 
> > 
> Additional bit of info from the mailing list: relying on the set of optimizations from O2 might not suffice as it might contain passes with bad side effects. One example is removing a static function that was inlined to all of the call sites which would make us unable to query the analysis results for that function. Overall, we might not want to make the analysis dependent on inlining heuristics. (Or we might not care. This is up for discussion.)
`CodeGenOptions CGO = CodeGenOptions(); ` will create an options object with all value set to the default.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85319



More information about the cfe-commits mailing list