<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in notzero.model</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>eeccb30b - Add support for the static analyzer to synthesize function implementations from external model files.</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/Analysis/Inputs/Models/notzero.model#eeccb30b</link>
        <description>Add support for the static analyzer to synthesize function implementations from external model files.Currently the analyzer lazily models some functions using &apos;BodyFarm&apos;,which constructs a fake function implementation that the analyzercan simulate that approximates the semantics of the function whenit is called.  BodyFarm does this by constructing the AST forsuch definitions on-the-fly.  One strength of BodyFarmis that all symbols and types referenced by synthesized functionbodies are contextual adapted to the containing translation unit.The downside is that these ASTs are hardcoded in Clang&apos;s ownsource code.A more scalable model is to allow these models to be defined as sourcecode in separate &quot;model&quot; files and have the analyzer use thosedefinitions lazily when a function body is needed.  Among other things,it will allow more customization of the analyzer for specific APIsand platforms.This patch provides the initial infrastructure for this feature.It extends BodyFarm to use an abstract API &apos;CodeInjector&apos; that can beused to synthesize function bodies.  That &apos;CodeInjector&apos; isimplemented using a new &apos;ModelInjector&apos; in libFrontend, which lazilyparses a model file and injects the ASTs into the current translationunit.  Models are currently found by specifying a &apos;model-path&apos; as ananalyzer option; if no path is specified the CodeInjector is notused, thus defaulting to the current behavior in the analyzer.Models currently contain a single function definition, and canbe found by finding the file &lt;function name&gt;.model.  This is aninitial starting point for something more rich, but it bootstrapsthis feature for future evolution.This patch was contributed by G&#225;bor Horv&#225;th as part of hisGoogle Summer of Code project.Some notes:- This introduces the notion of a &quot;model file&quot; into  FrontendAction and the Preprocessor.  This nomenclature  is specific to the static analyzer, but possibly could be  generalized.  Essentially these are sources pulled in  exogenously from the principal translation.  Preprocessor gets a &apos;InitializeForModelFile&apos; and  &apos;FinalizeForModelFile&apos; which could possibly be hoisted out  of Preprocessor if Preprocessor exposed a new API to  change the PragmaHandlers and some other internal pieces.  This  can be revisited.  FrontendAction gets a &apos;isModelParsingAction()&apos; predicate function  used to allow a new FrontendAction to recycle the Preprocessor  and ASTContext.  This name could probably be made something  more general (i.e., not tied to &apos;model files&apos;) at the expense  of losing the intent of why it exists.  This can be revisited.- This is a moderate sized patch; it has gone through some amount of  offline code review.  Most of the changes to the non-analyzer  parts are fairly small, and would make little sense without  the analyzer changes.- Most of the analyzer changes are plumbing, with the interesting  behavior being introduced by ModelInjector.cpp and  ModelConsumer.cpp.- The new functionality introduced by this change is off-by-default.  It requires an analyzer config option to enable.llvm-svn: 216550

            List of files:
            /llvm-project-15.0.7/clang/test/Analysis/Inputs/Models/notzero.model</description>
        <pubDate>Wed, 27 Aug 2014 15:14:15 +0000</pubDate>
        <dc:creator>Ted Kremenek &lt;kremenek@apple.com&gt;</dc:creator>
    </item>
</channel>
</rss>
