mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 03:25:54 -04:00
[www] Change URLs to HTTPS.
This changes most URLs in llvm's html files to HTTPS. Most changes were search-and-replace with manual verification; some changes were manual. For a few URLs, the websites were performing redirects or had changed their anchors; I fixed those up manually. This consistently uses the official https://wg21.link redirector. This also strips trailing whitespace and fixes a couple of typos. Fixes D69363. There are a very small number of dead links for which I don't know any replacements (they are equally dead as HTTP or HTTPS): https://llvm.org/cmds/llvm2cpp.html https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-desktop.mp4 https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-mobile.mp4 https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-desktop.mov https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-mobile.mp4 https://llvm.org/perf/db_default/v4/nts/22463 https://polly.llvm.org/documentation/memaccess.html
This commit is contained in:
parent
d0bd3fc88b
commit
2e4f1e112d
@ -44,19 +44,19 @@ doxygen markup, but cannot yet generate documentation from it.</li>
|
|||||||
Clang is built as a set of libraries, which means that it is possible to
|
Clang is built as a set of libraries, which means that it is possible to
|
||||||
implement capabilities similar to other source language tools, improving them
|
implement capabilities similar to other source language tools, improving them
|
||||||
in various ways. Three examples are <a
|
in various ways. Three examples are <a
|
||||||
href="http://distcc.samba.org/">distcc</a>, the <a
|
href="https://github.com/distcc">distcc</a>, the <a
|
||||||
href="http://delta.tigris.org/">delta testcase reduction tool</a>, and the
|
href="http://delta.tigris.org/">delta testcase reduction tool</a>, and the
|
||||||
"indent" source reformatting tool.
|
"indent" source reformatting tool.
|
||||||
distcc can be improved to scale better and be more efficient. Delta could be
|
distcc can be improved to scale better and be more efficient. Delta could be
|
||||||
faster and more efficient at reducing C-family programs if built on the clang
|
faster and more efficient at reducing C-family programs if built on the clang
|
||||||
preprocessor. The clang-based indent replacement,
|
preprocessor. The clang-based indent replacement,
|
||||||
<a href="http://clang.llvm.org/docs/ClangFormat.html">clang-format</a>,
|
<a href="https://clang.llvm.org/docs/ClangFormat.html">clang-format</a>,
|
||||||
could be taught to handle simple structural rules like those in <a
|
could be taught to handle simple structural rules like those in <a
|
||||||
href="http://llvm.org/docs/CodingStandards.html#hl_earlyexit">the LLVM coding
|
href="https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code">the LLVM coding
|
||||||
standards</a>.</li>
|
standards</a>.</li>
|
||||||
|
|
||||||
<li><b>Use clang libraries to extend Ragel with a JIT</b>: <a
|
<li><b>Use clang libraries to extend Ragel with a JIT</b>: <a
|
||||||
href="http://research.cs.queensu.ca/~thurston/ragel/">Ragel</a> is a state
|
href="https://www.colm.net/open-source/ragel/">Ragel</a> is a state
|
||||||
machine compiler that lets you embed C code into state machines and generate
|
machine compiler that lets you embed C code into state machines and generate
|
||||||
C code. It would be relatively easy to turn this into a JIT compiler using
|
C code. It would be relatively easy to turn this into a JIT compiler using
|
||||||
LLVM.</li>
|
LLVM.</li>
|
||||||
|
@ -45,7 +45,7 @@ to solve and a proposed implementation (from the user perspective).</p>
|
|||||||
development. Stay tuned for more information, and of course, patches
|
development. Stay tuned for more information, and of course, patches
|
||||||
welcome!</p>
|
welcome!</p>
|
||||||
|
|
||||||
<p>See also <a href="http://llvm.org/PR4127">PR4127</a>.</p>
|
<p>See also <a href="https://llvm.org/PR4127">PR4127</a>.</p>
|
||||||
|
|
||||||
<h2>Existing Solutions and Related Work</h2>
|
<h2>Existing Solutions and Related Work</h2>
|
||||||
|
|
||||||
@ -55,14 +55,14 @@ welcome!</p>
|
|||||||
and <tt>-m64</tt> solve a small subset of the problem for specific
|
and <tt>-m64</tt> solve a small subset of the problem for specific
|
||||||
architectures.</li>
|
architectures.</li>
|
||||||
|
|
||||||
<li>gcc's <a href="http://www.airs.com/ian/configure/configure_8.html">multilibs</a>
|
<li>gcc's <a href="https://www.airs.com/ian/configure/configure_8.html">multilibs</a>
|
||||||
solve the part of the problem that relates to finding appropriate libraries
|
solve the part of the problem that relates to finding appropriate libraries
|
||||||
and include files based on particular feature support (soft float,
|
and include files based on particular feature support (soft float,
|
||||||
etc.).</li>
|
etc.).</li>
|
||||||
|
|
||||||
<li>Apple's "driver driver" supported by gcc and clang solve a subset of the
|
<li>Apple's "driver driver" supported by gcc and clang solve a subset of the
|
||||||
problem by supporting <tt>-arch</tt>. Apple also provides a tool chain which
|
problem by supporting <tt>-arch</tt>. Apple also provides a tool chain which
|
||||||
supports <a href="http://en.wikipedia.org/wiki/Universal_binary">universal
|
supports <a href="https://en.wikipedia.org/wiki/Universal_binary">universal
|
||||||
binaries</a> and object files which may include data for multiple
|
binaries</a> and object files which may include data for multiple
|
||||||
architectures. See <a href="http://developer.apple.com/mac/library/technotes/tn2005/tn2137.html">TN2137</a>
|
architectures. See <a href="http://developer.apple.com/mac/library/technotes/tn2005/tn2137.html">TN2137</a>
|
||||||
for an example of how this is used.</li>
|
for an example of how this is used.</li>
|
||||||
@ -73,7 +73,7 @@ welcome!</p>
|
|||||||
does not match well with tools which are inherently capable of cross
|
does not match well with tools which are inherently capable of cross
|
||||||
compiling.</li>
|
compiling.</li>
|
||||||
|
|
||||||
<li>The Debian <a href="http://wiki.debian.org/ArmEabiPort">ArmEabiPort</a>
|
<li>The Debian <a href="https://wiki.debian.org/ArmEabiPort">ArmEabiPort</a>
|
||||||
wiki page for their work to support the ARM EABI provide an interesting
|
wiki page for their work to support the ARM EABI provide an interesting
|
||||||
glimpse into how related issues impact the operating system distribution.</li>
|
glimpse into how related issues impact the operating system distribution.</li>
|
||||||
|
|
||||||
|
@ -930,9 +930,9 @@ alpha.unix.SimpleStream</span><span class="lang">
|
|||||||
Check for misuses of stream APIs:<div class=functions>
|
Check for misuses of stream APIs:<div class=functions>
|
||||||
fopen<br>
|
fopen<br>
|
||||||
fclose</div>(demo checker, the subject of the demo
|
fclose</div>(demo checker, the subject of the demo
|
||||||
(<a href="http://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">Slides</a>
|
(<a href="https://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">Slides</a>
|
||||||
,<a href="https://youtu.be/kdxlsP5QVPw">Video</a>)
|
,<a href="https://youtu.be/kdxlsP5QVPw">Video</a>)
|
||||||
by Anna Zaks and Jordan Rose presented at the <a href="http://llvm.org/devmtg/2012-11/">
|
by Anna Zaks and Jordan Rose presented at the <a href="https://llvm.org/devmtg/2012-11/">
|
||||||
2012 LLVM Developers' Meeting).</a></div></div></a></td>
|
2012 LLVM Developers' Meeting).</a></div></div></a></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
|
@ -17,18 +17,18 @@
|
|||||||
<h1>Source Annotations</h1>
|
<h1>Source Annotations</h1>
|
||||||
|
|
||||||
<p>The Clang frontend supports several source-level annotations in the form of
|
<p>The Clang frontend supports several source-level annotations in the form of
|
||||||
<a href="http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html">GCC-style
|
<a href="https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html">GCC-style
|
||||||
attributes</a> and pragmas that can help make using the Clang Static Analyzer
|
attributes</a> and pragmas that can help make using the Clang Static Analyzer
|
||||||
more useful. These annotations can both help suppress false positives as well as
|
more useful. These annotations can both help suppress false positives as well as
|
||||||
enhance the analyzer's ability to find bugs.</p>
|
enhance the analyzer's ability to find bugs.</p>
|
||||||
|
|
||||||
<p>This page gives a practical overview of such annotations. For more technical
|
<p>This page gives a practical overview of such annotations. For more technical
|
||||||
specifics regarding Clang-specific annotations please see the Clang's list of <a
|
specifics regarding Clang-specific annotations please see the Clang's list of <a
|
||||||
href="http://clang.llvm.org/docs/LanguageExtensions.html">language
|
href="https://clang.llvm.org/docs/LanguageExtensions.html">language
|
||||||
extensions</a>. Details of "standard" GCC attributes (that Clang also
|
extensions</a>. Details of "standard" GCC attributes (that Clang also
|
||||||
supports) can be found in the <a href="http://gcc.gnu.org/onlinedocs/gcc/">GCC
|
supports) can be found in the <a href="https://gcc.gnu.org/onlinedocs/gcc/">GCC
|
||||||
manual</a>, with the majority of the relevant attributes being in the section on
|
manual</a>, with the majority of the relevant attributes being in the section on
|
||||||
<a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html">function
|
<a href="https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html">function
|
||||||
attributes</a>.</p>
|
attributes</a>.</p>
|
||||||
|
|
||||||
<p>Note that attributes that are labeled <b>Clang-specific</b> are not
|
<p>Note that attributes that are labeled <b>Clang-specific</b> are not
|
||||||
@ -68,7 +68,7 @@ recognized by GCC. Their use can be conditioned using preprocessor macros
|
|||||||
<li><a href="#attr_os_consumes_this">Attribute 'os_consumes_this'</a></li>
|
<li><a href="#attr_os_consumes_this">Attribute 'os_consumes_this'</a></li>
|
||||||
<li><a href="#os_out_parameters">Out Parameters</a></li>
|
<li><a href="#os_out_parameters">Out Parameters</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@ -91,7 +91,7 @@ recognized by GCC. Their use can be conditioned using preprocessor macros
|
|||||||
<p>The analyzer recognizes the GCC attribute 'nonnull', which indicates that a
|
<p>The analyzer recognizes the GCC attribute 'nonnull', which indicates that a
|
||||||
function expects that a given function parameter is not a null pointer. Specific
|
function expects that a given function parameter is not a null pointer. Specific
|
||||||
details of the syntax of using the 'nonnull' attribute can be found in <a
|
details of the syntax of using the 'nonnull' attribute can be found in <a
|
||||||
href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bnonnull_007d-function-attribute-2263">GCC's
|
href="https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-nonnull-function-attribute">GCC's
|
||||||
documentation</a>.</p>
|
documentation</a>.</p>
|
||||||
|
|
||||||
<p>Both the Clang compiler and GCC will flag warnings for simple cases where a
|
<p>Both the Clang compiler and GCC will flag warnings for simple cases where a
|
||||||
@ -108,7 +108,7 @@ parameter.</p>
|
|||||||
int bar(int*p, int q, int *r) __attribute__((nonnull(1,3)));
|
int bar(int*p, int q, int *r) __attribute__((nonnull(1,3)));
|
||||||
|
|
||||||
int foo(int *p, int *q) {
|
int foo(int *p, int *q) {
|
||||||
return !p ? bar(q, 2, p)
|
return !p ? bar(q, 2, p)
|
||||||
: bar(p, 2, q);
|
: bar(p, 2, q);
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
@ -138,8 +138,8 @@ conventions can cause the analyzer to miss bugs or flag false positives.</p>
|
|||||||
<p>One can educate the analyzer (and others who read your code) about methods or
|
<p>One can educate the analyzer (and others who read your code) about methods or
|
||||||
functions that deviate from the Cocoa and Core Foundation conventions using the
|
functions that deviate from the Cocoa and Core Foundation conventions using the
|
||||||
attributes described here. However, you should consider using proper naming
|
attributes described here. However, you should consider using proper naming
|
||||||
conventions or the <a
|
conventions or the <a
|
||||||
href="http://clang.llvm.org/docs/LanguageExtensions.html#the-objc-method-family-attribute"><tt>objc_method_family</tt></a>
|
href="https://clang.llvm.org/docs/LanguageExtensions.html#the-objc-method-family-attribute"><tt>objc_method_family</tt></a>
|
||||||
attribute, if applicable.</p>
|
attribute, if applicable.</p>
|
||||||
|
|
||||||
<h4 id="attr_ns_returns_retained">Attribute 'ns_returns_retained'
|
<h4 id="attr_ns_returns_retained">Attribute 'ns_returns_retained'
|
||||||
@ -236,7 +236,7 @@ its availability, as it is not available in earlier versions of the analyzer:</p
|
|||||||
|
|
||||||
<p>The GCC-style (Clang-specific) attribute 'cf_returns_retained' allows one to
|
<p>The GCC-style (Clang-specific) attribute 'cf_returns_retained' allows one to
|
||||||
annotate an Objective-C method or C function as returning a retained Core
|
annotate an Objective-C method or C function as returning a retained Core
|
||||||
Foundation object that the caller is responsible for releasing. The
|
Foundation object that the caller is responsible for releasing. The
|
||||||
CoreFoundation framework defines a macro <b><tt>CF_RETURNS_RETAINED</tt></b>
|
CoreFoundation framework defines a macro <b><tt>CF_RETURNS_RETAINED</tt></b>
|
||||||
that is functionally equivalent to the one shown below.</p>
|
that is functionally equivalent to the one shown below.</p>
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ href="#attr_cf_returns_retained">cf_returns_retained</a>'. Where a function or
|
|||||||
method may appear to obey the Core Foundation or Cocoa conventions and return
|
method may appear to obey the Core Foundation or Cocoa conventions and return
|
||||||
a retained Core Foundation object, this attribute can be used to indicate that
|
a retained Core Foundation object, this attribute can be used to indicate that
|
||||||
the object reference returned should not be considered as an
|
the object reference returned should not be considered as an
|
||||||
"owning" reference being returned to the caller. The
|
"owning" reference being returned to the caller. The
|
||||||
CoreFoundation framework defines a macro <b><tt>CF_RETURNS_NOT_RETAINED</tt></b>
|
CoreFoundation framework defines a macro <b><tt>CF_RETURNS_NOT_RETAINED</tt></b>
|
||||||
that is functionally equivalent to the one shown below.</p>
|
that is functionally equivalent to the one shown below.</p>
|
||||||
|
|
||||||
@ -353,8 +353,8 @@ its availability, as it is not available in earlier versions of the analyzer:</p
|
|||||||
<p>The 'ns_consumed' attribute can be placed on a specific parameter in either
|
<p>The 'ns_consumed' attribute can be placed on a specific parameter in either
|
||||||
the declaration of a function or an Objective-C method. It indicates to the
|
the declaration of a function or an Objective-C method. It indicates to the
|
||||||
static analyzer that a <tt>release</tt> message is implicitly sent to the
|
static analyzer that a <tt>release</tt> message is implicitly sent to the
|
||||||
parameter upon completion of the call to the given function or method. The
|
parameter upon completion of the call to the given function or method. The
|
||||||
Foundation framework defines a macro <b><tt>NS_RELEASES_ARGUMENT</tt></b> that
|
Foundation framework defines a macro <b><tt>NS_RELEASES_ARGUMENT</tt></b> that
|
||||||
is functionally equivalent to the <tt>NS_CONSUMED</tt> macro shown below.</p>
|
is functionally equivalent to the <tt>NS_CONSUMED</tt> macro shown below.</p>
|
||||||
|
|
||||||
<p><b>Example</b></p>
|
<p><b>Example</b></p>
|
||||||
@ -408,7 +408,7 @@ implicitly passed to a call to <tt>CFRelease</tt> upon completion of the call
|
|||||||
to the given function or method. The CoreFoundation framework defines a macro
|
to the given function or method. The CoreFoundation framework defines a macro
|
||||||
<b><tt>CF_RELEASES_ARGUMENT</tt></b> that is functionally equivalent to the
|
<b><tt>CF_RELEASES_ARGUMENT</tt></b> that is functionally equivalent to the
|
||||||
<tt>CF_CONSUMED</tt> macro shown below.</p>
|
<tt>CF_CONSUMED</tt> macro shown below.</p>
|
||||||
|
|
||||||
<p>Operationally this attribute is nearly identical to 'ns_consumed'.</p>
|
<p>Operationally this attribute is nearly identical to 'ns_consumed'.</p>
|
||||||
|
|
||||||
<p><b>Example</b></p>
|
<p><b>Example</b></p>
|
||||||
@ -438,7 +438,7 @@ void test() {
|
|||||||
void test2() {
|
void test2() {
|
||||||
CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent());
|
CFDateRef date = CFDateCreate(0, CFAbsoluteTimeGetCurrent());
|
||||||
consume_CFDate(date); <b><i>// No leak, including under GC!</i></b>
|
consume_CFDate(date); <b><i>// No leak, including under GC!</i></b>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface Foo : NSObject
|
@interface Foo : NSObject
|
||||||
@ -463,7 +463,7 @@ is sent. This matches the semantics of all "init" methods.</p>
|
|||||||
follow the standard Cocoa naming conventions.</p>
|
follow the standard Cocoa naming conventions.</p>
|
||||||
|
|
||||||
<p><b>Example</b></p>
|
<p><b>Example</b></p>
|
||||||
|
|
||||||
<pre class="code_example">
|
<pre class="code_example">
|
||||||
#ifndef __has_feature
|
#ifndef __has_feature
|
||||||
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
||||||
@ -573,8 +573,8 @@ class MyClass {
|
|||||||
OSObject *f;
|
OSObject *f;
|
||||||
LIBKERN_RETURNS_NOT_RETAINED OSObject *myFieldGetter();
|
LIBKERN_RETURNS_NOT_RETAINED OSObject *myFieldGetter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Note that the annotation only has to be applied to the function declaration.
|
// Note that the annotation only has to be applied to the function declaration.
|
||||||
OSObject * MyClass::myFieldGetter() {
|
OSObject * MyClass::myFieldGetter() {
|
||||||
return f;
|
return f;
|
||||||
@ -633,7 +633,7 @@ identified using <tt>LIBKERN_RETURNS_RETAINED</tt>:</p>
|
|||||||
void getterViaOutParam(LIBKERN_RETURNS_NOT_RETAINED OSObject **obj)
|
void getterViaOutParam(LIBKERN_RETURNS_NOT_RETAINED OSObject **obj)
|
||||||
</pre>
|
</pre>
|
||||||
<p>
|
<p>
|
||||||
In such cases a retained object is written into an out parameter, which the caller has then to release in order to avoid a leak.
|
In such cases a retained object is written into an out parameter, which the caller has then to release in order to avoid a leak.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>These two cases are simple - but in practice a functions returning an out-parameter usually also return a return code, and then an out parameter may or may not be written, which conditionally depends on the exit code, e.g.:</p>
|
<p>These two cases are simple - but in practice a functions returning an out-parameter usually also return a return code, and then an out parameter may or may not be written, which conditionally depends on the exit code, e.g.:</p>
|
||||||
@ -718,7 +718,7 @@ some action that depends on that condition (e.g., dereferencing a pointer).</p>
|
|||||||
<p>The analyzer knows about several well-known assertion handlers, but can
|
<p>The analyzer knows about several well-known assertion handlers, but can
|
||||||
automatically infer if a function should be treated as an assertion handler if
|
automatically infer if a function should be treated as an assertion handler if
|
||||||
it is annotated with the 'noreturn' attribute or the (Clang-specific)
|
it is annotated with the 'noreturn' attribute or the (Clang-specific)
|
||||||
'analyzer_noreturn' attribute. Note that, currently, clang does not support
|
'analyzer_noreturn' attribute. Note that, currently, clang does not support
|
||||||
these attributes on Objective-C methods and C++ methods.</p>
|
these attributes on Objective-C methods and C++ methods.</p>
|
||||||
|
|
||||||
<h4 id="attr_noreturn">Attribute 'noreturn'</h4>
|
<h4 id="attr_noreturn">Attribute 'noreturn'</h4>
|
||||||
@ -729,7 +729,7 @@ with a 'noreturn' attribute should never return.</p>
|
|||||||
|
|
||||||
<p>Specific details of the syntax of using the 'noreturn' attribute can be found
|
<p>Specific details of the syntax of using the 'noreturn' attribute can be found
|
||||||
in <a
|
in <a
|
||||||
href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bnoreturn_007d-function-attribute-2264">GCC's
|
href="https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute">GCC's
|
||||||
documentation</a>.</p>
|
documentation</a>.</p>
|
||||||
|
|
||||||
<p>Not only does the analyzer exploit this information when pruning false paths,
|
<p>Not only does the analyzer exploit this information when pruning false paths,
|
||||||
|
@ -29,8 +29,8 @@ Experimental (Alpha) Checkers</a>.
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://www.mobileorchard.com/bug-finding-with-clang-5-resources-to-get-you-started/">Bug Finding With Clang: 5 Resources To Get You Started</a></li>
|
<li><a href="http://www.mobileorchard.com/bug-finding-with-clang-5-resources-to-get-you-started/">Bug Finding With Clang: 5 Resources To Get You Started</a></li>
|
||||||
<li><a href="http://fruitstandsoftware.com/blog/index.php/2008/08/finding-memory-leaks-with-the-llvmclang-static-analyzer/#comment-2">Finding Memory Leaks With The LLVM/Clang Static Analyzer</a></li>
|
<li><a href="http://fruitstandsoftware.com/blog/index.php/2008/08/finding-memory-leaks-with-the-llvmclang-static-analyzer/#comment-2">Finding Memory Leaks With The LLVM/Clang Static Analyzer</a></li>
|
||||||
<li><a href="http://www.rogueamoeba.com/utm/2008/07/14/the-clang-static-analyzer/">Under the Microscope - The Clang Static Analyzer</a></li>
|
<li><a href="https://weblog.rogueamoeba.com/2008/07/14/the-clang-static-analyzer/">Under the Microscope - The Clang Static Analyzer</a></li>
|
||||||
<li><a href="http://www.mikeash.com/?page=pyblog/friday-qa-2009-03-06-using-the-clang-static-analyzer.html">Mike Ash - Using the Clang Static Analyzer</a></li>
|
<li><a href="https://www.mikeash.com/pyblog/friday-qa-2009-03-06-using-the-clang-static-analyzer.html">Mike Ash - Using the Clang Static Analyzer</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="default_checkers">Default Checkers</h2>
|
<h2 id="default_checkers">Default Checkers</h2>
|
||||||
|
@ -18,17 +18,17 @@
|
|||||||
|
|
||||||
<h1>Checker Developer Manual</h1>
|
<h1>Checker Developer Manual</h1>
|
||||||
|
|
||||||
<p>The static analyzer engine performs path-sensitive exploration of the program and
|
<p>The static analyzer engine performs path-sensitive exploration of the program and
|
||||||
relies on a set of checkers to implement the logic for detecting and
|
relies on a set of checkers to implement the logic for detecting and
|
||||||
constructing specific bug reports. Anyone who is interested in implementing their own
|
constructing specific bug reports. Anyone who is interested in implementing their own
|
||||||
checker, should check out the Building a Checker in 24 Hours talk
|
checker, should check out the Building a Checker in 24 Hours talk
|
||||||
(<a href="http://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">slides</a>
|
(<a href="https://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">slides</a>
|
||||||
<a href="https://youtu.be/kdxlsP5QVPw">video</a>)
|
<a href="https://youtu.be/kdxlsP5QVPw">video</a>)
|
||||||
and refer to this page for additional information on writing a checker. The static analyzer is a
|
and refer to this page for additional information on writing a checker. The static analyzer is a
|
||||||
part of the Clang project, so consult <a href="http://clang.llvm.org/hacking.html">Hacking on Clang</a>
|
part of the Clang project, so consult <a href="https://clang.llvm.org/hacking.html">Hacking on Clang</a>
|
||||||
and <a href="http://llvm.org/docs/ProgrammersManual.html">LLVM Programmer's Manual</a>
|
and <a href="https://llvm.org/docs/ProgrammersManual.html">LLVM Programmer's Manual</a>
|
||||||
for developer guidelines and send your questions and proposals to
|
for developer guidelines and send your questions and proposals to
|
||||||
<a href=http://lists.llvm.org/mailman/listinfo/cfe-dev>cfe-dev mailing list</a>.
|
<a href=https://lists.llvm.org/mailman/listinfo/cfe-dev>cfe-dev mailing list</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -58,8 +58,8 @@ for developer guidelines and send your questions and proposals to
|
|||||||
|
|
||||||
<h2 id=start>Getting Started</h2>
|
<h2 id=start>Getting Started</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>To check out the source code and build the project, follow steps 1-4 of
|
<li>To check out the source code and build the project, follow steps 1-4 of
|
||||||
the <a href="http://clang.llvm.org/get_started.html">Clang Getting Started</a>
|
the <a href="https://clang.llvm.org/get_started.html">Clang Getting Started</a>
|
||||||
page.</li>
|
page.</li>
|
||||||
|
|
||||||
<li>The analyzer source code is located under the Clang source tree:
|
<li>The analyzer source code is located under the Clang source tree:
|
||||||
@ -69,12 +69,12 @@ for developer guidelines and send your questions and proposals to
|
|||||||
<br>See: <tt>include/clang/StaticAnalyzer</tt>, <tt>lib/StaticAnalyzer</tt>,
|
<br>See: <tt>include/clang/StaticAnalyzer</tt>, <tt>lib/StaticAnalyzer</tt>,
|
||||||
<tt>test/Analysis</tt>.</li>
|
<tt>test/Analysis</tt>.</li>
|
||||||
|
|
||||||
<li>The analyzer regression tests can be executed from the Clang's build
|
<li>The analyzer regression tests can be executed from the Clang's build
|
||||||
directory:
|
directory:
|
||||||
<br><tt>
|
<br><tt>
|
||||||
$ <b>cd ../../../; cd build/tools/clang; TESTDIRS=Analysis make test</b>
|
$ <b>cd ../../../; cd build/tools/clang; TESTDIRS=Analysis make test</b>
|
||||||
</tt></li>
|
</tt></li>
|
||||||
|
|
||||||
<li>Analyze a file with the specified checker:
|
<li>Analyze a file with the specified checker:
|
||||||
<br><tt>
|
<br><tt>
|
||||||
$ <b>clang -cc1 -analyze -analyzer-checker=core.DivideZero test.c</b>
|
$ <b>clang -cc1 -analyze -analyzer-checker=core.DivideZero test.c</b>
|
||||||
@ -85,99 +85,99 @@ for developer guidelines and send your questions and proposals to
|
|||||||
$ <b>clang -cc1 -analyzer-checker-help</b>
|
$ <b>clang -cc1 -analyzer-checker-help</b>
|
||||||
</tt></li>
|
</tt></li>
|
||||||
|
|
||||||
<li>See the analyzer help for different output formats, fine tuning, and
|
<li>See the analyzer help for different output formats, fine tuning, and
|
||||||
debug options:
|
debug options:
|
||||||
<br><tt>
|
<br><tt>
|
||||||
$ <b>clang -cc1 -help | grep "analyzer"</b>
|
$ <b>clang -cc1 -help | grep "analyzer"</b>
|
||||||
</tt></li>
|
</tt></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id=analyzer>Static Analyzer Overview</h2>
|
<h2 id=analyzer>Static Analyzer Overview</h2>
|
||||||
The analyzer core performs symbolic execution of the given program. All the
|
The analyzer core performs symbolic execution of the given program. All the
|
||||||
input values are represented with symbolic values; further, the engine deduces
|
input values are represented with symbolic values; further, the engine deduces
|
||||||
the values of all the expressions in the program based on the input symbols
|
the values of all the expressions in the program based on the input symbols
|
||||||
and the path. The execution is path sensitive and every possible path through
|
and the path. The execution is path sensitive and every possible path through
|
||||||
the program is explored. The explored execution traces are represented with
|
the program is explored. The explored execution traces are represented with
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1ExplodedGraph.html">ExplodedGraph</a> object.
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1ExplodedGraph.html">ExplodedGraph</a> object.
|
||||||
Each node of the graph is
|
Each node of the graph is
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1ExplodedNode.html">ExplodedNode</a>,
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1ExplodedNode.html">ExplodedNode</a>,
|
||||||
which consists of a <tt>ProgramPoint</tt> and a <tt>ProgramState</tt>.
|
which consists of a <tt>ProgramPoint</tt> and a <tt>ProgramState</tt>.
|
||||||
<p>
|
<p>
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ProgramPoint.html">ProgramPoint</a>
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ProgramPoint.html">ProgramPoint</a>
|
||||||
represents the corresponding location in the program (or the CFG).
|
represents the corresponding location in the program (or the CFG).
|
||||||
<tt>ProgramPoint</tt> is also used to record additional information on
|
<tt>ProgramPoint</tt> is also used to record additional information on
|
||||||
when/how the state was added. For example, <tt>PostPurgeDeadSymbolsKind</tt>
|
when/how the state was added. For example, <tt>PostPurgeDeadSymbolsKind</tt>
|
||||||
kind means that the state is the result of purging dead symbols - the
|
kind means that the state is the result of purging dead symbols - the
|
||||||
analyzer's equivalent of garbage collection.
|
analyzer's equivalent of garbage collection.
|
||||||
<p>
|
<p>
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1ProgramState.html">ProgramState</a>
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1ProgramState.html">ProgramState</a>
|
||||||
represents abstract state of the program. It consists of:
|
represents abstract state of the program. It consists of:
|
||||||
<ul>
|
<ul>
|
||||||
<li><tt>Environment</tt> - a mapping from source code expressions to symbolic
|
<li><tt>Environment</tt> - a mapping from source code expressions to symbolic
|
||||||
values
|
values
|
||||||
<li><tt>Store</tt> - a mapping from memory locations to symbolic values
|
<li><tt>Store</tt> - a mapping from memory locations to symbolic values
|
||||||
<li><tt>GenericDataMap</tt> - constraints on symbolic values
|
<li><tt>GenericDataMap</tt> - constraints on symbolic values
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3 id=interaction>Interaction with Checkers</h3>
|
<h3 id=interaction>Interaction with Checkers</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Checkers are not merely passive receivers of the analyzer core changes - they
|
Checkers are not merely passive receivers of the analyzer core changes - they
|
||||||
actively participate in the <tt>ProgramState</tt> construction through the
|
actively participate in the <tt>ProgramState</tt> construction through the
|
||||||
<tt>GenericDataMap</tt> which can be used to store the checker-defined part
|
<tt>GenericDataMap</tt> which can be used to store the checker-defined part
|
||||||
of the state. Each time the analyzer engine explores a new statement, it
|
of the state. Each time the analyzer engine explores a new statement, it
|
||||||
notifies each checker registered to listen for that statement, giving it an
|
notifies each checker registered to listen for that statement, giving it an
|
||||||
opportunity to either report a bug or modify the state. (As a rule of thumb,
|
opportunity to either report a bug or modify the state. (As a rule of thumb,
|
||||||
the checker itself should be stateless.) The checkers are called one after another
|
the checker itself should be stateless.) The checkers are called one after another
|
||||||
in the predefined order; thus, calling all the checkers adds a chain to the
|
in the predefined order; thus, calling all the checkers adds a chain to the
|
||||||
<tt>ExplodedGraph</tt>.
|
<tt>ExplodedGraph</tt>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h3 id=values>Representing Values</h3>
|
<h3 id=values>Representing Values</h3>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
During symbolic execution, <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1SVal.html">SVal</a>
|
During symbolic execution, <a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1SVal.html">SVal</a>
|
||||||
objects are used to represent the semantic evaluation of expressions.
|
objects are used to represent the semantic evaluation of expressions.
|
||||||
They can represent things like concrete
|
They can represent things like concrete
|
||||||
integers, symbolic values, or memory locations (which are memory regions).
|
integers, symbolic values, or memory locations (which are memory regions).
|
||||||
They are a discriminated union of "values", symbolic and otherwise.
|
They are a discriminated union of "values", symbolic and otherwise.
|
||||||
If a value isn't symbolic, usually that means there is no symbolic
|
If a value isn't symbolic, usually that means there is no symbolic
|
||||||
information to track. For example, if the value was an integer, such as
|
information to track. For example, if the value was an integer, such as
|
||||||
<tt>42</tt>, it would be a <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1nonloc_1_1ConcreteInt.html">ConcreteInt</a>,
|
<tt>42</tt>, it would be a <a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1nonloc_1_1ConcreteInt.html">ConcreteInt</a>,
|
||||||
and the checker doesn't usually need to track any state with the concrete
|
and the checker doesn't usually need to track any state with the concrete
|
||||||
number. In some cases, <tt>SVal</tt> is not a symbol, but it really should be
|
number. In some cases, <tt>SVal</tt> is not a symbol, but it really should be
|
||||||
a symbolic value. This happens when the analyzer cannot reason about something
|
a symbolic value. This happens when the analyzer cannot reason about something
|
||||||
(yet). An example is floating point numbers. In such cases, the
|
(yet). An example is floating point numbers. In such cases, the
|
||||||
<tt>SVal</tt> will evaluate to <a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1UnknownVal.html">UnknownVal</a>.
|
<tt>SVal</tt> will evaluate to <a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1UnknownVal.html">UnknownVal</a>.
|
||||||
This represents a case that is outside the realm of the analyzer's reasoning
|
This represents a case that is outside the realm of the analyzer's reasoning
|
||||||
capabilities. <tt>SVals</tt> are value objects and their values can be viewed
|
capabilities. <tt>SVals</tt> are value objects and their values can be viewed
|
||||||
using the <tt>.dump()</tt> method. Often they wrap persistent objects such as
|
using the <tt>.dump()</tt> method. Often they wrap persistent objects such as
|
||||||
symbols or regions.
|
symbols or regions.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1SymExpr.html">SymExpr</a> (symbol)
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1SymExpr.html">SymExpr</a> (symbol)
|
||||||
is meant to represent abstract, but named, symbolic value. Symbols represent
|
is meant to represent abstract, but named, symbolic value. Symbols represent
|
||||||
an actual (immutable) value. We might not know what its specific value is, but
|
an actual (immutable) value. We might not know what its specific value is, but
|
||||||
we can associate constraints with that value as we analyze a path. For
|
we can associate constraints with that value as we analyze a path. For
|
||||||
example, we might record that the value of a symbol is greater than
|
example, we might record that the value of a symbol is greater than
|
||||||
<tt>0</tt>, etc.
|
<tt>0</tt>, etc.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1MemRegion.html">MemRegion</a> is similar to a symbol.
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1MemRegion.html">MemRegion</a> is similar to a symbol.
|
||||||
It is used to provide a lexicon of how to describe abstract memory. Regions can
|
It is used to provide a lexicon of how to describe abstract memory. Regions can
|
||||||
layer on top of other regions, providing a layered approach to representing memory.
|
layer on top of other regions, providing a layered approach to representing memory.
|
||||||
For example, a struct object on the stack might be represented by a <tt>VarRegion</tt>,
|
For example, a struct object on the stack might be represented by a <tt>VarRegion</tt>,
|
||||||
but a <tt>FieldRegion</tt> which is a subregion of the <tt>VarRegion</tt> could
|
but a <tt>FieldRegion</tt> which is a subregion of the <tt>VarRegion</tt> could
|
||||||
be used to represent the memory associated with a specific field of that object.
|
be used to represent the memory associated with a specific field of that object.
|
||||||
So how do we represent symbolic memory regions? That's what
|
So how do we represent symbolic memory regions? That's what
|
||||||
<a href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1SymbolicRegion.html">SymbolicRegion</a>
|
<a href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1SymbolicRegion.html">SymbolicRegion</a>
|
||||||
is for. It is a <tt>MemRegion</tt> that has an associated symbol. Since the
|
is for. It is a <tt>MemRegion</tt> that has an associated symbol. Since the
|
||||||
symbol is unique and has a unique name; that symbol names the region.
|
symbol is unique and has a unique name; that symbol names the region.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Let's see how the analyzer processes the expressions in the following example:
|
Let's see how the analyzer processes the expressions in the following example:
|
||||||
</p>
|
</p>
|
||||||
@ -193,60 +193,60 @@ for developer guidelines and send your questions and proposals to
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Let's look at how <tt>x*2</tt> gets evaluated. When <tt>x</tt> is evaluated,
|
Let's look at how <tt>x*2</tt> gets evaluated. When <tt>x</tt> is evaluated,
|
||||||
we first construct an <tt>SVal</tt> that represents the lvalue of <tt>x</tt>, in
|
we first construct an <tt>SVal</tt> that represents the lvalue of <tt>x</tt>, in
|
||||||
this case it is an <tt>SVal</tt> that references the <tt>MemRegion</tt> for <tt>x</tt>.
|
this case it is an <tt>SVal</tt> that references the <tt>MemRegion</tt> for <tt>x</tt>.
|
||||||
Afterwards, when we do the lvalue-to-rvalue conversion, we get a new <tt>SVal</tt>,
|
Afterwards, when we do the lvalue-to-rvalue conversion, we get a new <tt>SVal</tt>,
|
||||||
which references the value <b>currently bound</b> to <tt>x</tt>. That value is
|
which references the value <b>currently bound</b> to <tt>x</tt>. That value is
|
||||||
symbolic; it's whatever <tt>x</tt> was bound to at the start of the function.
|
symbolic; it's whatever <tt>x</tt> was bound to at the start of the function.
|
||||||
Let's call that symbol <tt>$0</tt>. Similarly, we evaluate the expression for <tt>2</tt>,
|
Let's call that symbol <tt>$0</tt>. Similarly, we evaluate the expression for <tt>2</tt>,
|
||||||
and get an <tt>SVal</tt> that references the concrete number <tt>2</tt>. When
|
and get an <tt>SVal</tt> that references the concrete number <tt>2</tt>. When
|
||||||
we evaluate <tt>x*2</tt>, we take the two <tt>SVals</tt> of the subexpressions,
|
we evaluate <tt>x*2</tt>, we take the two <tt>SVals</tt> of the subexpressions,
|
||||||
and create a new <tt>SVal</tt> that represents their multiplication (which in
|
and create a new <tt>SVal</tt> that represents their multiplication (which in
|
||||||
this case is a new symbolic expression, which we might call <tt>$1</tt>). When we
|
this case is a new symbolic expression, which we might call <tt>$1</tt>). When we
|
||||||
evaluate the assignment to <tt>y</tt>, we again compute its lvalue (a <tt>MemRegion</tt>),
|
evaluate the assignment to <tt>y</tt>, we again compute its lvalue (a <tt>MemRegion</tt>),
|
||||||
and then bind the <tt>SVal</tt> for the RHS (which references the symbolic value <tt>$1</tt>)
|
and then bind the <tt>SVal</tt> for the RHS (which references the symbolic value <tt>$1</tt>)
|
||||||
to the <tt>MemRegion</tt> in the symbolic store.
|
to the <tt>MemRegion</tt> in the symbolic store.
|
||||||
<br>
|
<br>
|
||||||
The second line is similar. When we evaluate <tt>x</tt> again, we do the same
|
The second line is similar. When we evaluate <tt>x</tt> again, we do the same
|
||||||
dance, and create an <tt>SVal</tt> that references the symbol <tt>$0</tt>. Note, two <tt>SVals</tt>
|
dance, and create an <tt>SVal</tt> that references the symbol <tt>$0</tt>. Note, two <tt>SVals</tt>
|
||||||
might reference the same underlying values.
|
might reference the same underlying values.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To summarize, MemRegions are unique names for blocks of memory. Symbols are
|
To summarize, MemRegions are unique names for blocks of memory. Symbols are
|
||||||
unique names for abstract symbolic values. Some MemRegions represents abstract
|
unique names for abstract symbolic values. Some MemRegions represents abstract
|
||||||
symbolic chunks of memory, and thus are also based on symbols. SVals are just
|
symbolic chunks of memory, and thus are also based on symbols. SVals are just
|
||||||
references to values, and can reference either MemRegions, Symbols, or concrete
|
references to values, and can reference either MemRegions, Symbols, or concrete
|
||||||
values (e.g., the number 1).
|
values (e.g., the number 1).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
TODO: Add a picture.
|
TODO: Add a picture.
|
||||||
<br>
|
<br>
|
||||||
Symbols<br>
|
Symbols<br>
|
||||||
FunctionalObjects are used throughout.
|
FunctionalObjects are used throughout.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<h2 id=idea>Idea for a Checker</h2>
|
<h2 id=idea>Idea for a Checker</h2>
|
||||||
Here are several questions which you should consider when evaluating your
|
Here are several questions which you should consider when evaluating your
|
||||||
checker idea:
|
checker idea:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Can the check be effectively implemented without path-sensitive
|
<li>Can the check be effectively implemented without path-sensitive
|
||||||
analysis? See <a href="#ast">AST Visitors</a>.</li>
|
analysis? See <a href="#ast">AST Visitors</a>.</li>
|
||||||
|
|
||||||
<li>How high the false positive rate is going to be? Looking at the occurrences
|
<li>How high the false positive rate is going to be? Looking at the occurrences
|
||||||
of the issue you want to write a checker for in the existing code bases might
|
of the issue you want to write a checker for in the existing code bases might
|
||||||
give you some ideas. </li>
|
give you some ideas. </li>
|
||||||
|
|
||||||
<li>How the current limitations of the analysis will effect the false alarm
|
<li>How the current limitations of the analysis will effect the false alarm
|
||||||
rate? Currently, the analyzer only reasons about one procedure at a time (no
|
rate? Currently, the analyzer only reasons about one procedure at a time (no
|
||||||
inter-procedural analysis). Also, it uses a simple range tracking based
|
inter-procedural analysis). Also, it uses a simple range tracking based
|
||||||
solver to model symbolic execution.</li>
|
solver to model symbolic execution.</li>
|
||||||
|
|
||||||
<li>Consult the <a
|
<li>Consult the <a
|
||||||
href="http://llvm.org/bugs/buglist.cgi?query_format=advanced&bug_status=NEW&bug_status=REOPENED&version=trunk&component=Static%20Analyzer&product=clang">Bugzilla database</a>
|
href="https://bugs.llvm.org/buglist.cgi?query_format=advanced&bug_status=NEW&bug_status=REOPENED&version=trunk&component=Static%20Analyzer&product=clang">Bugzilla database</a>
|
||||||
to get some ideas for new checkers and consider starting with improving/fixing
|
to get some ideas for new checkers and consider starting with improving/fixing
|
||||||
bugs in the existing checkers.</li>
|
bugs in the existing checkers.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ need to be made:
|
|||||||
<h2 id=registration>Checker Registration</h2>
|
<h2 id=registration>Checker Registration</h2>
|
||||||
All checker implementation files are located in
|
All checker implementation files are located in
|
||||||
<tt>clang/lib/StaticAnalyzer/Checkers</tt> folder. The steps below describe
|
<tt>clang/lib/StaticAnalyzer/Checkers</tt> folder. The steps below describe
|
||||||
how the checker <tt>SimpleStreamChecker</tt>, which checks for misuses of
|
how the checker <tt>SimpleStreamChecker</tt>, which checks for misuses of
|
||||||
stream APIs, was registered with the analyzer.
|
stream APIs, was registered with the analyzer.
|
||||||
Similar steps should be followed for a new checker.
|
Similar steps should be followed for a new checker.
|
||||||
<ol>
|
<ol>
|
||||||
@ -305,16 +305,16 @@ was successfully added by seeing if it appears in the list of available checkers
|
|||||||
<h2 id=events_callbacks>Events, Callbacks, and Checker Class Structure</h2>
|
<h2 id=events_callbacks>Events, Callbacks, and Checker Class Structure</h2>
|
||||||
|
|
||||||
<p> All checkers inherit from the <tt><a
|
<p> All checkers inherit from the <tt><a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1Checker.html">
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1Checker.html">
|
||||||
Checker</a></tt> template class; the template parameter(s) describe the type of
|
Checker</a></tt> template class; the template parameter(s) describe the type of
|
||||||
events that the checker is interested in processing. The various types of events
|
events that the checker is interested in processing. The various types of events
|
||||||
that are available are described in the file <a
|
that are available are described in the file <a
|
||||||
href="http://clang.llvm.org/doxygen/CheckerDocumentation_8cpp_source.html">
|
href="https://clang.llvm.org/doxygen/CheckerDocumentation_8cpp_source.html">
|
||||||
CheckerDocumentation.cpp</a>
|
CheckerDocumentation.cpp</a>
|
||||||
|
|
||||||
<p> For each event type requested, a corresponding callback function must be
|
<p> For each event type requested, a corresponding callback function must be
|
||||||
defined in the checker class (<a
|
defined in the checker class (<a
|
||||||
href="http://clang.llvm.org/doxygen/CheckerDocumentation_8cpp_source.html">
|
href="https://clang.llvm.org/doxygen/CheckerDocumentation_8cpp_source.html">
|
||||||
CheckerDocumentation.cpp</a> shows the
|
CheckerDocumentation.cpp</a> shows the
|
||||||
correct function name and signature for each event type).
|
correct function name and signature for each event type).
|
||||||
|
|
||||||
@ -335,13 +335,13 @@ the analyzer cannot be sure whether the file was closed or not.
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>These events that will be used for each of these actions are, respectively, <a
|
<p>These events that will be used for each of these actions are, respectively, <a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1PreCall.html">PreCall</a>,
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1PreCall.html">PreCall</a>,
|
||||||
<a
|
<a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1PostCall.html">PostCall</a>,
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1PostCall.html">PostCall</a>,
|
||||||
<a
|
<a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1DeadSymbols.html">DeadSymbols</a>,
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1DeadSymbols.html">DeadSymbols</a>,
|
||||||
and <a
|
and <a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1PointerEscape.html">PointerEscape</a>.
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1check_1_1PointerEscape.html">PointerEscape</a>.
|
||||||
The high-level structure of the checker's class is thus:
|
The high-level structure of the checker's class is thus:
|
||||||
|
|
||||||
<pre class="code_example">
|
<pre class="code_example">
|
||||||
@ -376,22 +376,22 @@ several macros designed for this purpose. They are:
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a
|
<li><a
|
||||||
href="http://clang.llvm.org/doxygen/ProgramStateTrait_8h.html#ae4cddb54383cd702a045d7c61b009147">REGISTER_TRAIT_WITH_PROGRAMSTATE</a>:
|
href="https://clang.llvm.org/doxygen/ProgramStateTrait_8h.html#ae4cddb54383cd702a045d7c61b009147">REGISTER_TRAIT_WITH_PROGRAMSTATE</a>:
|
||||||
Used when the state information is a single value. The methods available for
|
Used when the state information is a single value. The methods available for
|
||||||
state types declared with this macro are <tt>get</tt>, <tt>set</tt>, and
|
state types declared with this macro are <tt>get</tt>, <tt>set</tt>, and
|
||||||
<tt>remove</tt>.
|
<tt>remove</tt>.
|
||||||
<li><a
|
<li><a
|
||||||
href="http://clang.llvm.org/doxygen/CheckerContext_8h.html#aa27656fa0ce65b0d9ba12eb3c02e8be9">REGISTER_LIST_WITH_PROGRAMSTATE</a>:
|
href="https://clang.llvm.org/doxygen/CheckerContext_8h.html#aa27656fa0ce65b0d9ba12eb3c02e8be9">REGISTER_LIST_WITH_PROGRAMSTATE</a>:
|
||||||
Used when the state information is a list of values. The methods available for
|
Used when the state information is a list of values. The methods available for
|
||||||
state types declared with this macro are <tt>add</tt>, <tt>get</tt>,
|
state types declared with this macro are <tt>add</tt>, <tt>get</tt>,
|
||||||
<tt>remove</tt>, and <tt>contains</tt>.
|
<tt>remove</tt>, and <tt>contains</tt>.
|
||||||
<li><a
|
<li><a
|
||||||
href="http://clang.llvm.org/doxygen/CheckerContext_8h.html#ad90f9387b94b344eaaf499afec05f4d1">REGISTER_SET_WITH_PROGRAMSTATE</a>:
|
href="https://clang.llvm.org/doxygen/CheckerContext_8h.html#ad90f9387b94b344eaaf499afec05f4d1">REGISTER_SET_WITH_PROGRAMSTATE</a>:
|
||||||
Used when the state information is a set of values. The methods available for
|
Used when the state information is a set of values. The methods available for
|
||||||
state types declared with this macro are <tt>add</tt>, <tt>get</tt>,
|
state types declared with this macro are <tt>add</tt>, <tt>get</tt>,
|
||||||
<tt>remove</tt>, and <tt>contains</tt>.
|
<tt>remove</tt>, and <tt>contains</tt>.
|
||||||
<li><a
|
<li><a
|
||||||
href="http://clang.llvm.org/doxygen/CheckerContext_8h.html#a6d1893bb8c18543337b6c363c1319fcf">REGISTER_MAP_WITH_PROGRAMSTATE</a>:
|
href="https://clang.llvm.org/doxygen/CheckerContext_8h.html#a6d1893bb8c18543337b6c363c1319fcf">REGISTER_MAP_WITH_PROGRAMSTATE</a>:
|
||||||
Used when the state information is a map from a key to a value. The methods
|
Used when the state information is a map from a key to a value. The methods
|
||||||
available for state types declared with this macro are <tt>add</tt>,
|
available for state types declared with this macro are <tt>add</tt>,
|
||||||
<tt>set</tt>, <tt>get</tt>, <tt>remove</tt>, and <tt>contains</tt>.
|
<tt>set</tt>, <tt>get</tt>, <tt>remove</tt>, and <tt>contains</tt>.
|
||||||
@ -438,11 +438,11 @@ new data category; the name of this type is the name of the data category with
|
|||||||
"Ty" appended. For <tt>REGISTER_TRAIT_WITH_PROGRAMSTATE</tt>, this will simply
|
"Ty" appended. For <tt>REGISTER_TRAIT_WITH_PROGRAMSTATE</tt>, this will simply
|
||||||
be passed data type; for the other three macros, this will be a specialized
|
be passed data type; for the other three macros, this will be a specialized
|
||||||
version of the <a
|
version of the <a
|
||||||
href="http://llvm.org/doxygen/classllvm_1_1ImmutableList.html">llvm::ImmutableList</a>,
|
href="https://llvm.org/doxygen/classllvm_1_1ImmutableList.html">llvm::ImmutableList</a>,
|
||||||
<a
|
<a
|
||||||
href="http://llvm.org/doxygen/classllvm_1_1ImmutableSet.html">llvm::ImmutableSet</a>,
|
href="https://llvm.org/doxygen/classllvm_1_1ImmutableSet.html">llvm::ImmutableSet</a>,
|
||||||
or <a
|
or <a
|
||||||
href="http://llvm.org/doxygen/classllvm_1_1ImmutableMap.html">llvm::ImmutableMap</a>
|
href="https://llvm.org/doxygen/classllvm_1_1ImmutableMap.html">llvm::ImmutableMap</a>
|
||||||
templated class. For the <tt>ExampleDataType</tt> example above, the type
|
templated class. For the <tt>ExampleDataType</tt> example above, the type
|
||||||
created would be equivalent to writing the declaration:
|
created would be equivalent to writing the declaration:
|
||||||
|
|
||||||
@ -465,9 +465,9 @@ analyzer core by calling the <tt>CheckerContext::addTransition</tt> function.
|
|||||||
<p> When a checker detects a mistake in the analyzed code, it needs a way to
|
<p> When a checker detects a mistake in the analyzed code, it needs a way to
|
||||||
report it to the analyzer core so that it can be displayed. The two classes used
|
report it to the analyzer core so that it can be displayed. The two classes used
|
||||||
to construct this report are <tt><a
|
to construct this report are <tt><a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1BugType.html">BugType</a></tt>
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1BugType.html">BugType</a></tt>
|
||||||
and <tt><a
|
and <tt><a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1BugReport.html">
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1BugReport.html">
|
||||||
BugReport</a></tt>.
|
BugReport</a></tt>.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -496,39 +496,39 @@ analysis, as the program can continue to run after the leak. Dereferencing a
|
|||||||
null pointer, on the other hand, should stop analysis, as there is no way for
|
null pointer, on the other hand, should stop analysis, as there is no way for
|
||||||
the program to meaningfully continue after such an error.
|
the program to meaningfully continue after such an error.
|
||||||
|
|
||||||
<p>If analysis can continue, then the most recent <tt>ExplodedNode</tt>
|
<p>If analysis can continue, then the most recent <tt>ExplodedNode</tt>
|
||||||
generated by the checker can be passed to the <tt>BugReport</tt> constructor
|
generated by the checker can be passed to the <tt>BugReport</tt> constructor
|
||||||
without additional modification. This <tt>ExplodedNode</tt> will be the one
|
without additional modification. This <tt>ExplodedNode</tt> will be the one
|
||||||
returned by the most recent call to <a
|
returned by the most recent call to <a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#a264f48d97809707049689c37aa35af78">CheckerContext::addTransition</a>.
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#a264f48d97809707049689c37aa35af78">CheckerContext::addTransition</a>.
|
||||||
If no transition has been performed during the current callback, the checker should call <a
|
If no transition has been performed during the current callback, the checker should call <a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#a264f48d97809707049689c37aa35af78">CheckerContext::addTransition()</a>
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#a264f48d97809707049689c37aa35af78">CheckerContext::addTransition()</a>
|
||||||
and use the returned node for bug reporting.
|
and use the returned node for bug reporting.
|
||||||
|
|
||||||
<p>If analysis can not continue, then the current state should be transitioned
|
<p>If analysis can not continue, then the current state should be transitioned
|
||||||
into a so-called <i>sink node</i>, a node from which no further analysis will be
|
into a so-called <i>sink node</i>, a node from which no further analysis will be
|
||||||
performed. This is done by calling the <a
|
performed. This is done by calling the <a
|
||||||
href="http://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#adeea33a5a2bed190210c4a2bb807a6f0">
|
href="https://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#adeea33a5a2bed190210c4a2bb807a6f0">
|
||||||
CheckerContext::generateSink</a> function; this function is the same as the
|
CheckerContext::generateSink</a> function; this function is the same as the
|
||||||
<tt>addTransition</tt> function, but marks the state as a sink node. Like
|
<tt>addTransition</tt> function, but marks the state as a sink node. Like
|
||||||
<tt>addTransition</tt>, this returns an <tt>ExplodedNode</tt> with the updated
|
<tt>addTransition</tt>, this returns an <tt>ExplodedNode</tt> with the updated
|
||||||
state, which can then be passed to the <tt>BugReport</tt> constructor.
|
state, which can then be passed to the <tt>BugReport</tt> constructor.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
After a <tt>BugReport</tt> is created, it should be passed to the analyzer core
|
After a <tt>BugReport</tt> is created, it should be passed to the analyzer core
|
||||||
by calling <a href = "http://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#ae7738af2cbfd1d713edec33d3203dff5">CheckerContext::emitReport</a>.
|
by calling <a href = "https://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerContext.html#ae7738af2cbfd1d713edec33d3203dff5">CheckerContext::emitReport</a>.
|
||||||
|
|
||||||
<h2 id=ast>AST Visitors</h2>
|
<h2 id=ast>AST Visitors</h2>
|
||||||
Some checks might not require path-sensitivity to be effective. Simple AST walk
|
Some checks might not require path-sensitivity to be effective. Simple AST walk
|
||||||
might be sufficient. If that is the case, consider implementing a Clang
|
might be sufficient. If that is the case, consider implementing a Clang
|
||||||
compiler warning. On the other hand, a check might not be acceptable as a compiler
|
compiler warning. On the other hand, a check might not be acceptable as a compiler
|
||||||
warning; for example, because of a relatively high false positive rate. In this
|
warning; for example, because of a relatively high false positive rate. In this
|
||||||
situation, AST callbacks <tt><b>checkASTDecl</b></tt> and
|
situation, AST callbacks <tt><b>checkASTDecl</b></tt> and
|
||||||
<tt><b>checkASTCodeBody</b></tt> are your best friends.
|
<tt><b>checkASTCodeBody</b></tt> are your best friends.
|
||||||
|
|
||||||
<h2 id=testing>Testing</h2>
|
<h2 id=testing>Testing</h2>
|
||||||
Every patch should be well tested with Clang regression tests. The checker tests
|
Every patch should be well tested with Clang regression tests. The checker tests
|
||||||
live in <tt>clang/test/Analysis</tt> folder. To run all of the analyzer tests,
|
live in <tt>clang/test/Analysis</tt> folder. To run all of the analyzer tests,
|
||||||
execute the following from the <tt>clang</tt> build directory:
|
execute the following from the <tt>clang</tt> build directory:
|
||||||
<pre class="code">
|
<pre class="code">
|
||||||
$ <b>bin/llvm-lit -sv ../llvm/tools/clang/test/Analysis</b>
|
$ <b>bin/llvm-lit -sv ../llvm/tools/clang/test/Analysis</b>
|
||||||
@ -796,9 +796,9 @@ Documentation for how the Store works</a></li>
|
|||||||
<li><a href="https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/IPA.txt">
|
<li><a href="https://github.com/llvm/llvm-project/blob/master/clang/docs/analyzer/IPA.txt">
|
||||||
Documentation about inlining</a></li>
|
Documentation about inlining</a></li>
|
||||||
<li> The "Building a Checker in 24 hours" presentation given at the <a
|
<li> The "Building a Checker in 24 hours" presentation given at the <a
|
||||||
href="http://llvm.org/devmtg/2012-11">November 2012 LLVM Developer's
|
href="https://llvm.org/devmtg/2012-11">November 2012 LLVM Developer's
|
||||||
meeting</a>. Describes the construction of SimpleStreamChecker. <a
|
meeting</a>. Describes the construction of SimpleStreamChecker. <a
|
||||||
href="http://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">Slides</a>
|
href="https://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">Slides</a>
|
||||||
and <a
|
and <a
|
||||||
href="https://youtu.be/kdxlsP5QVPw">video</a>
|
href="https://youtu.be/kdxlsP5QVPw">video</a>
|
||||||
are available.</li>
|
are available.</li>
|
||||||
@ -807,15 +807,15 @@ are available.</li>
|
|||||||
Artem Degrachev: Clang Static Analyzer: A Checker Developer's Guide
|
Artem Degrachev: Clang Static Analyzer: A Checker Developer's Guide
|
||||||
</a> (reading the previous items first might be a good idea)</li>
|
</a> (reading the previous items first might be a good idea)</li>
|
||||||
<li>The list of <a href="implicit_checks.html">Implicit Checkers</a></li>
|
<li>The list of <a href="implicit_checks.html">Implicit Checkers</a></li>
|
||||||
<li> <a href="http://clang.llvm.org/doxygen">Clang doxygen</a>. Contains
|
<li> <a href="https://clang.llvm.org/doxygen">Clang doxygen</a>. Contains
|
||||||
up-to-date documentation about the APIs available in Clang. Relevant entries
|
up-to-date documentation about the APIs available in Clang. Relevant entries
|
||||||
have been linked throughout this page. Also of use is the
|
have been linked throughout this page. Also of use is the
|
||||||
<a href="http://llvm.org/doxygen">LLVM doxygen</a>, when dealing with classes
|
<a href="https://llvm.org/doxygen">LLVM doxygen</a>, when dealing with classes
|
||||||
from LLVM.</li>
|
from LLVM.</li>
|
||||||
<li> The <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">
|
<li> The <a href="https://lists.llvm.org/mailman/listinfo/cfe-dev">
|
||||||
cfe-dev mailing list</a>. This is the primary mailing list used for
|
cfe-dev mailing list</a>. This is the primary mailing list used for
|
||||||
discussion of Clang development (including static code analysis). The
|
discussion of Clang development (including static code analysis). The
|
||||||
<a href="http://lists.llvm.org/pipermail/cfe-dev">archive</a> also contains
|
<a href="https://lists.llvm.org/pipermail/cfe-dev">archive</a> also contains
|
||||||
a lot of information.</li>
|
a lot of information.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -173,13 +173,13 @@ Note that this cast does not affect code generation.
|
|||||||
|
|
||||||
<img src="images/example_use_assert.png" alt="example use assert">
|
<img src="images/example_use_assert.png" alt="example use assert">
|
||||||
|
|
||||||
<p> In the contrived example above, the analyzer has detected that the body of
|
<p> In the contrived example above, the analyzer has detected that the body of
|
||||||
the loop is never entered for the case where <tt>length <= 0</tt>. In this
|
the loop is never entered for the case where <tt>length <= 0</tt>. In this
|
||||||
particular example, you may know that the loop will always be entered because
|
particular example, you may know that the loop will always be entered because
|
||||||
the input parameter <tt>length</tt> will be greater than zero in all calls to this
|
the input parameter <tt>length</tt> will be greater than zero in all calls to this
|
||||||
function. You can teach the analyzer facts about your code as well as document
|
function. You can teach the analyzer facts about your code as well as document
|
||||||
it by using assertions. By adding <tt>assert(length > 0)</tt> in the beginning
|
it by using assertions. By adding <tt>assert(length > 0)</tt> in the beginning
|
||||||
of the function, you tell the analyzer that your code is never expecting a zero
|
of the function, you tell the analyzer that your code is never expecting a zero
|
||||||
or a negative value, so it won't need to test the correctness of those paths.
|
or a negative value, so it won't need to test the correctness of those paths.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -198,15 +198,15 @@ int foo(int length) {
|
|||||||
<p>There is currently no solid mechanism for suppressing an analyzer warning,
|
<p>There is currently no solid mechanism for suppressing an analyzer warning,
|
||||||
although this is currently being investigated. When you encounter an analyzer
|
although this is currently being investigated. When you encounter an analyzer
|
||||||
bug/false positive, check if it's one of the issues discussed above or if the
|
bug/false positive, check if it's one of the issues discussed above or if the
|
||||||
analyzer <a href = "annotations.html#custom_assertions" >annotations</a> can
|
analyzer <a href = "annotations.html#custom_assertions" >annotations</a> can
|
||||||
resolve the issue. Second, please <a href = "filing_bugs.html">report it</a> to
|
resolve the issue. Second, please <a href = "filing_bugs.html">report it</a> to
|
||||||
help us improve user experience. As the last resort, consider using <tt>__clang_analyzer__</tt> macro
|
help us improve user experience. As the last resort, consider using <tt>__clang_analyzer__</tt> macro
|
||||||
<a href = "faq.html#exclude_code" >described below</a>.</p>
|
<a href = "faq.html#exclude_code" >described below</a>.</p>
|
||||||
|
|
||||||
<h4 id="exclude_code" class="faq">Q: How can I selectively exclude code the analyzer examines?</h4>
|
<h4 id="exclude_code" class="faq">Q: How can I selectively exclude code the analyzer examines?</h4>
|
||||||
|
|
||||||
<p>When the static analyzer is using clang to parse source files, it implicitly
|
<p>When the static analyzer is using clang to parse source files, it implicitly
|
||||||
defines the preprocessor macro <tt>__clang_analyzer__</tt>. One can use this
|
defines the preprocessor macro <tt>__clang_analyzer__</tt>. One can use this
|
||||||
macro to selectively exclude code the analyzer examines. Here is an example:
|
macro to selectively exclude code the analyzer examines. Here is an example:
|
||||||
|
|
||||||
<pre class="code_example">
|
<pre class="code_example">
|
||||||
@ -215,8 +215,8 @@ macro to selectively exclude code the analyzer examines. Here is an example:
|
|||||||
#endif
|
#endif
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
This usage is discouraged because it makes the code dead to the analyzer from
|
This usage is discouraged because it makes the code dead to the analyzer from
|
||||||
now on. Instead, we prefer that users file bugs against the analyzer when it flags
|
now on. Instead, we prefer that users file bugs against the analyzer when it flags
|
||||||
false positives.
|
false positives.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -224,4 +224,3 @@ false positives.
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Filing Bugs and Feature Requests</title>
|
<title>Filing Bugs and Feature Requests</title>
|
||||||
<link type="text/css" rel="stylesheet" href="menu.css">
|
<link type="text/css" rel="stylesheet" href="menu.css">
|
||||||
<link type="text/css" rel="stylesheet" href="content.css">
|
<link type="text/css" rel="stylesheet" href="content.css">
|
||||||
<script type="text/javascript" src="scripts/menu.js"></script>
|
<script type="text/javascript" src="scripts/menu.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@ -19,7 +19,7 @@
|
|||||||
We also welcome feature requests. When filing a bug report, please do the
|
We also welcome feature requests. When filing a bug report, please do the
|
||||||
following:</p>
|
following:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li>Include the checker build (for prebuilt Mac OS X binaries) or the SVN
|
<li>Include the checker build (for prebuilt Mac OS X binaries) or the SVN
|
||||||
revision number.</li>
|
revision number.</li>
|
||||||
@ -37,7 +37,7 @@ and why.</li>
|
|||||||
|
|
||||||
<h3>Bugzilla</h3>
|
<h3>Bugzilla</h3>
|
||||||
|
|
||||||
<p>Please <a href="http://llvm.org/bugs/enter_bug.cgi?product=clang">file
|
<p>Please <a href="https://bugs.llvm.org/enter_bug.cgi?product=clang">file
|
||||||
bugs</a> in LLVM's Bugzilla database against the Clang <b>Static Analyzer</b>
|
bugs</a> in LLVM's Bugzilla database against the Clang <b>Static Analyzer</b>
|
||||||
component.</p>
|
component.</p>
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ component.</p>
|
|||||||
|
|
||||||
<p>If you are using the analyzer to analyze code associated with an Apple NDA
|
<p>If you are using the analyzer to analyze code associated with an Apple NDA
|
||||||
(e.g., preview versions of SDKs or seed releases of Mac OS X) please file bug
|
(e.g., preview versions of SDKs or seed releases of Mac OS X) please file bug
|
||||||
reports to Apple's <a href="http://bugreporter.apple.com">Bug Reporter</a> web
|
reports to Apple's <a href="https://feedbackassistant.apple.com/welcome">Feedback Assistant</a> web
|
||||||
site.</p>
|
site.</p>
|
||||||
|
|
||||||
<p>You are free to always file bugs through this website, but this option is less
|
<p>You are free to always file bugs through this website, but this option is less
|
||||||
@ -59,4 +59,3 @@ the analyzer has access to that bug database.</p>
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<h1>Implicit Checkers</h1>
|
<h1>Implicit Checkers</h1>
|
||||||
Even though the implicit checkers do not produce any warnings, they are used to
|
Even though the implicit checkers do not produce any warnings, they are used to
|
||||||
support the analyzer core and model known APIs. See also
|
support the analyzer core and model known APIs. See also
|
||||||
<a href = "available_checks.html">Default Checkers</a>
|
<a href = "available_checks.html">Default Checkers</a>
|
||||||
and <a href = "alpha_checks.html">Experimental (Alpha) Checkers</a>.
|
and <a href = "alpha_checks.html">Experimental (Alpha) Checkers</a>.
|
||||||
<ul>
|
<ul>
|
||||||
@ -50,10 +50,10 @@ public:
|
|||||||
class B: public A {
|
class B: public A {
|
||||||
public:
|
public:
|
||||||
B()
|
B()
|
||||||
:A(foo())
|
:A(foo())
|
||||||
// DynamicTypeInfo for 'this' rigion will wrap type 'A'
|
// DynamicTypeInfo for 'this' rigion will wrap type 'A'
|
||||||
// unless the base constructor call expression is processed
|
// unless the base constructor call expression is processed
|
||||||
{}
|
{}
|
||||||
virtual int foo();
|
virtual int foo();
|
||||||
};
|
};
|
||||||
</pre></div><div class="separator"></div>
|
</pre></div><div class="separator"></div>
|
||||||
@ -112,10 +112,10 @@ void test() {
|
|||||||
|
|
||||||
@implementation MyObj
|
@implementation MyObj
|
||||||
- (void)foo {
|
- (void)foo {
|
||||||
[[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd
|
[[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd
|
||||||
object:self
|
object:self
|
||||||
file:(@"somefile.m")
|
file:(@"somefile.m")
|
||||||
lineNumber:1
|
lineNumber:1
|
||||||
description:(@"some text")];
|
description:(@"some text")];
|
||||||
// generate sink
|
// generate sink
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ Improved modeling of loops using Cocoa collection types.</div></div></td>
|
|||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
void test() {
|
void test() {
|
||||||
id x;
|
id x;
|
||||||
for (x in [NSArray testObject]) {
|
for (x in [NSArray testObject]) {
|
||||||
// assume the value of 'x' is non-nil
|
// assume the value of 'x' is non-nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Clang Static Analyzer</title>
|
<title>Clang Static Analyzer</title>
|
||||||
<link type="text/css" rel="stylesheet" href="content.css">
|
<link type="text/css" rel="stylesheet" href="content.css">
|
||||||
<link type="text/css" rel="stylesheet" href="menu.css">
|
<link type="text/css" rel="stylesheet" href="menu.css">
|
||||||
<script type="text/javascript" src="scripts/menu.js"></script>
|
<script type="text/javascript" src="scripts/menu.js"></script>
|
||||||
<!-- Generated from: http://www.spiffycorners.com/index.php -->
|
<!-- Generated from: http://www.spiffycorners.com/index.php -->
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -45,7 +45,7 @@
|
|||||||
border-right:1px solid #f0f3fb}
|
border-right:1px solid #f0f3fb}
|
||||||
.spiffyfg{
|
.spiffyfg{
|
||||||
background:#EBF0FA}
|
background:#EBF0FA}
|
||||||
|
|
||||||
.spiffyfg h2 {
|
.spiffyfg h2 {
|
||||||
margin:0px; padding:10px;
|
margin:0px; padding:10px;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
|
<table style="margin-top:0px" width="100%" border="0" cellpadding="0px" cellspacing="0">
|
||||||
<tr><td>
|
<tr><td>
|
||||||
|
|
||||||
<h1>Clang Static Analyzer</h1>
|
<h1>Clang Static Analyzer</h1>
|
||||||
|
|
||||||
<p>The Clang Static Analyzer is a source code analysis tool that finds bugs in
|
<p>The Clang Static Analyzer is a source code analysis tool that finds bugs in
|
||||||
C, C++, and Objective-C programs.</p>
|
C, C++, and Objective-C programs.</p>
|
||||||
@ -78,7 +78,7 @@ invoked from the command line, and is intended to be run in tandem with a build
|
|||||||
of a codebase.</p>
|
of a codebase.</p>
|
||||||
|
|
||||||
<p>The analyzer is 100% open source and is part of the <a
|
<p>The analyzer is 100% open source and is part of the <a
|
||||||
href="http://clang.llvm.org">Clang</a> project. Like the rest of Clang, the
|
href="https://clang.llvm.org">Clang</a> project. Like the rest of Clang, the
|
||||||
analyzer is implemented as a C++ library that can be used by other tools and
|
analyzer is implemented as a C++ library that can be used by other tools and
|
||||||
applications.</p>
|
applications.</p>
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ applications.</p>
|
|||||||
<b class="spiffy5"></b></b>
|
<b class="spiffy5"></b></b>
|
||||||
<div class="spiffyfg">
|
<div class="spiffyfg">
|
||||||
<div style="padding:15px">
|
<div style="padding:15px">
|
||||||
<h3 style="margin:0px;padding:0px">Other Platforms</h3>
|
<h3 style="margin:0px;padding:0px">Other Platforms</h3>
|
||||||
<p>For other platforms, please follow the instructions for <a
|
<p>For other platforms, please follow the instructions for <a
|
||||||
href="/installation#OtherPlatforms">building the analyzer</a> from
|
href="/installation#OtherPlatforms">building the analyzer</a> from
|
||||||
source code.<p>
|
source code.<p>
|
||||||
@ -155,13 +155,13 @@ techniques such as testing.</p>
|
|||||||
<p>Static analysis bug-finding tools have evolved over the last several decades
|
<p>Static analysis bug-finding tools have evolved over the last several decades
|
||||||
from basic syntactic checkers to those that find deep bugs by reasoning about
|
from basic syntactic checkers to those that find deep bugs by reasoning about
|
||||||
the semantics of code. The goal of the Clang Static Analyzer is to provide a
|
the semantics of code. The goal of the Clang Static Analyzer is to provide a
|
||||||
industrial-quality static analysis framework for analyzing C, C++, and
|
industrial-quality static analysis framework for analyzing C, C++, and
|
||||||
Objective-C programs that is freely available, extensible, and has a high quality of implementation.</p>
|
Objective-C programs that is freely available, extensible, and has a high quality of implementation.</p>
|
||||||
|
|
||||||
<h3 id="Clang">Part of Clang and LLVM</h3>
|
<h3 id="Clang">Part of Clang and LLVM</h3>
|
||||||
|
|
||||||
<p>As its name implies, the Clang Static Analyzer is built on top of <a
|
<p>As its name implies, the Clang Static Analyzer is built on top of <a
|
||||||
href="http://clang.llvm.org">Clang</a> and <a href="http://llvm.org">LLVM</a>.
|
href="https://clang.llvm.org">Clang</a> and <a href="https://llvm.org">LLVM</a>.
|
||||||
Strictly speaking, the analyzer is part of Clang, as Clang consists of a set of
|
Strictly speaking, the analyzer is part of Clang, as Clang consists of a set of
|
||||||
reusable C++ libraries for building powerful source-level tools. The static
|
reusable C++ libraries for building powerful source-level tools. The static
|
||||||
analysis engine used by the Clang Static Analyzer is a Clang library, and has
|
analysis engine used by the Clang Static Analyzer is a Clang library, and has
|
||||||
@ -220,4 +220,3 @@ patches.</p>
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Obtaining the Static Analyzer</title>
|
<title>Obtaining the Static Analyzer</title>
|
||||||
<link type="text/css" rel="stylesheet" href="menu.css">
|
<link type="text/css" rel="stylesheet" href="menu.css">
|
||||||
<link type="text/css" rel="stylesheet" href="content.css">
|
<link type="text/css" rel="stylesheet" href="content.css">
|
||||||
<script type="text/javascript" src="scripts/menu.js"></script>
|
<script type="text/javascript" src="scripts/menu.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ the analyzer, we recommend that you check back here occasionally for new
|
|||||||
builds, especially if the build you are using is more than a couple
|
builds, especially if the build you are using is more than a couple
|
||||||
weeks old.</p>
|
weeks old.</p>
|
||||||
|
|
||||||
<p>The latest build is:
|
<p>The latest build is:
|
||||||
<!--#include virtual="latest_checker.html.incl"-->
|
<!--#include virtual="latest_checker.html.incl"-->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ weeks old.</p>
|
|||||||
we need volunteers who are willing to help provide such regular builds.
|
we need volunteers who are willing to help provide such regular builds.
|
||||||
If you wish to help contribute regular builds of the analyzer on other
|
If you wish to help contribute regular builds of the analyzer on other
|
||||||
platforms, please email the <a
|
platforms, please email the <a
|
||||||
href="http://lists.llvm.org/mailman/listinfo/cfe-dev">Clang
|
href="https://lists.llvm.org/mailman/listinfo/cfe-dev">Clang
|
||||||
Developers' mailing list</a>.</p>
|
Developers' mailing list</a>.</p>
|
||||||
|
|
||||||
<h3>Using Packaged Builds</h3>
|
<h3>Using Packaged Builds</h3>
|
||||||
@ -81,7 +81,7 @@ determine where to find its accompanying files.</p>
|
|||||||
|
|
||||||
<p>For other platforms, you must build Clang and LLVM manually. To do
|
<p>For other platforms, you must build Clang and LLVM manually. To do
|
||||||
so, please follow the instructions for <a
|
so, please follow the instructions for <a
|
||||||
href="http://clang.llvm.org/get_started.html#build">building Clang from
|
href="https://clang.llvm.org/get_started.html#build">building Clang from
|
||||||
source code</a>.<p>
|
source code</a>.<p>
|
||||||
|
|
||||||
<p>Once the Clang is built, you need to add the following to your path:</p>
|
<p>Once the Clang is built, you need to add the following to your path:</p>
|
||||||
@ -108,4 +108,3 @@ when clang is built.</p></li>
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Open Projects</title>
|
<title>Open Projects</title>
|
||||||
<link type="text/css" rel="stylesheet" href="menu.css">
|
<link type="text/css" rel="stylesheet" href="menu.css">
|
||||||
<link type="text/css" rel="stylesheet" href="content.css">
|
<link type="text/css" rel="stylesheet" href="content.css">
|
||||||
<script type="text/javascript" src="scripts/menu.js"></script>
|
<script type="text/javascript" src="scripts/menu.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@ -15,11 +15,11 @@
|
|||||||
|
|
||||||
<h1>Open Projects</h1>
|
<h1>Open Projects</h1>
|
||||||
|
|
||||||
<p>This page lists several projects that would boost analyzer's usability and
|
<p>This page lists several projects that would boost analyzer's usability and
|
||||||
power. Most of the projects listed here are infrastructure-related so this list
|
power. Most of the projects listed here are infrastructure-related so this list
|
||||||
is an addition to the <a href="potential_checkers.html">potential checkers
|
is an addition to the <a href="potential_checkers.html">potential checkers
|
||||||
list</a>. If you are interested in tackling one of these, please send an email
|
list</a>. If you are interested in tackling one of these, please send an email
|
||||||
to the <a href=http://lists.llvm.org/mailman/listinfo/cfe-dev>cfe-dev
|
to the <a href=https://lists.llvm.org/mailman/listinfo/cfe-dev>cfe-dev
|
||||||
mailing list</a> to notify other members of the community.</p>
|
mailing list</a> to notify other members of the community.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -49,9 +49,9 @@ mailing list</a> to notify other members of the community.</p>
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><code>alpha.unix.StreamChecker</code>
|
<li><code>alpha.unix.StreamChecker</code>
|
||||||
<p>A SimpleStreamChecker has been presented in the Building a Checker in 24
|
<p>A SimpleStreamChecker has been presented in the Building a Checker in 24
|
||||||
Hours talk
|
Hours talk
|
||||||
(<a href="http://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">slides</a>
|
(<a href="https://llvm.org/devmtg/2012-11/Zaks-Rose-Checker24Hours.pdf">slides</a>
|
||||||
<a href="https://youtu.be/kdxlsP5QVPw">video</a>).</p>
|
<a href="https://youtu.be/kdxlsP5QVPw">video</a>).</p>
|
||||||
|
|
||||||
<p>This alpha checker is an attempt to write a production grade stream checker.
|
<p>This alpha checker is an attempt to write a production grade stream checker.
|
||||||
@ -113,7 +113,7 @@ mailing list</a> to notify other members of the community.</p>
|
|||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Handle constructors for default arguments
|
<li>Handle constructors for default arguments
|
||||||
<p>Default arguments in C++ are recomputed at every call,
|
<p>Default arguments in C++ are recomputed at every call,
|
||||||
and are therefore local, and not static, variables.
|
and are therefore local, and not static, variables.
|
||||||
</p>
|
</p>
|
||||||
@ -144,7 +144,7 @@ mailing list</a> to notify other members of the community.</p>
|
|||||||
<p>Currently in the analyzer the value of a union is always regarded as
|
<p>Currently in the analyzer the value of a union is always regarded as
|
||||||
an unknown.
|
an unknown.
|
||||||
This problem was
|
This problem was
|
||||||
previously <a href="http://lists.llvm.org/pipermail/cfe-dev/2017-March/052864.html">discussed</a>
|
previously <a href="https://lists.llvm.org/pipermail/cfe-dev/2017-March/052864.html">discussed</a>
|
||||||
on the mailing list, but no solution was implemented.
|
on the mailing list, but no solution was implemented.
|
||||||
<p><i> (Difficulty: Medium) </i></p></p>
|
<p><i> (Difficulty: Medium) </i></p></p>
|
||||||
</li>
|
</li>
|
||||||
@ -228,4 +228,3 @@ mailing list</a> to notify other members of the community.</p>
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
memory.LeakEvalOrder</span><span class="lang">
|
memory.LeakEvalOrder</span><span class="lang">
|
||||||
(C, C++)</span><div class="descr">
|
(C, C++)</span><div class="descr">
|
||||||
Potential memory leaks caused by an undefined argument evaluation order.
|
Potential memory leaks caused by an undefined argument evaluation order.
|
||||||
<p>Source: <a href="http://www.boost.org/doc/libs/1_49_0/libs/smart_ptr/shared_ptr.htm#BestPractices">
|
<p>Source: <a href="https://www.boost.org/doc/libs/1_49_0/libs/smart_ptr/shared_ptr.htm#BestPractices">
|
||||||
boost docs: shared_ptr</a>.</p></div></div></td>
|
boost docs: shared_ptr</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -92,7 +92,7 @@ memory.NegativeArraySize</span><span class="lang">
|
|||||||
'n' is used to specify the buffer size may be negative.
|
'n' is used to specify the buffer size may be negative.
|
||||||
<br>Note: possibly an enhancement to <span class="name">
|
<br>Note: possibly an enhancement to <span class="name">
|
||||||
alpha.security.MallocOverflow</span>.
|
alpha.security.MallocOverflow</span>.
|
||||||
<p>Source: <a href="http://cwe.mitre.org/data/definitions/20.html">CWE-20,
|
<p>Source: <a href="https://cwe.mitre.org/data/definitions/20.html">CWE-20,
|
||||||
Example 2</a>.</p></div></div></td>
|
Example 2</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -109,7 +109,7 @@ memory.ZeroAlloc</span><span class="lang">
|
|||||||
(C, C++)</span><div class="descr">
|
(C, C++)</span><div class="descr">
|
||||||
Allocation of zero bytes.
|
Allocation of zero bytes.
|
||||||
<br>Note: an enhancement to <span class="name">unix.Malloc</span>.
|
<br>Note: an enhancement to <span class="name">unix.Malloc</span>.
|
||||||
<br>Note: <span class="name">unix.API</span> perform C-checks for zero
|
<br>Note: <span class="name">unix.API</span> perform C-checks for zero
|
||||||
allocation. This should be moved to <span class="name">unix.Malloc</span>.
|
allocation. This should be moved to <span class="name">unix.Malloc</span>.
|
||||||
<p>Source: C++03 3.7.3.1p2; C++11 3.7.4.1p2.</p></div></div></td>
|
<p>Source: C++03 3.7.3.1p2; C++11 3.7.4.1p2.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -127,7 +127,7 @@ void test() {
|
|||||||
delete[] p;
|
delete[] p;
|
||||||
}
|
}
|
||||||
</pre></div></div></td>
|
</pre></div></div></td>
|
||||||
<td class="aligned"><a href="http://reviews.llvm.org/D6178">
|
<td class="aligned"><a href="https://reviews.llvm.org/D6178">
|
||||||
D6178</a></td></tr>
|
D6178</a></td></tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@ -294,7 +294,7 @@ int test(bool cond) {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
</pre></div></div></td>
|
</pre></div></div></td>
|
||||||
<td class="aligned"><a href="http://llvm.org/bugs/show_bug.cgi?id=16890">PR16890</a></td></tr>
|
<td class="aligned"><a href="https://bugs.llvm.org/show_bug.cgi?id=16890">PR16890</a></td></tr>
|
||||||
|
|
||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
deadcode.IdempotentOperations</span><span class="lang">
|
deadcode.IdempotentOperations</span><span class="lang">
|
||||||
@ -360,7 +360,7 @@ void use(int fd) {
|
|||||||
print("%d", count); // should not warn
|
print("%d", count); // should not warn
|
||||||
}
|
}
|
||||||
</pre></div></div></td>
|
</pre></div></div></td>
|
||||||
<td class="aligned"><a href="http://llvm.org/bugs/show_bug.cgi?id=18701">PR18701</a></td></tr>
|
<td class="aligned"><a href="https://bugs.llvm.org/show_bug.cgi?id=18701">PR18701</a></td></tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -393,9 +393,9 @@ public:
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.LocalStaticDestroyed</span><span class="lang">
|
undefbehavior.LocalStaticDestroyed</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: function containing a definition of static local object is
|
Undefined behavior: function containing a definition of static local object is
|
||||||
called during the destruction of an object with static storage duration so that
|
called during the destruction of an object with static storage duration so that
|
||||||
flow of control passes through the definition of the previously destroyed
|
flow of control passes through the definition of the previously destroyed
|
||||||
static local object.
|
static local object.
|
||||||
<p>Source: C++11 3.6.3p2.</p></div></div></td>
|
<p>Source: C++11 3.6.3p2.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -423,7 +423,7 @@ void f() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.ZeroAllocDereference</span><span class="lang">
|
undefbehavior.ZeroAllocDereference</span><span class="lang">
|
||||||
(C, C++)</span><div class="descr">
|
(C, C++)</span><div class="descr">
|
||||||
The effect of dereferencing a pointer returned as a request for zero size is
|
The effect of dereferencing a pointer returned as a request for zero size is
|
||||||
undefined.<br>
|
undefined.<br>
|
||||||
Note: possibly an enhancement to <span class="name">
|
Note: possibly an enhancement to <span class="name">
|
||||||
unix.Malloc</span>.
|
unix.Malloc</span>.
|
||||||
@ -447,7 +447,7 @@ void test() {
|
|||||||
delete[] p;
|
delete[] p;
|
||||||
}
|
}
|
||||||
</pre></div></div></td>
|
</pre></div></div></td>
|
||||||
<td class="aligned"><a href="http://reviews.llvm.org/D8273">D8273</a></td></tr>
|
<td class="aligned"><a href="https://reviews.llvm.org/D8273">D8273</a></td></tr>
|
||||||
|
|
||||||
|
|
||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
@ -463,7 +463,7 @@ non-static member function of the object</li>
|
|||||||
<li>the pointer is implicitly converted to a pointer to a base class
|
<li>the pointer is implicitly converted to a pointer to a base class
|
||||||
type</li>
|
type</li>
|
||||||
<li>the pointer is used as the operand of a <code>static_cast</code> (except
|
<li>the pointer is used as the operand of a <code>static_cast</code> (except
|
||||||
when the conversion is to <code>void*</code>, or to <code>void*</code> and
|
when the conversion is to <code>void*</code>, or to <code>void*</code> and
|
||||||
subsequently to <code>char*</code>, or <code>unsigned char*</code>)</li>
|
subsequently to <code>char*</code>, or <code>unsigned char*</code>)</li>
|
||||||
<li>the pointer is used as the operand of a <code>dynamic_cast</code></li></ul>
|
<li>the pointer is used as the operand of a <code>dynamic_cast</code></li></ul>
|
||||||
<p>Source: C++03 3.8p5, p7; C++11 3.8p5, p7.</p></div></div></td>
|
<p>Source: C++03 3.8p5, p7; C++11 3.8p5, p7.</p></div></div></td>
|
||||||
@ -562,7 +562,7 @@ A* test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.ObjLocChanges</span><span class="lang">
|
undefbehavior.ObjLocChanges</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: the program must ensure that an object occupies the same
|
Undefined behavior: the program must ensure that an object occupies the same
|
||||||
storage location when the implicit or explicit destructor call takes place.
|
storage location when the implicit or explicit destructor call takes place.
|
||||||
<p>Source: C++11 3.8p8.</p></div></div></td>
|
<p>Source: C++11 3.8p8.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -603,7 +603,7 @@ void test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.ExprEvalOrderUndef</span><span class="lang">
|
undefbehavior.ExprEvalOrderUndef</span><span class="lang">
|
||||||
(C, C++03)</span><div class="descr">
|
(C, C++03)</span><div class="descr">
|
||||||
Undefined behavior: a scalar object shall have its stored value modified at
|
Undefined behavior: a scalar object shall have its stored value modified at
|
||||||
most once by the evaluation of an expression.<br>
|
most once by the evaluation of an expression.<br>
|
||||||
Note: most cases are currently handled by the Clang core (search for 'multiple
|
Note: most cases are currently handled by the Clang core (search for 'multiple
|
||||||
unsequenced modifications' warning in Clang tests).
|
unsequenced modifications' warning in Clang tests).
|
||||||
@ -622,7 +622,7 @@ int test () {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.StaticInitReentered</span><span class="lang">
|
undefbehavior.StaticInitReentered</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: static declaration is re-entered while the object is being
|
Undefined behavior: static declaration is re-entered while the object is being
|
||||||
initialized.
|
initialized.
|
||||||
<p>Source: C++11 6.7p4.</p></div></div></td>
|
<p>Source: C++11 6.7p4.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -669,7 +669,7 @@ void test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.DeadDestructed</span><span class="lang">
|
undefbehavior.DeadDestructed</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: the destructor is invoked for an object whose lifetime
|
Undefined behavior: the destructor is invoked for an object whose lifetime
|
||||||
has ended.
|
has ended.
|
||||||
<p>Source: C++11 12.4p14.</p></div></div></td>
|
<p>Source: C++11 12.4p14.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -713,9 +713,9 @@ public :
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.MemberOrBaseRefBeforeCtor</span><span class="lang">
|
undefbehavior.MemberOrBaseRefBeforeCtor</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
C++ Undefined behavior: non-static member or base class of non-POD class type
|
C++ Undefined behavior: non-static member or base class of non-POD class type
|
||||||
is referred before constructor begins execution.<br>
|
is referred before constructor begins execution.<br>
|
||||||
C++11 Undefined behavior: non-static member or base class of a class with a
|
C++11 Undefined behavior: non-static member or base class of a class with a
|
||||||
non-trivial constructor is referred before constructor begins execution.
|
non-trivial constructor is referred before constructor begins execution.
|
||||||
<p>Source: C++03 12.7p1; C++11 12.7p1.</p></div></div></td>
|
<p>Source: C++03 12.7p1; C++11 12.7p1.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -730,8 +730,8 @@ extern non_POD non_pod;
|
|||||||
int *p = &non_pod.i; // warn
|
int *p = &non_pod.i; // warn
|
||||||
</pre></div>
|
</pre></div>
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
struct POD {
|
struct POD {
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct non_POD : public POD {
|
struct non_POD : public POD {
|
||||||
@ -744,7 +744,7 @@ int *p = &non_pod.pod.i; // warn
|
|||||||
</pre></div>
|
</pre></div>
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
struct POD {
|
struct POD {
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct non_POD : public POD {};
|
struct non_POD : public POD {};
|
||||||
@ -771,9 +771,9 @@ struct S {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.MemberRefAfterDtor</span><span class="lang">
|
undefbehavior.MemberRefAfterDtor</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
C++03: Undefined behavior: non-static member of non-POD class type is referred
|
C++03: Undefined behavior: non-static member of non-POD class type is referred
|
||||||
after destructor ends execution.<br>
|
after destructor ends execution.<br>
|
||||||
C++11: Undefined behavior: non-static member of a class with a non-trivial
|
C++11: Undefined behavior: non-static member of a class with a non-trivial
|
||||||
destructor is referred after destructor ends execution.
|
destructor is referred after destructor ends execution.
|
||||||
<p>Source: C++03 12.7p1; C++11 12.7p1.</p></div></div></td>
|
<p>Source: C++03 12.7p1; C++11 12.7p1.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -796,7 +796,7 @@ void test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.CtorForeignCall</span><span class="lang">
|
undefbehavior.CtorForeignCall</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: call to virtual function of an object under construction
|
Undefined behavior: call to virtual function of an object under construction
|
||||||
whose type is neither the constructors own class or one of its bases.
|
whose type is neither the constructors own class or one of its bases.
|
||||||
<p>Source: C++11 12.7p4.</p></div></div></td>
|
<p>Source: C++11 12.7p4.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -823,7 +823,7 @@ public:
|
|||||||
undefbehavior.CtorForeignTypeid</span><span class="lang">
|
undefbehavior.CtorForeignTypeid</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: the operand of <code>typeid</code> is an object under
|
Undefined behavior: the operand of <code>typeid</code> is an object under
|
||||||
construction whose type is neither the constructors own class or one of its
|
construction whose type is neither the constructors own class or one of its
|
||||||
bases.
|
bases.
|
||||||
<p>Source: C++11 12.7p5.</p></div></div></td>
|
<p>Source: C++11 12.7p5.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -865,7 +865,7 @@ public:
|
|||||||
|
|
||||||
class B {
|
class B {
|
||||||
public:
|
public:
|
||||||
B(A* a) {
|
B(A* a) {
|
||||||
(void)dynamic_cast<B*>(a); //warn
|
(void)dynamic_cast<B*>(a); //warn
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -881,8 +881,8 @@ public:
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.MemberOrBaseRefInCatch</span><span class="lang">
|
undefbehavior.MemberOrBaseRefInCatch</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: referring to any non-static member or base class of an
|
Undefined behavior: referring to any non-static member or base class of an
|
||||||
object in the handler for a function-try-block of a constructor or destructor
|
object in the handler for a function-try-block of a constructor or destructor
|
||||||
for that object results in undefined behavior.
|
for that object results in undefined behavior.
|
||||||
<p>Source: C++11 15.3p10.</p></div></div></td>
|
<p>Source: C++11 15.3p10.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -925,7 +925,7 @@ public :
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.ReturnAtCatchEnd</span><span class="lang">
|
undefbehavior.ReturnAtCatchEnd</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
Undefined behavior: a function returns when control reaches the end of a
|
Undefined behavior: a function returns when control reaches the end of a
|
||||||
handler. This results in undefined behavior in a value-returning function.
|
handler. This results in undefined behavior in a value-returning function.
|
||||||
<p>Source: C++11 15.3p10.</p></div></div></td>
|
<p>Source: C++11 15.3p10.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -1011,9 +1011,9 @@ int test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
undefbehavior.QsortNonPODNonTrivial</span><span class="lang">
|
undefbehavior.QsortNonPODNonTrivial</span><span class="lang">
|
||||||
(C++)</span><div class="descr">
|
(C++)</span><div class="descr">
|
||||||
C++03: Undefined behavior: the objects in the array passed to qsort are of
|
C++03: Undefined behavior: the objects in the array passed to qsort are of
|
||||||
non-POD type.<br>
|
non-POD type.<br>
|
||||||
C++11: Undefined behavior: the objects in the array passed to qsort are of
|
C++11: Undefined behavior: the objects in the array passed to qsort are of
|
||||||
non-trivial type.
|
non-trivial type.
|
||||||
<p>Source: C++03 25.4p4; C++11 25.5p4.</p></div></div></td>
|
<p>Source: C++03 25.4p4; C++11 25.5p4.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
@ -1353,7 +1353,7 @@ int test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
different.NullDerefStmtOrder</span><span class="lang">
|
different.NullDerefStmtOrder</span><span class="lang">
|
||||||
(C)</span><div class="descr">
|
(C)</span><div class="descr">
|
||||||
Dereferencing of the null pointer might take place. Checking the pointer for
|
Dereferencing of the null pointer might take place. Checking the pointer for
|
||||||
null should be performed first.
|
null should be performed first.
|
||||||
<br>Note: possibly an enhancement to <span class="name">
|
<br>Note: possibly an enhancement to <span class="name">
|
||||||
core.NullDereference</span>.</div></div></td>
|
core.NullDereference</span>.</div></div></td>
|
||||||
@ -1380,7 +1380,7 @@ void test() {
|
|||||||
<tr><td><div class="namedescr expandable"><span class="name">
|
<tr><td><div class="namedescr expandable"><span class="name">
|
||||||
different.NullDerefCondOrder</span><span class="lang">
|
different.NullDerefCondOrder</span><span class="lang">
|
||||||
(C)</span><div class="descr">
|
(C)</span><div class="descr">
|
||||||
Dereferencing of the null pointer might take place. Checking the pointer for
|
Dereferencing of the null pointer might take place. Checking the pointer for
|
||||||
null should be performed first.
|
null should be performed first.
|
||||||
<br>Note: possibly an enhancement to <span class="name">
|
<br>Note: possibly an enhancement to <span class="name">
|
||||||
core.NullDereference</span>.</div></div></td>
|
core.NullDereference</span>.</div></div></td>
|
||||||
@ -1734,7 +1734,7 @@ different.IntegerOverflow</span><span class="lang">
|
|||||||
Integer overflow.
|
Integer overflow.
|
||||||
<br>Note: partially handled by Clang core
|
<br>Note: partially handled by Clang core
|
||||||
(search for 'overflow in expression' warning in Clang tests).
|
(search for 'overflow in expression' warning in Clang tests).
|
||||||
<p>Source: <a href="http://cwe.mitre.org/data/definitions/190.html">
|
<p>Source: <a href="https://cwe.mitre.org/data/definitions/190.html">
|
||||||
CWE-190</a>.</p></div></div></td>
|
CWE-190</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -1761,7 +1761,7 @@ int test() {
|
|||||||
different.SignExtension</span><span class="lang">
|
different.SignExtension</span><span class="lang">
|
||||||
(C)</span><div class="descr">
|
(C)</span><div class="descr">
|
||||||
Unexpected sign extension might take place.
|
Unexpected sign extension might take place.
|
||||||
<p>Source: <a href="http://cwe.mitre.org/data/definitions/194.html">
|
<p>Source: <a href="https://cwe.mitre.org/data/definitions/194.html">
|
||||||
CWE-194</a>.</p></div></div></td>
|
CWE-194</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -1789,7 +1789,7 @@ unsigned int test(int i) {
|
|||||||
different.NumericTruncation</span><span class="lang">
|
different.NumericTruncation</span><span class="lang">
|
||||||
(C)</span><div class="descr">
|
(C)</span><div class="descr">
|
||||||
Numeric truncation might take place.
|
Numeric truncation might take place.
|
||||||
<p>Source: <a href="http://cwe.mitre.org/data/definitions/197.html">
|
<p>Source: <a href="https://cwe.mitre.org/data/definitions/197.html">
|
||||||
CWE-197</a>.</p></div></div></td>
|
CWE-197</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -1851,7 +1851,7 @@ white space-delimited string pointed to by <code><i>lpCommandLine</code></i>.
|
|||||||
If the executable or path name has a space in it, there is a risk that a
|
If the executable or path name has a space in it, there is a risk that a
|
||||||
different executable could be run because of the way the function parses
|
different executable could be run because of the way the function parses
|
||||||
spaces.
|
spaces.
|
||||||
<p>Source: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx">
|
<p>Source: <a href="https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa#security-remarks">
|
||||||
MSDN: CreateProcess function, Security Remarks</a>.</p></div></div></td>
|
MSDN: CreateProcess function, Security Remarks</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -1873,7 +1873,7 @@ WinAPI.LoadLibrary</span><span class="lang">
|
|||||||
(C)</span><div class="descr">
|
(C)</span><div class="descr">
|
||||||
The <code>SearchPath()</code> function is used to retrieve a path to a DLL for
|
The <code>SearchPath()</code> function is used to retrieve a path to a DLL for
|
||||||
a subsequent <code>LoadLibrary()</code> call.
|
a subsequent <code>LoadLibrary()</code> call.
|
||||||
<p>Source: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175%28v=vs.85%29.aspx">
|
<p>Source: <a href="https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibrarya#security-remarks">
|
||||||
MSDN: LoadLibrary function, Security Remarks</a>.</p></div></div></td>
|
MSDN: LoadLibrary function, Security Remarks</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -1894,7 +1894,7 @@ WinAPI.WideCharToMultiByte</span><span class="lang">
|
|||||||
Buffer overrun while calling <code>WideCharToMultiByte()</code>. The size of
|
Buffer overrun while calling <code>WideCharToMultiByte()</code>. The size of
|
||||||
the input buffer equals the number of characters in the Unicode string, while
|
the input buffer equals the number of characters in the Unicode string, while
|
||||||
the size of the output buffer equals the number of bytes.
|
the size of the output buffer equals the number of bytes.
|
||||||
<p>Source: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130%28v=vs.85%29.aspx">
|
<p>Source: <a href="https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte">
|
||||||
MSDN: WideCharToMultiByte function</a>.</p></div></div></td>
|
MSDN: WideCharToMultiByte function</a>.</p></div></div></td>
|
||||||
<td><div class="exampleContainer expandable">
|
<td><div class="exampleContainer expandable">
|
||||||
<div class="example"><pre>
|
<div class="example"><pre>
|
||||||
@ -1947,7 +1947,7 @@ operators.</p></div></div></td>
|
|||||||
void test() {
|
void test() {
|
||||||
std::vector<int> v;
|
std::vector<int> v;
|
||||||
std::vector<int>::const_iterator it;
|
std::vector<int>::const_iterator it;
|
||||||
for(it = v.begin();
|
for(it = v.begin();
|
||||||
it != v.end(); it++) {}; // warn
|
it != v.end(); it++) {}; // warn
|
||||||
}
|
}
|
||||||
</pre></div></div></td>
|
</pre></div></div></td>
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
<li>Accepts <tt>-arch arm64</tt> (which may be passed by Xcode 5.0), but for the time being analyzes code in such cases as <tt>-arch armv7s</tt>.</li>
|
<li>Accepts <tt>-arch arm64</tt> (which may be passed by Xcode 5.0), but for the time being analyzes code in such cases as <tt>-arch armv7s</tt>.</li>
|
||||||
<li>Many sundry fixes, improvements to C++ support, etc.</li>
|
<li>Many sundry fixes, improvements to C++ support, etc.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4 id="checker_275">checker-275</h4>
|
<h4 id="checker_275">checker-275</h4>
|
||||||
<p><b>built:</b> May 23, 2013</br>
|
<p><b>built:</b> May 23, 2013</br>
|
||||||
<b>download:</b> <a href="downloads/checker-275.tar.bz2">checker-275.tar.bz2</a></p>
|
<b>download:</b> <a href="downloads/checker-275.tar.bz2">checker-275.tar.bz2</a></p>
|
||||||
@ -177,7 +177,7 @@
|
|||||||
<h4 id="checker_268">checker-268</h4>
|
<h4 id="checker_268">checker-268</h4>
|
||||||
<p><b>built:</b> September 11, 2012</p>
|
<p><b>built:</b> September 11, 2012</p>
|
||||||
<p><b>highlights:</b></p>
|
<p><b>highlights:</b></p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Adds initial interprocedural analysis support for C++ and Objective-C. This will greatly improve analysis coverage and find deeper bugs in Objective-C and C++ code.</li>
|
<li>Adds initial interprocedural analysis support for C++ and Objective-C. This will greatly improve analysis coverage and find deeper bugs in Objective-C and C++ code.</li>
|
||||||
<li>Contains a static analyzer newer than Xcode 4.4.</li>
|
<li>Contains a static analyzer newer than Xcode 4.4.</li>
|
||||||
@ -203,8 +203,8 @@ these, and any other problems you encounter. When you encounter an issue, please
|
|||||||
<p><b>highlights:</b></p>
|
<p><b>highlights:</b></p>
|
||||||
|
|
||||||
<p>This release contains a fix for a major crasher introduced in checker-264, and various refinements to
|
<p>This release contains a fix for a major crasher introduced in checker-264, and various refinements to
|
||||||
improve the precision and reduce the false positive rate of the analyzer. It also enables a new unix.MallocSizeof check, which reports
|
improve the precision and reduce the false positive rate of the analyzer. It also enables a new unix.MallocSizeof check, which reports
|
||||||
inconsistencies between the casted type of the return value of a 'malloc/calloc/realloc' call and the operand
|
inconsistencies between the casted type of the return value of a 'malloc/calloc/realloc' call and the operand
|
||||||
of sizeof expressions contained within its argument(s).</p>
|
of sizeof expressions contained within its argument(s).</p>
|
||||||
|
|
||||||
<h4 id="checker_264">checker-264</h4>
|
<h4 id="checker_264">checker-264</h4>
|
||||||
@ -290,7 +290,7 @@ of sizeof expressions contained within its argument(s).</p>
|
|||||||
<li>Supports ARC (please file bugs where you see issues)</li>
|
<li>Supports ARC (please file bugs where you see issues)</li>
|
||||||
<li>Major under-the-cover changes. This should result in more precise results in some cases, but this is laying the groundwork for major improvements. Please file bugs where you see regressions or issues.</li>
|
<li>Major under-the-cover changes. This should result in more precise results in some cases, but this is laying the groundwork for major improvements. Please file bugs where you see regressions or issues.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4 id="checker_257">checker-257</h4>
|
<h4 id="checker_257">checker-257</h4>
|
||||||
|
|
||||||
<p><b>built: </b>May 25, 2011<br>
|
<p><b>built: </b>May 25, 2011<br>
|
||||||
@ -316,15 +316,15 @@ of sizeof expressions contained within its argument(s).</p>
|
|||||||
<p>This build contains basic support for C++ and Objective-C++ that is ready to be tried out
|
<p>This build contains basic support for C++ and Objective-C++ that is ready to be tried out
|
||||||
by general users. It is still in its infancy, but establishes a baseline for things to come. The main hope is that it can find some
|
by general users. It is still in its infancy, but establishes a baseline for things to come. The main hope is that it can find some
|
||||||
issues and have a reasonable false positive rate.</p>
|
issues and have a reasonable false positive rate.</p>
|
||||||
|
|
||||||
<p><b>Please</b> <a href="/filing_bugs.html">file bugs</a> when you see issues of any kind so we can assess
|
<p><b>Please</b> <a href="/filing_bugs.html">file bugs</a> when you see issues of any kind so we can assess
|
||||||
where development on C++ analysis support needs to be focused.</p>
|
where development on C++ analysis support needs to be focused.</p>
|
||||||
|
|
||||||
<p>To try out C++ analysis support, it should work out of the box using <tt>scan-build</tt>. If you are using this checker build
|
<p>To try out C++ analysis support, it should work out of the box using <tt>scan-build</tt>. If you are using this checker build
|
||||||
as a replacement to the analyzer bundled with Xcode, first use the <tt>set-xcode-analyzer</tt> script to <a href="/xcode.html">change Xcode to use
|
as a replacement to the analyzer bundled with Xcode, first use the <tt>set-xcode-analyzer</tt> script to <a href="/xcode.html">change Xcode to use
|
||||||
your version of the analyzer</a>. You will then need to modify one configuration file in Xcode to enable C++ analysis support. This can
|
your version of the analyzer</a>. You will then need to modify one configuration file in Xcode to enable C++ analysis support. This can
|
||||||
be done with the following steps:</p>
|
be done with the following steps:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Find the clang .xcspec file:
|
<li>Find the clang .xcspec file:
|
||||||
<pre>$ cd /Developer/Library
|
<pre>$ cd /Developer/Library
|
||||||
@ -380,4 +380,3 @@ $ find . | grep xcspec | grep Clang
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ web browser.</p>
|
|||||||
<p><b>scan-build</b> has little or no knowledge about how you build your code.
|
<p><b>scan-build</b> has little or no knowledge about how you build your code.
|
||||||
It works by overriding the <tt>CC</tt> and <tt>CXX</tt> environment variables to
|
It works by overriding the <tt>CC</tt> and <tt>CXX</tt> environment variables to
|
||||||
(hopefully) change your build to use a "fake" compiler instead of the
|
(hopefully) change your build to use a "fake" compiler instead of the
|
||||||
one that would normally build your project. This fake compiler executes either
|
one that would normally build your project. This fake compiler executes either
|
||||||
<tt>clang</tt> or <tt>gcc</tt> (depending on the platform) to compile your
|
<tt>clang</tt> or <tt>gcc</tt> (depending on the platform) to compile your
|
||||||
code and then executes the static analyzer to analyze your code.</p>
|
code and then executes the static analyzer to analyze your code.</p>
|
||||||
|
|
||||||
<p>This "poor man's interposition" works amazingly well in many cases
|
<p>This "poor man's interposition" works amazingly well in many cases
|
||||||
@ -76,7 +76,7 @@ aforementioned hack fails to work.</p>
|
|||||||
<p>The <tt>scan-build</tt> command can be used to analyze an entire project by
|
<p>The <tt>scan-build</tt> command can be used to analyze an entire project by
|
||||||
essentially interposing on a project's build process. This means that to run the
|
essentially interposing on a project's build process. This means that to run the
|
||||||
analyzer using <tt>scan-build</tt>, you will use <tt>scan-build</tt> to analyze
|
analyzer using <tt>scan-build</tt>, you will use <tt>scan-build</tt> to analyze
|
||||||
the source files compiled by <tt>gcc</tt>/<tt>clang</tt> during a project build.
|
the source files compiled by <tt>gcc</tt>/<tt>clang</tt> during a project build.
|
||||||
This means that any files that are not compiled will also not be analyzed.</p>
|
This means that any files that are not compiled will also not be analyzed.</p>
|
||||||
|
|
||||||
<h3 id="scanbuild_basicusage">Basic Usage</h3>
|
<h3 id="scanbuild_basicusage">Basic Usage</h3>
|
||||||
@ -92,7 +92,7 @@ $ <span class="code_highlight">scan-build</span> xcodebuild
|
|||||||
<p>In the first case <tt>scan-build</tt> analyzes the code of a project built
|
<p>In the first case <tt>scan-build</tt> analyzes the code of a project built
|
||||||
with <tt>make</tt> and in the second case <tt>scan-build</tt> analyzes a project
|
with <tt>make</tt> and in the second case <tt>scan-build</tt> analyzes a project
|
||||||
built using <tt>xcodebuild</tt>.<p>
|
built using <tt>xcodebuild</tt>.<p>
|
||||||
|
|
||||||
<p>Here is the general format for invoking <tt>scan-build</tt>:</p>
|
<p>Here is the general format for invoking <tt>scan-build</tt>:</p>
|
||||||
|
|
||||||
<pre class="code_example">
|
<pre class="code_example">
|
||||||
@ -135,7 +135,7 @@ your PATH environment variable.</p>
|
|||||||
with MinGW/MSYS the following information may be helpful:</p>
|
with MinGW/MSYS the following information may be helpful:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li> If getting unexpected <tt>"fatal error: no input files"</tt> while
|
<li> If getting unexpected <tt>"fatal error: no input files"</tt> while
|
||||||
building with MSYS make from the Windows cmd, try one of these solutions:</li>
|
building with MSYS make from the Windows cmd, try one of these solutions:</li>
|
||||||
<ul>
|
<ul>
|
||||||
<li> Use MinGW <tt>mingw32-make</tt> instead of MSYS <tt>make</tt> and
|
<li> Use MinGW <tt>mingw32-make</tt> instead of MSYS <tt>make</tt> and
|
||||||
@ -148,7 +148,7 @@ with backslashed quotes may be heavily corrupted when passed for execution.</li>
|
|||||||
$ <span class="code_highlight">scan-build</span> <i>[scan-build options]</i> sh -c "make <i>[make options]</i>"
|
$ <span class="code_highlight">scan-build</span> <i>[scan-build options]</i> sh -c "make <i>[make options]</i>"
|
||||||
</pre></li>
|
</pre></li>
|
||||||
</ul>
|
</ul>
|
||||||
<li> If getting <tt>"Error : *** target pattern contains no `%'"</tt> while
|
<li> If getting <tt>"Error : *** target pattern contains no `%'"</tt> while
|
||||||
using GNU Make 3.81, try to use another version of make.</li>
|
using GNU Make 3.81, try to use another version of make.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -189,9 +189,9 @@ reports against the analyzer.</td></tr>
|
|||||||
command completes.</td></tr>
|
command completes.</td></tr>
|
||||||
|
|
||||||
<tr><td><b>--use-analyzer Xcode</b><br><i>or</i><br>
|
<tr><td><b>--use-analyzer Xcode</b><br><i>or</i><br>
|
||||||
<b>--use-analyzer [path to clang]</b></td><td><tt>scan-build</tt> uses the
|
<b>--use-analyzer [path to clang]</b></td><td><tt>scan-build</tt> uses the
|
||||||
'clang' executable relative to itself for static analysis. One can override this
|
'clang' executable relative to itself for static analysis. One can override this
|
||||||
behavior with this option by using the 'clang' packaged with Xcode (on OS X) or
|
behavior with this option by using the 'clang' packaged with Xcode (on OS X) or
|
||||||
from the PATH.</p></td></tr> </table>
|
from the PATH.</p></td></tr> </table>
|
||||||
|
|
||||||
<p>A complete list of options can be obtained by running <tt>scan-build</tt>
|
<p>A complete list of options can be obtained by running <tt>scan-build</tt>
|
||||||
@ -263,7 +263,7 @@ regular compilation and <tt>clang</tt> to perform static analysis.</p>
|
|||||||
paths to the compiler, and by running <tt>configure</tt> through
|
paths to the compiler, and by running <tt>configure</tt> through
|
||||||
<tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p>
|
<tt>scan-build</tt> that path is set to <tt>ccc-analyzer</tt>.</p>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<h2 id="Debugging">Debugging the Analyzer</h2>
|
<h2 id="Debugging">Debugging the Analyzer</h2>
|
||||||
|
|
||||||
<p>This section provides information on debugging the analyzer, and troubleshooting
|
<p>This section provides information on debugging the analyzer, and troubleshooting
|
||||||
@ -354,12 +354,12 @@ $ scan-build xcodebuild -configuration Debug -sdk iphonesimulator3.0
|
|||||||
<h3>Gotcha: using the right compiler</h3>
|
<h3>Gotcha: using the right compiler</h3>
|
||||||
|
|
||||||
<p>Recall that <b>scan-build</b> analyzes your project by using a compiler to
|
<p>Recall that <b>scan-build</b> analyzes your project by using a compiler to
|
||||||
compile the project and <tt>clang</tt> to analyze your project. The script uses
|
compile the project and <tt>clang</tt> to analyze your project. The script uses
|
||||||
simple heuristics to determine which compiler should be used (it defaults to
|
simple heuristics to determine which compiler should be used (it defaults to
|
||||||
<tt>clang</tt> on Darwin and <tt>gcc</tt> on other platforms). When analyzing
|
<tt>clang</tt> on Darwin and <tt>gcc</tt> on other platforms). When analyzing
|
||||||
iPhone projects, <b>scan-build</b> may pick the wrong compiler than the one
|
iPhone projects, <b>scan-build</b> may pick the wrong compiler than the one
|
||||||
Xcode would use to build your project. For example, this could be because
|
Xcode would use to build your project. For example, this could be because
|
||||||
multiple versions of a compiler may be installed on your system, especially if
|
multiple versions of a compiler may be installed on your system, especially if
|
||||||
you are developing for the iPhone.</p>
|
you are developing for the iPhone.</p>
|
||||||
|
|
||||||
<p>When compiling your application to run on the simulator, it is important that <b>scan-build</b>
|
<p>When compiling your application to run on the simulator, it is important that <b>scan-build</b>
|
||||||
@ -381,4 +381,3 @@ full path to the compiler that Xcode is using, and use that as an argument to
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ presents analysis results directly within Xcode's editor.</p>
|
|||||||
|
|
||||||
<p>Xcode is available as a free download from Apple on the <a
|
<p>Xcode is available as a free download from Apple on the <a
|
||||||
href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">Mac
|
href="https://itunes.apple.com/us/app/xcode/id497799835?mt=12">Mac
|
||||||
App Store</a>, with <a
|
App Store</a>, with <a
|
||||||
href="https://developer.apple.com/library/ios/recipes/xcode_help-source_editor/chapters/Analyze.html#//apple_ref/doc/uid/TP40009975-CH4-SW1">instructions
|
href="https://developer.apple.com/library/ios/recipes/xcode_help-source_editor/chapters/Analyze.html#//apple_ref/doc/uid/TP40009975-CH4-SW1">instructions
|
||||||
available</a> for using the analyzer.</p>
|
available</a> for using the analyzer.</p>
|
||||||
|
|
||||||
@ -141,4 +141,3 @@ $ sudo set-xcode-analyzer --use-xcode-clang
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
||||||
<html>
|
<html>
|
||||||
@ -12,16 +12,16 @@
|
|||||||
<!--#include virtual="menu.html.incl"-->
|
<!--#include virtual="menu.html.incl"-->
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<h1>Clang vs Other Open Source Compilers</h1>
|
<h1>Clang vs Other Open Source Compilers</h1>
|
||||||
|
|
||||||
<p>Building an entirely new compiler front-end is a big task, and it isn't
|
<p>Building an entirely new compiler front-end is a big task, and it isn't
|
||||||
always clear to people why we decided to do this. Here we compare Clang
|
always clear to people why we decided to do this. Here we compare Clang
|
||||||
and its goals to other open source compiler front-ends that are
|
and its goals to other open source compiler front-ends that are
|
||||||
available. We restrict the discussion to very specific objective points
|
available. We restrict the discussion to very specific objective points
|
||||||
to avoid controversy where possible. Also, software is infinitely
|
to avoid controversy where possible. Also, software is infinitely
|
||||||
mutable, so we don't talk about little details that can be fixed with
|
mutable, so we don't talk about little details that can be fixed with
|
||||||
a reasonable amount of effort: we'll talk about issues that are
|
a reasonable amount of effort: we'll talk about issues that are
|
||||||
difficult to fix for architectural or political reasons.</p>
|
difficult to fix for architectural or political reasons.</p>
|
||||||
|
|
||||||
<p>The goal of this list is to describe how differences in goals lead to
|
<p>The goal of this list is to describe how differences in goals lead to
|
||||||
different strengths and weaknesses, not to make some compiler look bad.
|
different strengths and weaknesses, not to make some compiler look bad.
|
||||||
This will hopefully help you to evaluate whether using Clang is a good
|
This will hopefully help you to evaluate whether using Clang is a good
|
||||||
@ -30,39 +30,39 @@
|
|||||||
terms of <em>our</em> goals: if you are only interested in static
|
terms of <em>our</em> goals: if you are only interested in static
|
||||||
analysis, you may not care that something lacks codegen support, for
|
analysis, you may not care that something lacks codegen support, for
|
||||||
example.</p>
|
example.</p>
|
||||||
|
|
||||||
<p>Please email <a href="get_involved.html">cfe-dev</a> if you think we should add another compiler to this
|
<p>Please email <a href="get_involved.html">cfe-dev</a> if you think we should add another compiler to this
|
||||||
list or if you think some characterization is unfair here.</p>
|
list or if you think some characterization is unfair here.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#gcc">Clang vs GCC</a> (GNU Compiler Collection)</li>
|
<li><a href="#gcc">Clang vs GCC</a> (GNU Compiler Collection)</li>
|
||||||
<li><a href="#elsa">Clang vs Elsa</a> (Elkhound-based C++ Parser)</li>
|
<li><a href="#elsa">Clang vs Elsa</a> (Elkhound-based C++ Parser)</li>
|
||||||
<li><a href="#pcc">Clang vs PCC</a> (Portable C Compiler)</li>
|
<li><a href="#pcc">Clang vs PCC</a> (Portable C Compiler)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
<h2><a name="gcc">Clang vs GCC (GNU Compiler Collection)</a></h2>
|
<h2><a name="gcc">Clang vs GCC (GNU Compiler Collection)</a></h2>
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>Pro's of GCC vs Clang:</p>
|
<p>Pro's of GCC vs Clang:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>GCC supports languages that Clang does not aim to, such as Java, Ada,
|
<li>GCC supports languages that Clang does not aim to, such as Java, Ada,
|
||||||
FORTRAN, Go, etc.</li>
|
FORTRAN, Go, etc.</li>
|
||||||
<li>GCC supports more targets than LLVM.</li>
|
<li>GCC supports more targets than LLVM.</li>
|
||||||
<li>GCC supports many language extensions, some of which are not implemented
|
<li>GCC supports many language extensions, some of which are not implemented
|
||||||
by Clang. For instance, in C mode, GCC supports
|
by Clang. For instance, in C mode, GCC supports
|
||||||
<a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html">nested
|
<a href="https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html">nested
|
||||||
functions</a> and has an
|
functions</a> and has an
|
||||||
<a href="https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html">extension
|
<a href="https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html">extension
|
||||||
allowing VLAs in structs</a>.
|
allowing VLAs in structs</a>.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Pro's of Clang vs GCC:</p>
|
<p>Pro's of Clang vs GCC:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>The Clang ASTs and design are intended to be <a
|
<li>The Clang ASTs and design are intended to be <a
|
||||||
href="features.html#simplecode">easily understandable</a> by
|
href="features.html#simplecode">easily understandable</a> by
|
||||||
anyone who is familiar with the languages involved and who has a basic
|
anyone who is familiar with the languages involved and who has a basic
|
||||||
understanding of how a compiler works. GCC has a very old codebase
|
understanding of how a compiler works. GCC has a very old codebase
|
||||||
@ -71,9 +71,9 @@
|
|||||||
by source analysis tools, refactoring, IDEs (etc) as well as for code
|
by source analysis tools, refactoring, IDEs (etc) as well as for code
|
||||||
generation. GCC is built as a monolithic static compiler, which makes
|
generation. GCC is built as a monolithic static compiler, which makes
|
||||||
it extremely difficult to use as an API and integrate into other tools.
|
it extremely difficult to use as an API and integrate into other tools.
|
||||||
Further, its historic design and <a
|
Further, its historic design and <a
|
||||||
href="http://gcc.gnu.org/ml/gcc/2007-11/msg00460.html">current</a>
|
href="https://gcc.gnu.org/ml/gcc/2007-11/msg00460.html">current</a>
|
||||||
<a href="http://gcc.gnu.org/ml/gcc/2004-12/msg00888.html">policy</a>
|
<a href="https://gcc.gnu.org/ml/gcc/2004-12/msg00888.html">policy</a>
|
||||||
makes it difficult to decouple the front-end from the rest of the
|
makes it difficult to decouple the front-end from the rest of the
|
||||||
compiler. </li>
|
compiler. </li>
|
||||||
<li>Various GCC design decisions make it very difficult to reuse: its build
|
<li>Various GCC design decisions make it very difficult to reuse: its build
|
||||||
@ -87,11 +87,11 @@
|
|||||||
example, if you write "x-x" in your source code, the GCC AST will
|
example, if you write "x-x" in your source code, the GCC AST will
|
||||||
contain "0", with no mention of 'x'. This is extremely bad for a
|
contain "0", with no mention of 'x'. This is extremely bad for a
|
||||||
refactoring tool that wants to rename 'x'.</li>
|
refactoring tool that wants to rename 'x'.</li>
|
||||||
<li>Clang can serialize its AST out to disk and read it back into another
|
<li>Clang can serialize its AST out to disk and read it back into another
|
||||||
program, which is useful for whole program analysis. GCC does not have
|
program, which is useful for whole program analysis. GCC does not have
|
||||||
this. GCC's PCH mechanism (which is just a dump of the compiler
|
this. GCC's PCH mechanism (which is just a dump of the compiler
|
||||||
memory image) is related, but is architecturally only
|
memory image) is related, but is architecturally only
|
||||||
able to read the dump back into the exact same executable as the one
|
able to read the dump back into the exact same executable as the one
|
||||||
that produced it (it is not a structured format).</li>
|
that produced it (it is not a structured format).</li>
|
||||||
<li>Clang is <a href="features.html#performance">much faster and uses far
|
<li>Clang is <a href="features.html#performance">much faster and uses far
|
||||||
less memory</a> than GCC.</li>
|
less memory</a> than GCC.</li>
|
||||||
@ -112,7 +112,7 @@
|
|||||||
<li><a href="compatibility.html#cxx">Clang's support for C++</a> is more
|
<li><a href="compatibility.html#cxx">Clang's support for C++</a> is more
|
||||||
compliant than GCC's in many ways.</li>
|
compliant than GCC's in many ways.</li>
|
||||||
<li>Clang supports
|
<li>Clang supports
|
||||||
<a href="http://clang.llvm.org/docs/LanguageExtensions.html">many language
|
<a href="https://clang.llvm.org/docs/LanguageExtensions.html">many language
|
||||||
extensions</a>, some of which are not implemented by GCC. For instance,
|
extensions</a>, some of which are not implemented by GCC. For instance,
|
||||||
Clang provides attributes for checking thread safety and extended vector
|
Clang provides attributes for checking thread safety and extended vector
|
||||||
types.</li>
|
types.</li>
|
||||||
@ -121,22 +121,22 @@
|
|||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
<h2><a name="elsa">Clang vs Elsa (Elkhound-based C++ Parser)</a></h2>
|
<h2><a name="elsa">Clang vs Elsa (Elkhound-based C++ Parser)</a></h2>
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>Pro's of Elsa vs Clang:</p>
|
<p>Pro's of Elsa vs Clang:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Elsa's parser and AST is designed to be easily extensible by adding
|
<li>Elsa's parser and AST is designed to be easily extensible by adding
|
||||||
grammar rules. Clang has a very simple and easily hackable parser,
|
grammar rules. Clang has a very simple and easily hackable parser,
|
||||||
but requires you to write C++ code to do it.</li>
|
but requires you to write C++ code to do it.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Pro's of Clang vs Elsa:</p>
|
<p>Pro's of Clang vs Elsa:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Clang's C and C++ support is far more mature and practically useful than
|
<li>Clang's C and C++ support is far more mature and practically useful than
|
||||||
Elsa's, and includes many C++'11 features.</li>
|
Elsa's, and includes many C++'11 features.</li>
|
||||||
<li>The Elsa community is extremely small and major development work seems
|
<li>The Elsa community is extremely small and major development work seems
|
||||||
to have ceased in 2005. Work continued to be used by other small
|
to have ceased in 2005. Work continued to be used by other small
|
||||||
projects (e.g. Oink), but Oink is apparently dead now too. Clang has a
|
projects (e.g. Oink), but Oink is apparently dead now too. Clang has a
|
||||||
vibrant community including developers that
|
vibrant community including developers that
|
||||||
are paid to work on it full time. In practice this means that you can
|
are paid to work on it full time. In practice this means that you can
|
||||||
@ -152,7 +152,7 @@
|
|||||||
difficult to accurately map from a source location in the AST back to
|
difficult to accurately map from a source location in the AST back to
|
||||||
its original position before preprocessing. Like GCC, it does not keep
|
its original position before preprocessing. Like GCC, it does not keep
|
||||||
track of macro expansions.</li>
|
track of macro expansions.</li>
|
||||||
<li>Elsa is even slower and uses more memory than GCC, which itself requires
|
<li>Elsa is even slower and uses more memory than GCC, which itself requires
|
||||||
far more space and time than Clang.</li>
|
far more space and time than Clang.</li>
|
||||||
<li>Elsa only does partial semantic analysis. It is intended to work on
|
<li>Elsa only does partial semantic analysis. It is intended to work on
|
||||||
code that is already validated by GCC, so it does not do many semantic
|
code that is already validated by GCC, so it does not do many semantic
|
||||||
@ -160,21 +160,21 @@
|
|||||||
<li>Elsa does not support Objective-C.</li>
|
<li>Elsa does not support Objective-C.</li>
|
||||||
<li>Elsa does not support native code generation.</li>
|
<li>Elsa does not support native code generation.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
<h2><a name="pcc">Clang vs PCC (Portable C Compiler)</a></h2>
|
<h2><a name="pcc">Clang vs PCC (Portable C Compiler)</a></h2>
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>Pro's of PCC vs Clang:</p>
|
<p>Pro's of PCC vs Clang:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>The PCC source base is very small and builds quickly with just a C
|
<li>The PCC source base is very small and builds quickly with just a C
|
||||||
compiler.</li>
|
compiler.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Pro's of Clang vs PCC:</p>
|
<p>Pro's of Clang vs PCC:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>PCC dates from the 1970's and has been dormant for most of that time.
|
<li>PCC dates from the 1970's and has been dormant for most of that time.
|
||||||
The Clang and LLVM communities are very active.</li>
|
The Clang and LLVM communities are very active.</li>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
compilers allow. This page documents common compatibility and
|
compilers allow. This page documents common compatibility and
|
||||||
portability issues with Clang to help you understand and fix the
|
portability issues with Clang to help you understand and fix the
|
||||||
problem in your code when Clang emits an error message.</p>
|
problem in your code when Clang emits an error message.</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#c">C compatibility</a>
|
<li><a href="#c">C compatibility</a>
|
||||||
<ul>
|
<ul>
|
||||||
@ -153,9 +153,9 @@ in C++ is very different from its meaning in either GNU89 or C99.</p>
|
|||||||
header files, which define a standardized API for accessing vector operations
|
header files, which define a standardized API for accessing vector operations
|
||||||
on X86 CPUs. These functions have names like <tt>_mm_xor_ps</tt> and
|
on X86 CPUs. These functions have names like <tt>_mm_xor_ps</tt> and
|
||||||
<tt>_mm256_addsub_pd</tt>. Compilers have leeway to implement these functions
|
<tt>_mm256_addsub_pd</tt>. Compilers have leeway to implement these functions
|
||||||
however they want. Since Clang supports an excellent set of <a
|
however they want. Since Clang supports an excellent set of <a
|
||||||
href="../docs/LanguageExtensions.html#vectors">native vector operations</a>,
|
href="../docs/LanguageExtensions.html#vectors">native vector operations</a>,
|
||||||
the Clang headers implement these interfaces in terms of the native vector
|
the Clang headers implement these interfaces in terms of the native vector
|
||||||
operations.
|
operations.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ within these declarations unless they are marked <code>extern</code>.</p>
|
|||||||
@interface XX
|
@interface XX
|
||||||
int a; // not allowed in clang
|
int a; // not allowed in clang
|
||||||
int b = 1; // not allowed in clang
|
int b = 1; // not allowed in clang
|
||||||
extern int c; // allowed
|
extern int c; // allowed
|
||||||
@end
|
@end
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
@ -784,7 +784,7 @@ void g(X x) {
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>This affects some early C++11 code, including Boost's popular <a
|
<p>This affects some early C++11 code, including Boost's popular <a
|
||||||
href="http://www.boost.org/doc/libs/release/libs/smart_ptr/shared_ptr.htm"><tt>shared_ptr</tt></a>
|
href="https://www.boost.org/doc/libs/release/libs/smart_ptr/shared_ptr.htm"><tt>shared_ptr</tt></a>
|
||||||
up to version 1.47.0. The fix for Boost's <tt>shared_ptr</tt> is
|
up to version 1.47.0. The fix for Boost's <tt>shared_ptr</tt> is
|
||||||
<a href="https://svn.boost.org/trac/boost/changeset/73202">available here</a>.</p>
|
<a href="https://svn.boost.org/trac/boost/changeset/73202">available here</a>.</p>
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<!-- ======================================================================= -->
|
<!-- ======================================================================= -->
|
||||||
|
|
||||||
<p>The Clang C++ compatibility page has moved. You will be directed <a href="compatibility.html#c++">to its new home</a> in 5 seconds.</p>
|
<p>The Clang C++ compatibility page has moved. You will be directed <a href="compatibility.html#c++">to its new home</a> in 5 seconds.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,7 @@ Demo page information
|
|||||||
|
|
||||||
<h1>Demo page information</h1>
|
<h1>Demo page information</h1>
|
||||||
|
|
||||||
<p>Press "back" or <a href=".">click here</a> to return to the demo
|
<p>Press "back" or <a href=".">click here</a> to return to the demo
|
||||||
page.</p>
|
page.</p>
|
||||||
|
|
||||||
<h2><a name="hints">Hints and Advice</a></h2>
|
<h2><a name="hints">Hints and Advice</a></h2>
|
||||||
@ -19,7 +19,7 @@ page.</p>
|
|||||||
<li>The generated LLVM code will be easier to read if
|
<li>The generated LLVM code will be easier to read if
|
||||||
you use stdio (e.g., printf) than iostreams (e.g., std::cout).</li>
|
you use stdio (e.g., printf) than iostreams (e.g., std::cout).</li>
|
||||||
|
|
||||||
<li>Unused inline functions and methods are not generated. Instead
|
<li>Unused inline functions and methods are not generated. Instead
|
||||||
of '<tt>class foo { void bar() {}};</tt>',
|
of '<tt>class foo { void bar() {}};</tt>',
|
||||||
try writing '<tt>class foo { void bar(); }; void foo::bar() {}</tt>'.</li>
|
try writing '<tt>class foo { void bar(); }; void foo::bar() {}</tt>'.</li>
|
||||||
|
|
||||||
@ -33,9 +33,9 @@ try writing '<tt>class foo { void bar(); }; void foo::bar() {}</tt>'.</li>
|
|||||||
<h2><a name="demangle">Demangle C++ names with C++ filt</a></h2>
|
<h2><a name="demangle">Demangle C++ names with C++ filt</a></h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Select this option if you want to run the output LLVM IR through "c++filt",
|
Select this option if you want to run the output LLVM IR through "c++filt",
|
||||||
which converts 'mangled' C++ names to their unmangled version.
|
which converts 'mangled' C++ names to their unmangled version.
|
||||||
Note that LLVM code produced will not be lexically valid, but it will
|
Note that LLVM code produced will not be lexically valid, but it will
|
||||||
be easier to understand.
|
be easier to understand.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -45,11 +45,11 @@ be easier to understand.
|
|||||||
Select this option to run the LLVM link-time optimizer, which is designed to
|
Select this option to run the LLVM link-time optimizer, which is designed to
|
||||||
optimize across files in your application. Since the demo page doesn't allow
|
optimize across files in your application. Since the demo page doesn't allow
|
||||||
you to upload multiple files at once, and does not link in any libraries, we
|
you to upload multiple files at once, and does not link in any libraries, we
|
||||||
configured the demo page optimizer to assume there are no calls
|
configured the demo page optimizer to assume there are no calls
|
||||||
coming in from outside the source file, allowing it to optimize more
|
coming in from outside the source file, allowing it to optimize more
|
||||||
aggressively.</p>
|
aggressively.</p>
|
||||||
|
|
||||||
<p>Note that you have to define 'main' in your program for this
|
<p>Note that you have to define 'main' in your program for this
|
||||||
to make much of a difference.
|
to make much of a difference.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ optimizers.</p>
|
|||||||
<h2><a name="bcanalyzer">Analyze generated bytecode</a></h2>
|
<h2><a name="bcanalyzer">Analyze generated bytecode</a></h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Select this option to run the <a
|
Select this option to run the <a
|
||||||
href="http://llvm.org/cmds/llvm-bcanalyzer.html">llvm-bcanalyzer</a> tool
|
href="https://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html">llvm-bcanalyzer</a> tool
|
||||||
on the generated bytecode, which introspects into the format of the .bc file
|
on the generated bytecode, which introspects into the format of the .bc file
|
||||||
itself. </p>
|
itself. </p>
|
||||||
|
|
||||||
@ -72,12 +72,11 @@ itself. </p>
|
|||||||
<h2><a name="llvm2cpp">Show C++ API code</a></h2>
|
<h2><a name="llvm2cpp">Show C++ API code</a></h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Select this option to run the <a
|
Select this option to run the <a
|
||||||
href="http://llvm.org/cmds/llvm2cpp.html">llvm2cpp</a> tool
|
href="https://llvm.org/cmds/llvm2cpp.html">llvm2cpp</a> tool
|
||||||
on the generated bytecode, which auto generates the C++ API calls that could
|
on the generated bytecode, which auto generates the C++ API calls that could
|
||||||
be used to create the .bc file.
|
be used to create the .bc file.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ information highlights the left and right side of the plus which makes it
|
|||||||
immediately obvious what the compiler is talking about, which is very useful for
|
immediately obvious what the compiler is talking about, which is very useful for
|
||||||
cases involving precedence issues and many other situations.</p>
|
cases involving precedence issues and many other situations.</p>
|
||||||
|
|
||||||
<p>Clang diagnostics are very polished and have many features. For more
|
<p>Clang diagnostics are very polished and have many features. For more
|
||||||
information and examples, please see the <a href="diagnostics.html">Expressive
|
information and examples, please see the <a href="diagnostics.html">Expressive
|
||||||
Diagnostics</a> page.</p>
|
Diagnostics</a> page.</p>
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ Diagnostics</a> page.</p>
|
|||||||
|
|
||||||
<p>GCC is currently the defacto-standard open source compiler today, and it
|
<p>GCC is currently the defacto-standard open source compiler today, and it
|
||||||
routinely compiles a huge volume of code. GCC supports a huge number of
|
routinely compiles a huge volume of code. GCC supports a huge number of
|
||||||
extensions and features (many of which are undocumented) and a lot of
|
extensions and features (many of which are undocumented) and a lot of
|
||||||
code and header files depend on these features in order to build.</p>
|
code and header files depend on these features in order to build.</p>
|
||||||
|
|
||||||
<p>While it would be nice to be able to ignore these extensions and focus on
|
<p>While it would be nice to be able to ignore these extensions and focus on
|
||||||
@ -236,7 +236,7 @@ unnecessary for a simple static compiler.</p>
|
|||||||
In particular, it is possible to use the clang preprocessor and parser to build
|
In particular, it is possible to use the clang preprocessor and parser to build
|
||||||
an extremely quick and light-weight on-the-fly code generator (similar to TCC)
|
an extremely quick and light-weight on-the-fly code generator (similar to TCC)
|
||||||
that does not build an AST at all. As an intermediate step, clang supports
|
that does not build an AST at all. As an intermediate step, clang supports
|
||||||
using the current AST generation and semantic analysis code and having a code
|
using the current AST generation and semantic analysis code and having a code
|
||||||
generation client free the AST for each function after code generation. Finally,
|
generation client free the AST for each function after code generation. Finally,
|
||||||
clang provides support for building and retaining fully-fledged ASTs, and even
|
clang provides support for building and retaining fully-fledged ASTs, and even
|
||||||
supports writing them out to disk.</p>
|
supports writing them out to disk.</p>
|
||||||
@ -289,8 +289,8 @@ Further, nobody makes money on compilers these days, but many people need them
|
|||||||
to get bigger goals accomplished: it makes sense for everyone to work
|
to get bigger goals accomplished: it makes sense for everyone to work
|
||||||
together.</p>
|
together.</p>
|
||||||
|
|
||||||
<p>For more information about the LLVM/clang license, please see the <a
|
<p>For more information about the LLVM/clang license, please see the <a
|
||||||
href="http://llvm.org/docs/DeveloperPolicy.html#license">LLVM License
|
href="https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents">LLVM License
|
||||||
Description</a> for more information.</p>
|
Description</a> for more information.</p>
|
||||||
|
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ Description</a> for more information.</p>
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Clang is designed and built by experienced compiler developers who
|
Clang is designed and built by experienced compiler developers who
|
||||||
are increasingly frustrated with the problems that <a
|
are increasingly frustrated with the problems that <a
|
||||||
href="comparison.html">existing open source compilers</a> have. Clang is
|
href="comparison.html">existing open source compilers</a> have. Clang is
|
||||||
carefully and thoughtfully designed and built to provide the foundation of a
|
carefully and thoughtfully designed and built to provide the foundation of a
|
||||||
whole new generation of C/C++/Objective C development tools, and we intend for
|
whole new generation of C/C++/Objective C development tools, and we intend for
|
||||||
|
@ -28,15 +28,15 @@ to author patches.
|
|||||||
|
|
||||||
<h2>Follow what's going on</h2>
|
<h2>Follow what's going on</h2>
|
||||||
|
|
||||||
<p>Clang is a subproject of the <a href="http://llvm.org">LLVM Project</a>, but
|
<p>Clang is a subproject of the <a href="https://llvm.org">LLVM Project</a>, but
|
||||||
has its own mailing lists because the communities have people with different
|
has its own mailing lists because the communities have people with different
|
||||||
interests. The two clang lists are:</p>
|
interests. The two clang lists are:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits
|
<li><a href="https://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits
|
||||||
</a> - This list is for patch submission/discussion.</li>
|
</a> - This list is for patch submission/discussion.</li>
|
||||||
|
|
||||||
<li><a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a> -
|
<li><a href="https://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a> -
|
||||||
This list is for everything else Clang related (questions and answers, design
|
This list is for everything else Clang related (questions and answers, design
|
||||||
discussions, etc).</li>
|
discussions, etc).</li>
|
||||||
|
|
||||||
@ -44,18 +44,18 @@ discussions, etc).</li>
|
|||||||
|
|
||||||
<p>If you are interested in clang only, these two lists should be all
|
<p>If you are interested in clang only, these two lists should be all
|
||||||
you need. If you are interested in the LLVM optimizer and code generator,
|
you need. If you are interested in the LLVM optimizer and code generator,
|
||||||
please consider signing up for <a
|
please consider signing up for <a
|
||||||
href="http://lists.llvm.org/mailman/listinfo/llvm-dev">llvm-dev</a> and <a
|
href="https://lists.llvm.org/mailman/listinfo/llvm-dev">llvm-dev</a> and <a
|
||||||
href="http://lists.llvm.org/mailman/listinfo/llvm-commits">llvm-commits</a>
|
href="https://lists.llvm.org/mailman/listinfo/llvm-commits">llvm-commits</a>
|
||||||
as well.</p>
|
as well.</p>
|
||||||
|
|
||||||
|
|
||||||
<p>The most common way to talk with other developers on the project is through
|
<p>The most common way to talk with other developers on the project is through
|
||||||
the <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev mailing
|
the <a href="https://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev mailing
|
||||||
list</a>. The clang mailing list is a very friendly place and we welcome
|
list</a>. The clang mailing list is a very friendly place and we welcome
|
||||||
newcomers. In addition to the cfe-dev list, a significant amount of design
|
newcomers. In addition to the cfe-dev list, a significant amount of design
|
||||||
discussion takes place on the <a
|
discussion takes place on the <a
|
||||||
href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits mailing
|
href="https://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits mailing
|
||||||
list</a>. All of these lists have archives, so you can browse through previous
|
list</a>. All of these lists have archives, so you can browse through previous
|
||||||
discussions or follow the list development on the web if you prefer.</p>
|
discussions or follow the list development on the web if you prefer.</p>
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@ follows:</p>
|
|||||||
<a href="https://llvm.org/docs/GettingStarted.html#requirements">
|
<a href="https://llvm.org/docs/GettingStarted.html#requirements">
|
||||||
Getting Started with the LLVM System - Requirements</a>.</li>
|
Getting Started with the LLVM System - Requirements</a>.</li>
|
||||||
<li>Note also that Python is needed for running the test suite.
|
<li>Note also that Python is needed for running the test suite.
|
||||||
Get it at: <a href="http://www.python.org/download">
|
Get it at: <a href="https://www.python.org/downloads/">
|
||||||
http://www.python.org/download</a></li>
|
https://www.python.org/downloads/</a></li>
|
||||||
<li>Standard build process uses CMake. Get it at:
|
<li>Standard build process uses CMake. Get it at:
|
||||||
<a href="http://www.cmake.org/download">
|
<a href="https://cmake.org/download/">
|
||||||
http://www.cmake.org/download</a></li>
|
https://cmake.org/download/</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<li>Check out the LLVM project:
|
<li>Check out the LLVM project:
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>Clang follows the
|
<p>Clang follows the
|
||||||
LLVM <a href="http://llvm.org/docs/CodingStandards.html">Coding
|
LLVM <a href="https://llvm.org/docs/CodingStandards.html">Coding
|
||||||
Standards</a>. When submitting patches, please take care to follow these standards
|
Standards</a>. When submitting patches, please take care to follow these standards
|
||||||
and to match the style of the code to that present in Clang (for example, in
|
and to match the style of the code to that present in Clang (for example, in
|
||||||
terms of indentation, bracing, and statement spacing).</p>
|
terms of indentation, bracing, and statement spacing).</p>
|
||||||
@ -53,7 +53,7 @@
|
|||||||
use <tt>llvm::errs()</tt>. Other uses of <tt>cstdio</tt> impose behavior
|
use <tt>llvm::errs()</tt>. Other uses of <tt>cstdio</tt> impose behavior
|
||||||
upon clients and block integrating Clang as a library. Libraries should
|
upon clients and block integrating Clang as a library. Libraries should
|
||||||
support <tt>raw_ostream</tt> based interfaces for textual
|
support <tt>raw_ostream</tt> based interfaces for textual
|
||||||
output. See <a href="http://llvm.org/docs/CodingStandards.html#ll_raw_ostream">Coding
|
output. See <a href="https://llvm.org/docs/CodingStandards.html#use-raw-ostream">Coding
|
||||||
Standards</a>.</li>
|
Standards</a>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -64,12 +64,12 @@
|
|||||||
<p>Both Clang and LLVM use doxygen to provide API documentation. Their
|
<p>Both Clang and LLVM use doxygen to provide API documentation. Their
|
||||||
respective web pages (generated nightly) are here:</p>
|
respective web pages (generated nightly) are here:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://clang.llvm.org/doxygen">Clang</a></li>
|
<li><a href="https://clang.llvm.org/doxygen">Clang</a></li>
|
||||||
<li><a href="http://llvm.org/doxygen">LLVM</a></li>
|
<li><a href="https://llvm.org/doxygen">LLVM</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>For work on the LLVM IR generation, the LLVM assembly language
|
<p>For work on the LLVM IR generation, the LLVM assembly language
|
||||||
<a href="http://llvm.org/docs/LangRef.html">reference manual</a> is
|
<a href="https://llvm.org/docs/LangRef.html">reference manual</a> is
|
||||||
also useful.</p>
|
also useful.</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
@ -87,7 +87,7 @@
|
|||||||
the <tt>isConstQualified()</tt>, for example, to get one of the
|
the <tt>isConstQualified()</tt>, for example, to get one of the
|
||||||
qualifiers, and the <tt>getTypePtr()</tt> method to get the
|
qualifiers, and the <tt>getTypePtr()</tt> method to get the
|
||||||
wrapped <tt>Type*</tt> which you can then dump.</li>
|
wrapped <tt>Type*</tt> which you can then dump.</li>
|
||||||
<li>For <a href="http://lldb.llvm.org"> <tt>LLDB</tt></a> users there are
|
<li>For <a href="https://lldb.llvm.org"> <tt>LLDB</tt></a> users there are
|
||||||
data formatters for clang data structures in
|
data formatters for clang data structures in
|
||||||
<a href="https://github.com/llvm/llvm-project/blob/master/clang/utils/ClangDataFormat.py">
|
<a href="https://github.com/llvm/llvm-project/blob/master/clang/utils/ClangDataFormat.py">
|
||||||
<tt>clang/utils/ClangDataFormat.py</tt></a>.</li>
|
<tt>clang/utils/ClangDataFormat.py</tt></a>.</li>
|
||||||
@ -164,7 +164,7 @@
|
|||||||
<tt>make test VG=1</tt> in the top-level clang directory.</p>
|
<tt>make test VG=1</tt> in the top-level clang directory.</p>
|
||||||
|
|
||||||
<p>For more intensive changes, running
|
<p>For more intensive changes, running
|
||||||
the <a href="http://llvm.org/docs/TestingGuide.html#testsuiterun">LLVM
|
the <a href="https://llvm.org/docs/TestingGuide.html#quick-start">LLVM
|
||||||
Test Suite</a> with clang is recommended. Currently the best way to
|
Test Suite</a> with clang is recommended. Currently the best way to
|
||||||
override LLVMGCC, as in: <tt>make LLVMGCC="clang -std=gnu89"
|
override LLVMGCC, as in: <tt>make LLVMGCC="clang -std=gnu89"
|
||||||
TEST=nightly report</tt> (make sure <tt>clang</tt> is in your PATH or use the
|
TEST=nightly report</tt> (make sure <tt>clang</tt> is in your PATH or use the
|
||||||
@ -179,7 +179,7 @@
|
|||||||
|
|
||||||
<p>Note that the test runner is based on
|
<p>Note that the test runner is based on
|
||||||
Python, which must be installed. Find Python at:
|
Python, which must be installed. Find Python at:
|
||||||
<a href="http://www.python.org/download/">http://www.python.org/download/</a>.
|
<a href="https://www.python.org/downloads/">https://www.python.org/downloads/</a>.
|
||||||
Download the latest stable version.</p>
|
Download the latest stable version.</p>
|
||||||
|
|
||||||
<p>The GnuWin32 tools are also necessary for running the tests.
|
<p>The GnuWin32 tools are also necessary for running the tests.
|
||||||
@ -197,9 +197,9 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Please see also
|
Please see also
|
||||||
<a href="http://llvm.org/docs/GettingStartedVS.html">Getting Started
|
<a href="https://llvm.org/docs/GettingStartedVS.html">Getting Started
|
||||||
with the LLVM System using Microsoft Visual Studio</a> and
|
with the LLVM System using Microsoft Visual Studio</a> and
|
||||||
<a href="http://llvm.org/docs/CMake.html">Building LLVM with CMake</a>.
|
<a href="https://llvm.org/docs/CMake.html">Building LLVM with CMake</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
@ -278,7 +278,7 @@ Testing Time: 81.52s
|
|||||||
<p>To return changes to the Clang team, unless you have checkin
|
<p>To return changes to the Clang team, unless you have checkin
|
||||||
privileges, the preferred way is to send patch files
|
privileges, the preferred way is to send patch files
|
||||||
<a href="https://llvm.org/docs/Contributing.html#how-to-submit-a-patch">using LLVM's Phabricator</a> with an explanation of what the patch is for. Clang follows <a
|
<a href="https://llvm.org/docs/Contributing.html#how-to-submit-a-patch">using LLVM's Phabricator</a> with an explanation of what the patch is for. Clang follows <a
|
||||||
href="http://llvm.org/docs/DeveloperPolicy.html">LLVM's developer policy</a>.
|
href="https://llvm.org/docs/DeveloperPolicy.html">LLVM's developer policy</a>.
|
||||||
If your patch requires a wider discussion (for example, because it is an
|
If your patch requires a wider discussion (for example, because it is an
|
||||||
architectural change), you can use the cfe-dev mailing list.</p>
|
architectural change), you can use the cfe-dev mailing list.</p>
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ Testing Time: 81.52s
|
|||||||
can also use <tt>-emit-llvm-bc</tt> to write an LLVM bitcode file
|
can also use <tt>-emit-llvm-bc</tt> to write an LLVM bitcode file
|
||||||
which can be processed by the suite of LLVM tools
|
which can be processed by the suite of LLVM tools
|
||||||
like <tt>llvm-dis</tt>, <tt>llvm-nm</tt>, etc. See the LLVM
|
like <tt>llvm-dis</tt>, <tt>llvm-nm</tt>, etc. See the LLVM
|
||||||
<a href="http://llvm.org/docs/CommandGuide/">Command Guide</a>
|
<a href="https://llvm.org/docs/CommandGuide/">Command Guide</a>
|
||||||
for more information.</p>
|
for more information.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<p>The Clang project provides a language front-end and tooling infrastructure
|
<p>The Clang project provides a language front-end and tooling infrastructure
|
||||||
for languages in the C language family (C, C++, Objective C/C++, OpenCL,
|
for languages in the C language family (C, C++, Objective C/C++, OpenCL,
|
||||||
CUDA, and RenderScript) for the <a href="http://www.llvm.org/">LLVM</a>
|
CUDA, and RenderScript) for the <a href="https://www.llvm.org/">LLVM</a>
|
||||||
project. Both a GCC-compatible compiler driver (<tt>clang</tt>) and an
|
project. Both a GCC-compatible compiler driver (<tt>clang</tt>) and an
|
||||||
MSVC-compatible compiler driver (<tt>clang-cl.exe</tt>) are provided. You
|
MSVC-compatible compiler driver (<tt>clang-cl.exe</tt>) are provided. You
|
||||||
can <a href="get_started.html">get and build</a> the source today.</p>
|
can <a href="get_started.html">get and build</a> the source today.</p>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
||||||
<html>
|
<html>
|
||||||
@ -27,8 +27,8 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
<b>Site:</b>
|
<b>Site:</b>
|
||||||
<a href="http://wiki.freebsd.org/BuildingFreeBSDWithClang">
|
<a href="https://wiki.freebsd.org/BuildingFreeBSDWithClang">
|
||||||
http://wiki.freebsd.org/BuildingFreeBSDWithClang</a>
|
https://wiki.freebsd.org/BuildingFreeBSDWithClang</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This is an effort to get FreeBSD to build with clang/llvm.
|
This is an effort to get FreeBSD to build with clang/llvm.
|
||||||
@ -51,9 +51,9 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
<b>Sites:</b><br />
|
<b>Sites:</b><br />
|
||||||
<a href="http://clang.debian.net/">http://clang.debian.net/</a><br />
|
<a href="https://clang.debian.net/">https://clang.debian.net/</a><br />
|
||||||
<a href="http://wiki.debian.org/llvm-clang">
|
<a href="https://wiki.debian.org/llvm-clang">
|
||||||
http://wiki.debian.org/llvm-clang</a>
|
https://wiki.debian.org/llvm-clang</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Notes on using Clang to rebuild the whole Debian archive.
|
Notes on using Clang to rebuild the whole Debian archive.
|
||||||
@ -97,7 +97,7 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
<b>Site:</b>
|
<b>Site:</b>
|
||||||
<a href="http://github.com/Ericsson/CodeCompass">http://github.com/Ericsson/CodeCompass</a>
|
<a href="https://github.com/Ericsson/CodeCompass">https://github.com/Ericsson/CodeCompass</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
CodeCompass is an open-source, extensible code comprehension framework which uses LLVM/Clang to analyze and visualize C and C++ projects. It also supports both regex-based text search, discovering complex C/C++ language elements, with advanced navigation and visualisation.
|
CodeCompass is an open-source, extensible code comprehension framework which uses LLVM/Clang to analyze and visualize C and C++ projects. It also supports both regex-based text search, discovering complex C/C++ language elements, with advanced navigation and visualisation.
|
||||||
@ -108,7 +108,7 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<p>
|
<p>
|
||||||
<b>Site:</b>
|
<b>Site:</b>
|
||||||
<a href="http://github.com/Ericsson/CodeChecker">http://github.com/Ericsson/CodeChecker</a>
|
<a href="https://github.com/Ericsson/CodeChecker">https://github.com/Ericsson/CodeChecker</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
CodeChecker is a static analysis infrastructure built on the LLVM/Clang Static Analyzer toolchain. It provides a user interface to execute analysis of C/C++ projects with Clang SA and Clang-Tidy, which outputs are then stored into a database navigable via a web application. This web application and a corresponding command-line tool supports a variety of report management and issue triaging options, such as difference view between analyses, automatic incremental analysis, marking and commenting on individual reports.
|
CodeChecker is a static analysis infrastructure built on the LLVM/Clang Static Analyzer toolchain. It provides a user interface to execute analysis of C/C++ projects with Clang SA and Clang-Tidy, which outputs are then stored into a database navigable via a web application. This web application and a corresponding command-line tool supports a variety of report management and issue triaging options, such as difference view between analyses, automatic incremental analysis, marking and commenting on individual reports.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
||||||
<html>
|
<html>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<!--*********************************************************************-->
|
<!--*********************************************************************-->
|
||||||
<h1>"compiler-rt" runtime libraries</h1>
|
<h1>"compiler-rt" runtime libraries</h1>
|
||||||
<!--*********************************************************************-->
|
<!--*********************************************************************-->
|
||||||
|
|
||||||
<p>The compiler-rt project consists of:
|
<p>The compiler-rt project consists of:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@ -36,12 +36,12 @@
|
|||||||
<b>sanitizer runtimes</b> - runtime libraries that are required to run
|
<b>sanitizer runtimes</b> - runtime libraries that are required to run
|
||||||
the code with sanitizer instrumentation. This includes runtimes for:
|
the code with sanitizer instrumentation. This includes runtimes for:
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="http://clang.llvm.org/docs/AddressSanitizer.html">AddressSanitizer</a></li>
|
<li><a href="https://clang.llvm.org/docs/AddressSanitizer.html">AddressSanitizer</a></li>
|
||||||
<li><a href="http://clang.llvm.org/docs/ThreadSanitizer.html">ThreadSanitizer</a></li>
|
<li><a href="https://clang.llvm.org/docs/ThreadSanitizer.html">ThreadSanitizer</a></li>
|
||||||
<li><a href="http://clang.llvm.org/docs/UsersManual.html#opt-fsanitize-undefined">UndefinedBehaviorSanitizer</a></li>
|
<li><a href="https://clang.llvm.org/docs/UsersManual.html#opt-fsanitize-undefined">UndefinedBehaviorSanitizer</a></li>
|
||||||
<li><a href="http://clang.llvm.org/docs/MemorySanitizer.html">MemorySanitizer</a></li>
|
<li><a href="https://clang.llvm.org/docs/MemorySanitizer.html">MemorySanitizer</a></li>
|
||||||
<li><a href="http://clang.llvm.org/docs/LeakSanitizer.html">LeakSanitizer</a></li>
|
<li><a href="https://clang.llvm.org/docs/LeakSanitizer.html">LeakSanitizer</a></li>
|
||||||
<li><a href="http://clang.llvm.org/docs/DataFlowSanitizer.html">DataFlowSanitizer</a></li>
|
<li><a href="https://clang.llvm.org/docs/DataFlowSanitizer.html">DataFlowSanitizer</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -54,8 +54,8 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>All of the code in the compiler-rt project is <a
|
<p>All of the code in the compiler-rt project is <a
|
||||||
href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
|
href="https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents">dual licensed</a>
|
||||||
under the MIT license and the UIUC License (a BSD-like license).</p>
|
under the MIT license and the UIUC License (a BSD-like license).</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
@ -63,13 +63,13 @@
|
|||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>Currently compiler-rt is primarily used by
|
<p>Currently compiler-rt is primarily used by
|
||||||
the <a href="http://clang.llvm.org">Clang</a>
|
the <a href="https://clang.llvm.org">Clang</a>
|
||||||
and <a href="http://llvm.org">LLVM</a> projects as the implementation for
|
and <a href="https://llvm.org">LLVM</a> projects as the implementation for
|
||||||
the runtime compiler support libraries. For more information on using
|
the runtime compiler support libraries. For more information on using
|
||||||
compiler-rt with Clang, please see the Clang
|
compiler-rt with Clang, please see the Clang
|
||||||
<a href="http://clang.llvm.org/get_started.html">Getting Started</a>
|
<a href="https://clang.llvm.org/get_started.html">Getting Started</a>
|
||||||
page.</p>
|
page.</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
<h2 id="requirements">Platform Support</h2>
|
<h2 id="requirements">Platform Support</h2>
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
@ -81,7 +81,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific
|
<p>Most sanitizer runtimes are supported only on Linux x86-64. See tool-specific
|
||||||
pages in <a href="http://clang.llvm.org/docs/index.html">Clang docs</a> for more
|
pages in <a href="https://clang.llvm.org/docs/index.html">Clang docs</a> for more
|
||||||
details.</p>
|
details.</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
@ -104,11 +104,11 @@
|
|||||||
for the supported architectures.</li>
|
for the supported architectures.</li>
|
||||||
<li> test/ contains test suites for compiler-rt runtimes.</li>
|
<li> test/ contains test suites for compiler-rt runtimes.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
<h2>Get it and get involved!</h2>
|
<h2>Get it and get involved!</h2>
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>Generally, you need to build LLVM/Clang in order to build compiler-rt. You
|
<p>Generally, you need to build LLVM/Clang in order to build compiler-rt. You
|
||||||
can build it either together with llvm and clang, or separately.
|
can build it either together with llvm and clang, or separately.
|
||||||
|
|
||||||
@ -116,7 +116,7 @@
|
|||||||
cmake.
|
cmake.
|
||||||
|
|
||||||
<p>To build it separately, first
|
<p>To build it separately, first
|
||||||
<a href="http://llvm.org/docs/CMake.html#quick-start">build LLVM</a>
|
<a href="https://llvm.org/docs/CMake.html#quick-start">build LLVM</a>
|
||||||
separately to get llvm-config binary, and then run:
|
separately to get llvm-config binary, and then run:
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Tests for sanitizer runtimes are ported to
|
<p>Tests for sanitizer runtimes are ported to
|
||||||
<a href="http://llvm.org/docs/CommandGuide/lit.html">llvm-lit</a> and are
|
<a href="https://llvm.org/docs/CommandGuide/lit.html">llvm-lit</a> and are
|
||||||
run by <b>make check-all</b> command in LLVM/Clang/compiler-rt build tree.</p>
|
run by <b>make check-all</b> command in LLVM/Clang/compiler-rt build tree.</p>
|
||||||
|
|
||||||
<p>compiler-rt libraries are installed to the system with <b>make install</b>
|
<p>compiler-rt libraries are installed to the system with <b>make install</b>
|
||||||
@ -137,10 +137,10 @@
|
|||||||
|
|
||||||
<p>compiler-rt doesn't have its own mailing list, if you have questions please
|
<p>compiler-rt doesn't have its own mailing list, if you have questions please
|
||||||
email the <a
|
email the <a
|
||||||
href="http://lists.llvm.org/mailman/listinfo/llvm-dev">llvm-dev</a> mailing
|
href="https://lists.llvm.org/mailman/listinfo/llvm-dev">llvm-dev</a> mailing
|
||||||
list. Commits to the compiler-rt SVN module are automatically sent to the
|
list. Commits to the compiler-rt SVN module are automatically sent to the
|
||||||
<a
|
<a
|
||||||
href="http://lists.llvm.org/mailman/listinfo/llvm-commits">llvm-commits</a>
|
href="https://lists.llvm.org/mailman/listinfo/llvm-commits">llvm-commits</a>
|
||||||
mailing list.</p>
|
mailing list.</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
libclc is an open source, BSD/MIT dual licensed
|
libclc is an open source, BSD/MIT dual licensed
|
||||||
implementation of the library requirements of the
|
implementation of the library requirements of the
|
||||||
OpenCL C programming language, as specified by the <a
|
OpenCL C programming language, as specified by the <a
|
||||||
href="http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf">OpenCL
|
href="https://www.khronos.org/registry/OpenCL/specs/opencl-1.1.pdf">OpenCL
|
||||||
1.1 Specification</a>. The following sections of the specification
|
1.1 Specification</a>. The following sections of the specification
|
||||||
impose library requirements:
|
impose library requirements:
|
||||||
<ul>
|
<ul>
|
||||||
@ -25,7 +25,7 @@ impose library requirements:
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
libclc is intended to be used with the <a href="http://clang.llvm.org/">Clang</a>
|
libclc is intended to be used with the <a href="https://clang.llvm.org/">Clang</a>
|
||||||
compiler's OpenCL frontend.
|
compiler's OpenCL frontend.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ support for more targets is welcome.
|
|||||||
|
|
||||||
<h2>Mailing List</h2>
|
<h2>Mailing List</h2>
|
||||||
|
|
||||||
libclc-dev@lists.llvm.org (<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev">subscribe/unsubscribe</a>, <a href="http://lists.llvm.org/pipermail/libclc-dev/">archives</a>)
|
libclc-dev@lists.llvm.org (<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev">subscribe/unsubscribe</a>, <a href="https://lists.llvm.org/pipermail/libclc-dev/">archives</a>)
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
C++11, C++14 and above.</p>
|
C++11, C++14 and above.</p>
|
||||||
|
|
||||||
<p>All of the code in libc++ is <a
|
<p>All of the code in libc++ is <a
|
||||||
href="https://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
|
href="https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents">dual licensed</a>
|
||||||
under the MIT license and the UIUC License (a BSD-like license).</p>
|
under the MIT license and the UIUC License (a BSD-like license).</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="menu">
|
<div id="menu">
|
||||||
<div>
|
<div>
|
||||||
<a href="http://llvm.org/">LLVM Home</a>
|
<a href="https://llvm.org/">LLVM Home</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="submenu">
|
<div class="submenu">
|
||||||
@ -23,9 +23,9 @@
|
|||||||
<div class="submenu">
|
<div class="submenu">
|
||||||
<label>Quick Links</label>
|
<label>Quick Links</label>
|
||||||
<a href="https://libcxx.llvm.org/">libc++</a>
|
<a href="https://libcxx.llvm.org/">libc++</a>
|
||||||
<a href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev</a>
|
<a href="https://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev</a>
|
||||||
<a href="http://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits</a>
|
<a href="https://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits</a>
|
||||||
<a href="http://llvm.org/bugs/">Bug Reports</a>
|
<a href="https://bugs.llvm.org/">Bug Reports</a>
|
||||||
<a href="https://github.com/llvm/llvm-project/tree/master/libcxxabi/">Browse Sources</a>
|
<a href="https://github.com/llvm/llvm-project/tree/master/libcxxabi/">Browse Sources</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
C++ library.</p>
|
C++ library.</p>
|
||||||
|
|
||||||
<p>All of the code in libc++abi is <a
|
<p>All of the code in libc++abi is <a
|
||||||
href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
|
href="https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents">dual licensed</a>
|
||||||
under the MIT license and the UIUC License (a BSD-like license).</p>
|
under the MIT license and the UIUC License (a BSD-like license).</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Correctness as defined by the C++11 standard.</li>
|
<li>Correctness as defined by the C++11 standard.</li>
|
||||||
<li>Provide a portable sublayer to ease the porting of <a href="http://libcxx.llvm.org/">libc++</a></li>
|
<li>Provide a portable sublayer to ease the porting of <a href="https://libcxx.llvm.org/">libc++</a></li>
|
||||||
<li>On Mac OS X, be ABI compatible with the existing low-level support.</li>
|
<li>On Mac OS X, be ABI compatible with the existing low-level support.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -118,7 +118,7 @@
|
|||||||
a different ABI library), this may interfere with test results.</p>
|
a different ABI library), this may interfere with test results.</p>
|
||||||
|
|
||||||
<p>Send discussions to the
|
<p>Send discussions to the
|
||||||
(<a href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev mailing list</a>).</p>
|
(<a href="https://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev mailing list</a>).</p>
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
<h2>Frequently asked questions</h2>
|
<h2>Frequently asked questions</h2>
|
||||||
@ -132,7 +132,7 @@
|
|||||||
And in libc++ types are the same type if and only if they have the same <code>type_info</code>
|
And in libc++ types are the same type if and only if they have the same <code>type_info</code>
|
||||||
(as in there must be only one type info per type in the entire application).
|
(as in there must be only one type info per type in the entire application).
|
||||||
And on OS X, libstdc++ and libc++ share these exception types.
|
And on OS X, libstdc++ and libc++ share these exception types.
|
||||||
So to be able to throw in one dylib and catch in another (a <code>std::exception</code> for example),
|
So to be able to throw in one dylib and catch in another (a <code>std::exception</code> for example),
|
||||||
there must be only one <code>std::exception type_info</code> in the entire app.
|
there must be only one <code>std::exception type_info</code> in the entire app.
|
||||||
That typeinfo gets laid down beside <code>~exception()</code> in libc++abi (for both libstdc++ and libc++).</p>
|
That typeinfo gets laid down beside <code>~exception()</code> in libc++abi (for both libstdc++ and libc++).</p>
|
||||||
<p>--Howard Hinnant</p>
|
<p>--Howard Hinnant</p>
|
||||||
|
@ -103,7 +103,7 @@ additional memory to hold private data. If memory can not be allocated, call
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_throw(void* thrown_exception, struct std::type_info * tinfo,
|
<code>void __cxa_throw(void* thrown_exception, struct std::type_info * tinfo,
|
||||||
void (*dest)(void*));</code>
|
void (*dest)(void*));</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -244,7 +244,7 @@ exception (if any) by one.
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<i>Returns:</i> the type of the currently handled exception, or null if there
|
<i>Returns:</i> the type of the currently handled exception, or null if there
|
||||||
are no caught exceptions.
|
are no caught exceptions.
|
||||||
</p>
|
</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</td>
|
</td>
|
||||||
@ -452,9 +452,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void* __cxa_vec_new(size_t element_count,
|
<code>void* __cxa_vec_new(size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
size_t padding_size,
|
size_t padding_size,
|
||||||
void (*constructor)(void*),
|
void (*constructor)(void*),
|
||||||
void (*destructor)(void*) );</code>
|
void (*destructor)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
@ -476,11 +476,11 @@ throwing an exception.
|
|||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void* __cxa_vec_new2(size_t element_count,
|
<code>void* __cxa_vec_new2(size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
size_t padding_size,
|
size_t padding_size,
|
||||||
void (*constructor)(void*),
|
void (*constructor)(void*),
|
||||||
void (*destructor)(void*),
|
void (*destructor)(void*),
|
||||||
void* (*alloc)(size_t),
|
void* (*alloc)(size_t),
|
||||||
void (*dealloc)(void*) );</code>
|
void (*dealloc)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -501,11 +501,11 @@ throwing an exception.
|
|||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void* __cxa_vec_new3(size_t element_count,
|
<code>void* __cxa_vec_new3(size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
size_t padding_size,
|
size_t padding_size,
|
||||||
void (*constructor)(void*),
|
void (*constructor)(void*),
|
||||||
void (*destructor)(void*),
|
void (*destructor)(void*),
|
||||||
void* (*alloc)(size_t),
|
void* (*alloc)(size_t),
|
||||||
void (*dealloc)(void*, size_t) );</code>
|
void (*dealloc)(void*, size_t) );</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -525,9 +525,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_ctor(void* array_address,
|
<code>void __cxa_vec_ctor(void* array_address,
|
||||||
size_t element_count,
|
size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
void (*constructor)(void*),
|
void (*constructor)(void*),
|
||||||
void (*destructor)(void*) );</code>
|
void (*destructor)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
@ -545,9 +545,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_dtor(void* array_address,
|
<code>void __cxa_vec_dtor(void* array_address,
|
||||||
size_t element_count,
|
size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
void (*destructor)(void*) );</code>
|
void (*destructor)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -564,9 +564,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_cleanup(void* array_address,
|
<code>void __cxa_vec_cleanup(void* array_address,
|
||||||
size_t element_count,
|
size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
void (*destructor)(void*) );</code>
|
void (*destructor)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -583,9 +583,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_delete(void* array_address,
|
<code>void __cxa_vec_delete(void* array_address,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
size_t padding_size,
|
size_t padding_size,
|
||||||
void (*destructor)(void*) );</code>
|
void (*destructor)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -602,9 +602,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_delete2(void* array_address,
|
<code>void __cxa_vec_delete2(void* array_address,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
size_t padding_size,
|
size_t padding_size,
|
||||||
void (*destructor)(void*),
|
void (*destructor)(void*),
|
||||||
void (*dealloc)(void*) );</code>
|
void (*dealloc)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
@ -622,9 +622,9 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_delete3(void* __array_address,
|
<code>void __cxa_vec_delete3(void* __array_address,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
size_t padding_size,
|
size_t padding_size,
|
||||||
void (*destructor)(void*),
|
void (*destructor)(void*),
|
||||||
void (*dealloc) (void*, size_t));</code>
|
void (*dealloc) (void*, size_t));</code>
|
||||||
</p>
|
</p>
|
||||||
@ -642,11 +642,11 @@ throwing an exception.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>void __cxa_vec_cctor(void* dest_array,
|
<code>void __cxa_vec_cctor(void* dest_array,
|
||||||
void* src_array,
|
void* src_array,
|
||||||
size_t element_count,
|
size_t element_count,
|
||||||
size_t element_size,
|
size_t element_size,
|
||||||
void (*constructor) (void*, void*),
|
void (*constructor) (void*, void*),
|
||||||
void (*destructor)(void*) );</code>
|
void (*destructor)(void*) );</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@ -775,7 +775,7 @@ which has undefined behavior according to the C++ Standard. Ends the program.
|
|||||||
<blockquote>
|
<blockquote>
|
||||||
<p>
|
<p>
|
||||||
<i>Effects:</i> Handles re-checking the exception specification if
|
<i>Effects:</i> Handles re-checking the exception specification if
|
||||||
unexpectedHandler throws, and if <tt>bad_exception</tt> needs to be thrown.
|
unexpectedHandler throws, and if <tt>bad_exception</tt> needs to be thrown.
|
||||||
Called from the compiler.
|
Called from the compiler.
|
||||||
</p>
|
</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
@ -788,14 +788,14 @@ Called from the compiler.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<code>char* __cxa_demangle(const char* mangled_name,
|
<code>char* __cxa_demangle(const char* mangled_name,
|
||||||
char* output_buffer,
|
char* output_buffer,
|
||||||
size_t* length,
|
size_t* length,
|
||||||
int* status);</code>
|
int* status);</code>
|
||||||
</p>
|
</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>
|
<p>
|
||||||
<i>Effects:</i>
|
<i>Effects:</i>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<i>Returns:</i>
|
<i>Returns:</i>
|
||||||
@ -832,7 +832,7 @@ Called from the compiler.
|
|||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
000000000000d570 (__DATA,__const) external typeinfo for char32_t
|
000000000000d570 (__DATA,__const) external typeinfo for char32_t
|
||||||
000000000000cfd0 (__DATA,__const) external typeinfo for std::nullptr_t
|
000000000000cfd0 (__DATA,__const) external typeinfo for std::nullptr_t
|
||||||
000000000000d520 (__DATA,__const) external typeinfo for char16_t
|
000000000000d520 (__DATA,__const) external typeinfo for char16_t
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="menu">
|
<div id="menu">
|
||||||
<div>
|
<div>
|
||||||
<a href="http://llvm.org/">LLVM Home</a>
|
<a href="https://llvm.org/">LLVM Home</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="submenu">
|
<div class="submenu">
|
||||||
@ -22,9 +22,9 @@
|
|||||||
|
|
||||||
<div class="submenu">
|
<div class="submenu">
|
||||||
<label>Quick Links</label>
|
<label>Quick Links</label>
|
||||||
<a href="http://lists.llvm.org/mailman/listinfo/openmp-dev">openmp-dev</a>
|
<a href="https://lists.llvm.org/mailman/listinfo/openmp-dev">openmp-dev</a>
|
||||||
<a href="http://lists.llvm.org/mailman/listinfo/openmp-commits">openmp-commits</a>
|
<a href="https://lists.llvm.org/mailman/listinfo/openmp-commits">openmp-commits</a>
|
||||||
<a href="http://llvm.org/bugs/">Bug Reports</a>
|
<a href="https://bugs.llvm.org/">Bug Reports</a>
|
||||||
<a href="https://github.com/llvm/llvm-project/tree/master/openmp">Browse Sources</a>
|
<a href="https://github.com/llvm/llvm-project/tree/master/openmp">Browse Sources</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>All of the code here is <a
|
<p>All of the code here is <a
|
||||||
href="http://llvm.org/docs/DeveloperPolicy.html#license">dual licensed</a>
|
href="https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents">dual licensed</a>
|
||||||
under the MIT license and the UIUC License (a BSD-like license).
|
under the MIT license and the UIUC License (a BSD-like license).
|
||||||
The LICENSE.txt file at the top of the OpenMP project contains
|
The LICENSE.txt file at the top of the OpenMP project contains
|
||||||
the license text and associated patent grants.
|
the license text and associated patent grants.
|
||||||
@ -83,19 +83,19 @@
|
|||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support for the <a href="http://www.openmp.org/mp-documents/OpenMP3.1.pdf">OpenMP
|
<li>Support for the <a href="https://www.openmp.org/wp-content/uploads/OpenMP3.1.pdf">OpenMP
|
||||||
3.1 standard (PDF)</a> has been achieved in the Clang 3.8.0
|
3.1 standard (PDF)</a> has been achieved in the Clang 3.8.0
|
||||||
release.
|
release.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Support for the
|
<li>Support for the
|
||||||
<a href="http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf">OpenMP
|
<a href="https://www.openmp.org/wp-content/uploads/OpenMP4.0.0.pdf">OpenMP
|
||||||
4.0 standard (PDF)</a> and <a href="http://www.openmp.org/mp-documents/OpenMP4.5.pdf">OpenMP
|
4.0 standard (PDF)</a> and <a href="https://www.openmp.org/wp-content/uploads/openmp-4.5.pdf">OpenMP
|
||||||
4.5 standard (PDF)</a> is now being implemented. (Some OpenMP 4.0
|
4.5 standard (PDF)</a> is now being implemented. (Some OpenMP 4.0
|
||||||
and 4.5 features are already available).
|
and 4.5 features are already available).
|
||||||
<li>High performance.</li>
|
<li>High performance.</li>
|
||||||
<li>ABI compatibility with <a href="http://gcc.gnu.org">Gcc</a> and
|
<li>ABI compatibility with <a href="https://gcc.gnu.org">Gcc</a> and
|
||||||
<a href="http://software.intel.com/en-us/intel-compilers">Intel's
|
<a href="https://software.intel.com/en-us/compilers">Intel's
|
||||||
existing OpenMP compilers.</a>
|
existing OpenMP compilers.</a>
|
||||||
We currently have binary compatibility with OpenMP
|
We currently have binary compatibility with OpenMP
|
||||||
3.1 code compiled by gcc 4.9, however we do not have support
|
3.1 code compiled by gcc 4.9, however we do not have support
|
||||||
@ -149,7 +149,7 @@
|
|||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
|
||||||
<p>First please review our
|
<p>First please review our
|
||||||
<a href="http://llvm.org/docs/DeveloperPolicy.html">Developer's Policy</a>.
|
<a href="https://llvm.org/docs/DeveloperPolicy.html">Developer's Policy</a>.
|
||||||
|
|
||||||
<p>To check out the code, use:</p>
|
<p>To check out the code, use:</p>
|
||||||
|
|
||||||
@ -186,7 +186,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Send discussions to the
|
<p>Send discussions to the
|
||||||
(<a href="http://lists.llvm.org/mailman/listinfo/openmp-dev">OpenMP mailing list</a>).</p>
|
(<a href="https://lists.llvm.org/mailman/listinfo/openmp-dev">OpenMP mailing list</a>).</p>
|
||||||
|
|
||||||
|
|
||||||
<!--=====================================================================-->
|
<!--=====================================================================-->
|
||||||
|
@ -51,7 +51,7 @@ interface.</li>
|
|||||||
<h2> Older releases</h2>
|
<h2> Older releases</h2>
|
||||||
|
|
||||||
No changelog available. Please look at the <a
|
No changelog available. Please look at the <a
|
||||||
href="http://repo.or.cz/w/polly-mirror.git">commit history</a>.
|
href="https://repo.or.cz/w/polly-mirror.git">commit history</a>.
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
||||||
<html>
|
<html>
|
||||||
|
@ -25,7 +25,7 @@ of four simple steps:
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
mkdir polly && cd polly
|
mkdir polly && cd polly
|
||||||
wget http://polly.llvm.org/polly.sh
|
wget https://polly.llvm.org/polly.sh
|
||||||
chmod +x polly.sh
|
chmod +x polly.sh
|
||||||
./polly.sh
|
./polly.sh
|
||||||
</pre>
|
</pre>
|
||||||
@ -34,7 +34,7 @@ chmod +x polly.sh
|
|||||||
<h3 id="source"> Get the code </h3>
|
<h3 id="source"> Get the code </h3>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
git clone http://github.com/llvm/llvm-project.git llvm_git
|
git clone https://github.com/llvm/llvm-project.git llvm_git
|
||||||
</pre>
|
</pre>
|
||||||
<h3 id="build">Build Polly</h3>
|
<h3 id="build">Build Polly</h3>
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
For many users, however, it's not the existing optimizations in Polly that are
|
For many users, however, it's not the existing optimizations in Polly that are
|
||||||
of most interest, but the new analyses and optimizations enabled by the Polly
|
of most interest, but the new analyses and optimizations enabled by the Polly
|
||||||
infrastructure. At
|
infrastructure. At
|
||||||
<a href="http://polyhedral.info">polyhedral.info</a> you can get an idea of
|
<a href="https://polyhedral.info">polyhedral.info</a> you can get an idea of
|
||||||
what has already been done and what is possible in the context of polyhedral
|
what has already been done and what is possible in the context of polyhedral
|
||||||
compilation.
|
compilation.
|
||||||
|
|
||||||
@ -152,7 +152,7 @@
|
|||||||
<h4>Polly can be built without GPL licensed software</h4> After Sebastian
|
<h4>Polly can be built without GPL licensed software</h4> After Sebastian
|
||||||
Pop's
|
Pop's
|
||||||
and David Peixotto's (both Qualcomm) recent <a
|
and David Peixotto's (both Qualcomm) recent <a
|
||||||
href="http://repo.or.cz/w/isl.git/commit/60703e3ee89b9d5d4d1afb6a3f611292c0884574">commit</a>
|
href="https://repo.or.cz/w/isl.git/commit/60703e3ee89b9d5d4d1afb6a3f611292c0884574">commit</a>
|
||||||
to isl, isl's latest development version can be built with imath instead of
|
to isl, isl's latest development version can be built with imath instead of
|
||||||
GMP. With both CLooG and gmp having become optional, the last obilgatory
|
GMP. With both CLooG and gmp having become optional, the last obilgatory
|
||||||
dependency to GPL licensed software has been removed. Now Polly only depends
|
dependency to GPL licensed software has been removed. Now Polly only depends
|
||||||
@ -194,7 +194,7 @@
|
|||||||
buildbots</a> has been extended. We now have 16 new blades that track
|
buildbots</a> has been extended. We now have 16 new blades that track
|
||||||
correctness and performance when compiling the LLVM test-suite. For now five
|
correctness and performance when compiling the LLVM test-suite. For now five
|
||||||
of them are used to provide <a
|
of them are used to provide <a
|
||||||
href="http://llvm.org/perf/db_default/v4/nts/22463">fine granularity
|
href="https://llvm.org/perf/db_default/v4/nts/22463">fine granularity
|
||||||
reports</a> (almost per-commit)
|
reports</a> (almost per-commit)
|
||||||
for 'clang -O3' (no polly). We also have six machines that track different
|
for 'clang -O3' (no polly). We also have six machines that track different
|
||||||
configurations of polly.
|
configurations of polly.
|
||||||
@ -205,11 +205,11 @@
|
|||||||
<h4>islplot released</h4>
|
<h4>islplot released</h4>
|
||||||
<a href="https://github.com/tobig/islplot">islplot</a> is a library that
|
<a href="https://github.com/tobig/islplot">islplot</a> is a library that
|
||||||
generates illustrations of integer sets and maps. It relies on <a
|
generates illustrations of integer sets and maps. It relies on <a
|
||||||
href="http://repo.or.cz/w/isl.git">isl</a> to model the integer sets and uses the <a
|
href="https://repo.or.cz/w/isl.git">isl</a> to model the integer sets and uses the <a
|
||||||
href="https://pypi.python.org/pypi/islpy">islpy</a> Python bindings to access
|
href="https://pypi.python.org/pypi/islpy">islpy</a> Python bindings to access
|
||||||
them. Plotting is performed with <a
|
them. Plotting is performed with <a
|
||||||
href="http://matplotlib.org">matplotlib</a>. The following <a
|
href="https://matplotlib.org">matplotlib</a>. The following <a
|
||||||
href="http://nbviewer.ipython.org/github/tobig/islplot/blob/master/notebooks/islplot-examples.ipynb">
|
href="https://nbviewer.ipython.org/github/tobig/islplot/blob/master/notebooks/islplot-examples.ipynb">
|
||||||
Examples</a> show its use.
|
Examples</a> show its use.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -217,7 +217,7 @@
|
|||||||
<tr><td width="120"><p>November</p></td>
|
<tr><td width="120"><p>November</p></td>
|
||||||
<td>
|
<td>
|
||||||
<h4>Loop optimization BoF at upcoming LLVM conference</h4>
|
<h4>Loop optimization BoF at upcoming LLVM conference</h4>
|
||||||
At the upcoming <a href="http://llvm.org/devmtg/2013-11/#bof5">LLVM conference
|
At the upcoming <a href="https://llvm.org/devmtg/2013-11/#bof5">LLVM conference
|
||||||
</a> there will be a loop optimization BoF discussing Polly and other high
|
</a> there will be a loop optimization BoF discussing Polly and other high
|
||||||
level loop optimizers.
|
level loop optimizers.
|
||||||
</td>
|
</td>
|
||||||
@ -226,8 +226,8 @@
|
|||||||
<td>
|
<td>
|
||||||
<h4>Automatic code coverage and static analysis tests</h4>
|
<h4>Automatic code coverage and static analysis tests</h4>
|
||||||
Sylvestre Ledru set up automatic tests for <a
|
Sylvestre Ledru set up automatic tests for <a
|
||||||
href="http://llvm.org/reports/coverage/">code coverage</a> and
|
href="https://llvm.org/reports/coverage/">code coverage</a> and
|
||||||
<a href="http://llvm.org/reports/scan-build/">static analysis</a>
|
<a href="https://llvm.org/reports/scan-build/">static analysis</a>
|
||||||
which run at least once a day and which include results for Polly.
|
which run at least once a day and which include results for Polly.
|
||||||
<h4>Move to CLooG 0.18.1 and isl 0.12.1</h4>
|
<h4>Move to CLooG 0.18.1 and isl 0.12.1</h4>
|
||||||
With the move to an isl 0.12 version Polly can be compiled without the
|
With the move to an isl 0.12 version Polly can be compiled without the
|
||||||
@ -283,13 +283,13 @@ research tool.<br \>
|
|||||||
<tr><td width="120"><p>February</p></td>
|
<tr><td width="120"><p>February</p></td>
|
||||||
<td>
|
<td>
|
||||||
<p>Polly is an official LLVM project, reachable at <a
|
<p>Polly is an official LLVM project, reachable at <a
|
||||||
href="http://polly.llvm.org">http://polly.llvm.org</a></p>
|
href="https://polly.llvm.org">https://polly.llvm.org</a></p>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><td width="120"><p>January</p></td>
|
<tr><td width="120"><p>January</p></td>
|
||||||
<td>
|
<td>
|
||||||
<p>Improved support for the isl scheduling optimizer</p>
|
<p>Improved support for the isl scheduling optimizer</p>
|
||||||
Polly can now automatically optimize all <a
|
Polly can now automatically optimize all <a
|
||||||
href="http://www.cse.ohio-state.edu/~pouchet/software/polybench/">polybench
|
href="https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/">polybench
|
||||||
2.0</a> kernels without the help of
|
2.0</a> kernels without the help of
|
||||||
an external optimizer. The compile time is reasonable and we can show
|
an external optimizer. The compile time is reasonable and we can show
|
||||||
notable speedups for various kernels.
|
notable speedups for various kernels.
|
||||||
@ -300,7 +300,7 @@ research tool.<br \>
|
|||||||
<tr><td width="120"><p>November</p></td>
|
<tr><td width="120"><p>November</p></td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Talk at the <a href="http://llvm.org/devmtg/2011-11/">
|
Talk at the <a href="https://llvm.org/devmtg/2011-11/">
|
||||||
LLVM Developer Meeting 2011</a></p>
|
LLVM Developer Meeting 2011</a></p>
|
||||||
New SCEV parser<br>
|
New SCEV parser<br>
|
||||||
(Allows parameters in array subscript and max/signextend)
|
(Allows parameters in array subscript and max/signextend)
|
||||||
@ -384,7 +384,7 @@ research tool.<br \>
|
|||||||
<tr>
|
<tr>
|
||||||
<td><p> November </p></td>
|
<td><p> November </p></td>
|
||||||
<td><p>Talk at the <a
|
<td><p>Talk at the <a
|
||||||
href="http://llvm.org/devmtg/2010-11/">LLVM Developer Meeting</a> </p></td>
|
href="https://llvm.org/devmtg/2010-11/">LLVM Developer Meeting</a> </p></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
||||||
<html>
|
<html>
|
||||||
@ -14,12 +14,12 @@
|
|||||||
<h1>Performance</h1>
|
<h1>Performance</h1>
|
||||||
|
|
||||||
<p>To evaluate the performance benefits Polly currently provides we compiled the
|
<p>To evaluate the performance benefits Polly currently provides we compiled the
|
||||||
<a href="http://www.cse.ohio-state.edu/~pouchet/software/polybench/">Polybench
|
<a href="https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/">Polybench
|
||||||
2.0</a> benchmark suite. Each benchmark was run with double precision floating
|
2.0</a> benchmark suite. Each benchmark was run with double precision floating
|
||||||
point values on an Intel Core Xeon X5670 CPU @ 2.93GHz (12 cores, 24 thread)
|
point values on an Intel Core Xeon X5670 CPU @ 2.93GHz (12 cores, 24 thread)
|
||||||
system. We used <a href="http://pocc.sf.net">PoCC</a> and the included <a
|
system. We used <a href="http://pocc.sf.net">PoCC</a> and the included <a
|
||||||
href="http://pluto-compiler.sf.net">Pluto</a> transformations to optimize the
|
href="http://pluto-compiler.sf.net">Pluto</a> transformations to optimize the
|
||||||
code. The source code of Polly and LLVM/clang was checked out on
|
code. The source code of Polly and LLVM/clang was checked out on
|
||||||
25/03/2011.</p>
|
25/03/2011.</p>
|
||||||
|
|
||||||
<p>The results shown were created fully automatically without manual
|
<p>The results shown were created fully automatically without manual
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
|
||||||
<html>
|
<html>
|
||||||
@ -21,15 +21,15 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>VoIP/SIP:</b> sip:000777polyhedral@iptel.org<br />
|
<li><b>VoIP/SIP:</b> sip:000777polyhedral@iptel.org<br />
|
||||||
<a href="http://ekiga.org">Ekiga</a> is a SIP client that works well for
|
<a href="https://www.ekiga.org">Ekiga</a> is a SIP client that works well for
|
||||||
most of us.</li>
|
most of us.</li>
|
||||||
<li><b>Traditional Dailin Numbers:</b><br />
|
<li><b>Traditional Dial In Numbers:</b><br />
|
||||||
To use your normal land line phone to connect to the conference dial
|
To use your normal land line phone to connect to the conference dial
|
||||||
one of the many available <a
|
one of the many available <a
|
||||||
href="http://www.sipbroker.com/sipbroker/action/pstnNumbers">dial in
|
href="http://www.sipbroker.com/sipbroker/action/pstnNumbers">dial in
|
||||||
numbers</a>. When asked for the number to connect type: <em>*011497659</em>.
|
numbers</a>. When asked for the number to connect type: <em>*011497659</em>.
|
||||||
<br />
|
<br />
|
||||||
Attention: Some of the dial in numbers do not work reliable. If you are not
|
Attention: Some of the dial in numbers do not work reliably. If you are not
|
||||||
asked for the number you want to connect to after a couple of seconds, just
|
asked for the number you want to connect to after a couple of seconds, just
|
||||||
try another one. <br/>
|
try another one. <br/>
|
||||||
Some selected dial in numbers:
|
Some selected dial in numbers:
|
||||||
@ -39,8 +39,8 @@
|
|||||||
<li><b>Belgium:</b> +32-4-2680133, +32-9-2980106</li>
|
<li><b>Belgium:</b> +32-4-2680133, +32-9-2980106</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
href="https://developers.google.com/open-source/gsoc/">Google Summer of
|
href="https://developers.google.com/open-source/gsoc/">Google Summer of
|
||||||
Code</a> projects. In case you are interested in a Google Summer of code
|
Code</a> projects. In case you are interested in a Google Summer of code
|
||||||
project make sure to reach out via the Polly <a
|
project make sure to reach out via the Polly <a
|
||||||
href="http://groups.google.com/group/polly-dev">mailing list</a> early to
|
href="https://groups.google.com/group/polly-dev">mailing list</a> early to
|
||||||
discuss your project proposal.
|
discuss your project proposal.
|
||||||
|
|
||||||
<h3>Integrate Polly with the LLVM vectorizers</h3>
|
<h3>Integrate Polly with the LLVM vectorizers</h3>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
libraries and outperforming the code icc/gcc currently generate.
|
libraries and outperforming the code icc/gcc currently generate.
|
||||||
|
|
||||||
<h3>Polly support for Julia - First steps</h3>
|
<h3>Polly support for Julia - First steps</h3>
|
||||||
<a href="http://julialang.org/">Julia</a> is a new matlab style programming
|
<a href="https://julialang.org/">Julia</a> is a new matlab style programming
|
||||||
language that provides C like performance for scientific computing. Even
|
language that provides C like performance for scientific computing. Even
|
||||||
though Julia also translates to LLVM-IR, parsing and optimizing Julia code
|
though Julia also translates to LLVM-IR, parsing and optimizing Julia code
|
||||||
poses new challenges that currently prevent Polly from optimizing Julia
|
poses new challenges that currently prevent Polly from optimizing Julia
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<!--*********************************************************************-->
|
<!--*********************************************************************-->
|
||||||
|
|
||||||
<h2> Publications about polyhedral compilation </h2>
|
<h2> Publications about polyhedral compilation </h2>
|
||||||
<a href="http://polyhedral.info/publications.html">polyhedral.info</a> has a
|
<a href="https://polyhedral.info/publications.html">polyhedral.info</a> has a
|
||||||
large list of publications related to polyhedral compilation. They are very
|
large list of publications related to polyhedral compilation. They are very
|
||||||
useful to get an idea of the latest developments in this area of compilation
|
useful to get an idea of the latest developments in this area of compilation
|
||||||
as well as to understand what kind of optimizations can be built on top of
|
as well as to understand what kind of optimizations can be built on top of
|
||||||
@ -41,7 +41,7 @@ Parallel Processing Letters 2012 22:04<br />
|
|||||||
<li><em>Loopy: Programmable and Formally Verified Loop Transformations</em><br />
|
<li><em>Loopy: Programmable and Formally Verified Loop Transformations</em><br />
|
||||||
Kedar Namjoshi and Nimit Singhania<br />
|
Kedar Namjoshi and Nimit Singhania<br />
|
||||||
23rd Static Analysis Symposium (SAS 2016)<br />
|
23rd Static Analysis Symposium (SAS 2016)<br />
|
||||||
<a href="http://link.springer.com/chapter/10.1007/978-3-662-53413-7_19">Paper</a>
|
<a href="https://link.springer.com/chapter/10.1007/978-3-662-53413-7_19">Paper</a>
|
||||||
</li>
|
</li>
|
||||||
<li><em>Input Space Splitting for OpenCL</em><br />
|
<li><em>Input Space Splitting for OpenCL</em><br />
|
||||||
Simon Moll, Johannes Doerfert and Sebastian Hack<br />
|
Simon Moll, Johannes Doerfert and Sebastian Hack<br />
|
||||||
@ -102,10 +102,10 @@ Parallel Processing Letters 2012 22:04<br />
|
|||||||
<li><em>Polly - First Successful Optimizations - How to proceed?</em><br />
|
<li><em>Polly - First Successful Optimizations - How to proceed?</em><br />
|
||||||
Tobias Grosser, Ragesh A<br />
|
Tobias Grosser, Ragesh A<br />
|
||||||
LLVM Developer Meeting 2011<br /><a
|
LLVM Developer Meeting 2011<br /><a
|
||||||
href="http://llvm.org/devmtg/2011-11/Grosser_PollyOptimizations.pdf">Slides</a>, <a
|
href="https://llvm.org/devmtg/2011-11/Grosser_PollyOptimizations.pdf">Slides</a>, <a
|
||||||
href="http://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-desktop.mov">Video
|
href="https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-desktop.mov">Video
|
||||||
(Computer)</a>, <a
|
(Computer)</a>, <a
|
||||||
href="http://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-mobile.mp4">Video
|
href="https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-mobile.mp4">Video
|
||||||
(Mobile)</a></li>
|
(Mobile)</a></li>
|
||||||
<li><em>A Framework for Automatic OpenMP Code Generation</em><br />
|
<li><em>A Framework for Automatic OpenMP Code Generation</em><br />
|
||||||
Raghesh A<br />
|
Raghesh A<br />
|
||||||
@ -133,10 +133,10 @@ Parallel Processing Letters 2012 22:04<br />
|
|||||||
<li><em>Polly - Polyhedral Transformations for LLVM</em><br />
|
<li><em>Polly - Polyhedral Transformations for LLVM</em><br />
|
||||||
Tobias Grosser, Hongbin Zheng<br />
|
Tobias Grosser, Hongbin Zheng<br />
|
||||||
LLVM Developer Meeting 2010<br /><a
|
LLVM Developer Meeting 2010<br /><a
|
||||||
href="http://llvm.org/devmtg/2010-11/Grosser-Polly.pdf">Slides</a>, <a
|
href="https://llvm.org/devmtg/2010-11/Grosser-Polly.pdf">Slides</a>, <a
|
||||||
href="http://llvm.org/devmtg/2010-11/videos/Grosser_Polly-desktop.mp4">Video
|
href="https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-desktop.mp4">Video
|
||||||
(Computer)</a>, <a
|
(Computer)</a>, <a
|
||||||
href="http://llvm.org/devmtg/2010-11/videos/Grosser_Polly-mobile.mp4">Video
|
href="https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-mobile.mp4">Video
|
||||||
(Mobile)</a></li>
|
(Mobile)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ Code generate PHI dependences
|
|||||||
</td><td>
|
</td><td>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a href="http://llvm.org/bugs/show_bug.cgi?id=12398">Remove
|
<th align="left"> <a href="https://bugs.llvm.org/show_bug.cgi?id=12398">Remove
|
||||||
the need for independent blocks</a>
|
the need for independent blocks</a>
|
||||||
</th><td class="done"> Done
|
</th><td class="done"> Done
|
||||||
</td><td>
|
</td><td>
|
||||||
@ -172,13 +172,13 @@ cornercases </th></tr>
|
|||||||
<th> Owner </th>
|
<th> Owner </th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a href="http://llvm.org/bugs/show_bug.cgi?id=10381">Derive
|
<th align="left"> <a href="https://bugs.llvm.org/show_bug.cgi?id=10381">Derive
|
||||||
optimal types (instead of always using i64)</a>
|
optimal types (instead of always using i64)</a>
|
||||||
</th><td class="open"> Open
|
</th><td class="open"> Open
|
||||||
</td><td>
|
</td><td>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a href="http://llvm.org/bugs/show_bug.cgi?id=12397">Model
|
<th align="left"> <a href="https://bugs.llvm.org/show_bug.cgi?id=12397">Model
|
||||||
integer wrapping</a>
|
integer wrapping</a>
|
||||||
</th><td align="center" class='done'> Done
|
</th><td align="center" class='done'> Done
|
||||||
</td><td> Johannes
|
</td><td> Johannes
|
||||||
@ -274,14 +274,14 @@ Optimizations (ongoing)</h3>
|
|||||||
<tr>
|
<tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a
|
<th align="left"> <a
|
||||||
href="http://llvm.org/bugs/show_bug.cgi?id=12403">Variable-size
|
href="https://bugs.llvm.org/show_bug.cgi?id=12403">Variable-size
|
||||||
multi-dimensional arrays</a>
|
multi-dimensional arrays</a>
|
||||||
</th><td align="center" class='done'> Done
|
</th><td align="center" class='done'> Done
|
||||||
</td><td>Sebastian
|
</td><td>Sebastian
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a
|
<th align="left"> <a
|
||||||
href="http://llvm.org/bugs/show_bug.cgi?id=12407">Derive information for
|
href="https://bugs.llvm.org/show_bug.cgi?id=12407">Derive information for
|
||||||
the SCoP context
|
the SCoP context
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
@ -289,7 +289,7 @@ the SCoP context
|
|||||||
</td><td>
|
</td><td>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a href="http://llvm.org/bugs/show_bug.cgi?id=12402">Finer
|
<th align="left"> <a href="https://bugs.llvm.org/show_bug.cgi?id=12402">Finer
|
||||||
grained statements</a>
|
grained statements</a>
|
||||||
</th><td align="center" class='nice'> Open
|
</th><td align="center" class='nice'> Open
|
||||||
</td><td>
|
</td><td>
|
||||||
@ -317,7 +317,7 @@ grained statements</a>
|
|||||||
<th> Owner </th>
|
<th> Owner </th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a href="http://llvm.org/bugs/show_bug.cgi?id=12405">Polyhedral
|
<th align="left"> <a href="https://bugs.llvm.org/show_bug.cgi?id=12405">Polyhedral
|
||||||
dead code elimination</a>
|
dead code elimination</a>
|
||||||
</th><td class="done">Done
|
</th><td class="done">Done
|
||||||
</td><td>
|
</td><td>
|
||||||
@ -342,7 +342,7 @@ dead code elimination</a>
|
|||||||
</td><td>Johannes
|
</td><td>Johannes
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a
|
<th align="left"> <a
|
||||||
href="http://polly.llvm.org/documentation/gpgpucodegen.html">GPGPU Code
|
href="https://polly.llvm.org/documentation/gpgpucodegen.html">GPGPU Code
|
||||||
Generation</a>
|
Generation</a>
|
||||||
</th><td class="niceinprogress">in progress
|
</th><td class="niceinprogress">in progress
|
||||||
</td><td>
|
</td><td>
|
||||||
@ -350,13 +350,13 @@ Yabin
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a
|
<th align="left"> <a
|
||||||
href="http://polly.llvm.org/documentation/memaccess.html">Allow optimizers to
|
href="https://polly.llvm.org/documentation/memaccess.html">Allow optimizers to
|
||||||
change memory access functions</a>
|
change memory access functions</a>
|
||||||
</th><td class="done"> Done
|
</th><td class="done"> Done
|
||||||
</td><td>Johannes
|
</td><td>Johannes
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> <a href="http://llvm.org/bugs/show_bug.cgi?id=12406">Make code
|
<th align="left"> <a href="https://bugs.llvm.org/show_bug.cgi?id=12406">Make code
|
||||||
generation independent of the clast</a>
|
generation independent of the clast</a>
|
||||||
</th><td class="done">Done
|
</th><td class="done">Done
|
||||||
</td><td>
|
</td><td>
|
||||||
@ -377,7 +377,7 @@ generation independent of the clast</a>
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> Add <a
|
<th align="left"> Add <a
|
||||||
href="http://www.cse.ohio-state.edu/~pouchet/software/polybench/">Polybench
|
href="https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/">Polybench
|
||||||
3.2</a> to the LLVM test suite
|
3.2</a> to the LLVM test suite
|
||||||
</th><td class="done"> Done
|
</th><td class="done"> Done
|
||||||
</td><td>
|
</td><td>
|
||||||
@ -407,8 +407,8 @@ href="http://www.cse.ohio-state.edu/~pouchet/software/polybench/">Polybench
|
|||||||
<th align="left"> Move to LLVM SVN
|
<th align="left"> Move to LLVM SVN
|
||||||
</th><td class="done" align="center">
|
</th><td class="done" align="center">
|
||||||
<a
|
<a
|
||||||
href="http://llvm.org/svn/llvm-project/polly"
|
href="https://llvm.org/svn/llvm-project/polly"
|
||||||
>http://llvm.org/svn/llvm-project/polly</a>
|
>https://llvm.org/svn/llvm-project/polly</a>
|
||||||
</td><td> Tobias
|
</td><td> Tobias
|
||||||
|
|
||||||
</td></tr>
|
</td></tr>
|
||||||
@ -422,14 +422,14 @@ llvm-commits@lists.llvm.org
|
|||||||
|
|
||||||
<th align="left"> LLVM Bugzilla category
|
<th align="left"> LLVM Bugzilla category
|
||||||
</th><td class="done" align="center">
|
</th><td class="done" align="center">
|
||||||
<a href="http://llvm.org/bugs/enter_bug.cgi?product=Projects">LLVM Bugzilla</a>
|
<a href="https://bugs.llvm.org/enter_bug.cgi?product=Projects">LLVM Bugzilla</a>
|
||||||
<br />
|
<br />
|
||||||
(Product is 'Projects', Component is 'Polly')
|
(Product is 'Projects', Component is 'Polly')
|
||||||
</td><td> Tobias
|
</td><td> Tobias
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"> Website
|
<th align="left"> Website
|
||||||
</th><td class="done" align="center">
|
</th><td class="done" align="center">
|
||||||
<a href="http://polly.llvm.org">http://polly.llvm.org</a>
|
<a href="https://polly.llvm.org">https://polly.llvm.org</a>
|
||||||
</td><td> Tobias
|
</td><td> Tobias
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user