diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/docs | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/docs')
25 files changed, 14694 insertions, 0 deletions
diff --git a/clang/docs/AddressSanitizer.html b/clang/docs/AddressSanitizer.html new file mode 100644 index 0000000..c1dc91b --- /dev/null +++ b/clang/docs/AddressSanitizer.html @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ --> +<html> +<head> + <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> + <title>AddressSanitizer, a fast memory error detector</title> + <link type="text/css" rel="stylesheet" href="../menu.css"> + <link type="text/css" rel="stylesheet" href="../content.css"> + <style type="text/css"> + td { + vertical-align: top; + } + </style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>AddressSanitizer</h1> +<ul> + <li> <a href="intro">Introduction</a> + <li> <a href="howtobuild">How to Build</a> + <li> <a href="usage">Usage</a> + <ul><li> <a href="has_feature">__has_feature(address_sanitizer)</a></ul> + <li> <a href="platforms">Supported Platforms</a> + <li> <a href="limitations">Limitations</a> + <li> <a href="status">Current Status</a> + <li> <a href="moreinfo">More Information</a> +</ul> + +<h2 id="intro">Introduction</h2> +AddressSanitizer is a fast memory error detector. +It consists of a compiler instrumentation module and a run-time library. +The tool can detect the following types of bugs: +<ul> <li> Out-of-bounds accesses to heap, stack and globals + <li> Use-after-free + <li> Use-after-return (to some extent) + <li> Double-free, invalid free +</ul> +Typical slowdown introduced by AddressSanitizer is <b>2x</b>. + +<h2 id="howtobuild">How to build</h2> +Follow the <a href="../get_started.html">clang build instructions</a>. <BR> +Note: CMake build does not work yet. +See <a href="http://llvm.org/bugs/show_bug.cgi?id=12272">bug 12272</a>. + +<h2 id="usage">Usage</h2> +Simply compile and link your program with <tt>-faddress-sanitizer</tt> flag. <BR> +To get a reasonable performance add <tt>-O1</tt> or higher. <BR> +To get nicer stack traces in error messages add +<tt>-fno-omit-frame-pointer</tt>. <BR> +To get perfect stack traces you may need to disable inlining (just use <tt>-O1</tt>) and tail call +elimination (</tt>-fno-optimize-sibling-calls</tt>). + +<pre> +% cat example_UseAfterFree.cc +int main(int argc, char **argv) { + int *array = new int[100]; + delete [] array; + return array[argc]; // BOOM +} +</pre> + +<pre> +% clang -O1 -g -faddress-sanitizer -fno-omit-frame-pointer example_UseAfterFree.cc +</pre> + +If a bug is detected, the program will print an error message to stderr and exit with a +non-zero exit code. +Currently, AddressSanitizer does not symbolize its output, so you may need to use a +separate script to symbolize the result offline (this will be fixed in future). +<pre> +% ./a.out 2> log +% projects/compiler-rt/lib/asan/scripts/asan_symbolize.py / < log | c++filt +==9442== ERROR: AddressSanitizer heap-use-after-free on address 0x7f7ddab8c084 at pc 0x403c8c bp 0x7fff87fb82d0 sp 0x7fff87fb82c8 +READ of size 4 at 0x7f7ddab8c084 thread T0 + #0 0x403c8c in main example_UseAfterFree.cc:4 + #1 0x7f7ddabcac4d in __libc_start_main ??:0 +0x7f7ddab8c084 is located 4 bytes inside of 400-byte region [0x7f7ddab8c080,0x7f7ddab8c210) +freed by thread T0 here: + #0 0x404704 in operator delete[](void*) ??:0 + #1 0x403c53 in main example_UseAfterFree.cc:4 + #2 0x7f7ddabcac4d in __libc_start_main ??:0 +previously allocated by thread T0 here: + #0 0x404544 in operator new[](unsigned long) ??:0 + #1 0x403c43 in main example_UseAfterFree.cc:2 + #2 0x7f7ddabcac4d in __libc_start_main ??:0 +==9442== ABORTING +</pre> + +<h3 id="has_feature">__has_feature(address_sanitizer)</h3> +In some cases one may need to execute different code depending on whether +AddressSanitizer is enabled. +<a href="LanguageExtensions.html#__has_feature_extension">__has_feature</a> +can be used for this purpose. +<pre> +#if defined(__has_feature) && __has_feature(address_sanitizer) + code that runs only under AddressSanitizer +#else + code that does not run under AddressSanitizer +#endif +</pre> + +<h2 id="platforms">Supported Platforms</h2> +AddressSanitizer is supported on +<ul><li>Linux x86_64 (tested on Ubuntu 10.04). +<li>MacOS 10.6 i386/x86_64. +</ul> +Support for Linux i386/ARM and MacOS 10.7 is in progress +(it may work, but is not guaranteed too). + + +<h2 id="limitations">Limitations</h2> +<ul> + <li> AddressSanitizer uses more real memory than a native run. + How much -- depends on the allocations sizes. The smaller the + allocations you make the bigger the overhead. + <li> On 64-bit platforms AddressSanitizer maps (but not reserves) + 16+ Terabytes of virtual address space. + This means that tools like <tt>ulimit</tt> may not work as usually expected. + <li> Static linking is not supported. +</ul> + + +<h2 id="status">Current Status</h2> +AddressSanitizer is fully functional on supported platforms in LLVM head. +However, the test suite is not fully integrated yet and we lack the testing +process (buildbots). + +<h2 id="moreinfo">More Information</h2> +<a href="http://code.google.com/p/address-sanitizer/">http://code.google.com/p/address-sanitizer</a>. + + +</div> +</body> +</html> diff --git a/clang/docs/AnalyzerRegions.html b/clang/docs/AnalyzerRegions.html new file mode 100644 index 0000000..f9d3337 --- /dev/null +++ b/clang/docs/AnalyzerRegions.html @@ -0,0 +1,260 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>Static Analyzer Design Document: Memory Regions</title> +</head> +<body> + +<h1>Static Analyzer Design Document: Memory Regions</h1> + +<h3>Authors</h3> + +<p>Ted Kremenek, <tt>kremenek at apple</tt><br> +Zhongxing Xu, <tt>xuzhongzhing at gmail</tt></p> + +<h2 id="intro">Introduction</h2> + +<p>The path-sensitive analysis engine in libAnalysis employs an extensible API +for abstractly modeling the memory of an analyzed program. This API employs the +concept of "memory regions" to abstractly model chunks of program memory such as +program variables and dynamically allocated memory such as those returned from +'malloc' and 'alloca'. Regions are hierarchical, with subregions modeling +subtyping relationships, field and array offsets into larger chunks of memory, +and so on.</p> + +<p>The region API consists of two components:</p> + +<ul> <li>A taxonomy and representation of regions themselves within the analyzer +engine. The primary definitions and interfaces are described in <tt><a +href="http://clang.llvm.org/doxygen/MemRegion_8h-source.html">MemRegion.h</a></tt>. +At the root of the region hierarchy is the class <tt>MemRegion</tt> with +specific subclasses refining the region concept for variables, heap allocated +memory, and so forth.</li> <li>The modeling of binding of values to regions. For +example, modeling the value stored to a local variable <tt>x</tt> consists of +recording the binding between the region for <tt>x</tt> (which represents the +raw memory associated with <tt>x</tt>) and the value stored to <tt>x</tt>. This +binding relationship is captured with the notion of "symbolic +stores."</li> </ul> + +<p>Symbolic stores, which can be thought of as representing the relation +<tt>regions -> values</tt>, are implemented by subclasses of the +<tt>StoreManager</tt> class (<tt><a +href="http://clang.llvm.org/doxygen/Store_8h-source.html">Store.h</a></tt>). A +particular StoreManager implementation has complete flexibility concerning the +following: + +<ul> +<li><em>How</em> to model the binding between regions and values</li> +<li><em>What</em> bindings are recorded +</ul> + +<p>Together, both points allow different StoreManagers to tradeoff between +different levels of analysis precision and scalability concerning the reasoning +of program memory. Meanwhile, the core path-sensitive engine makes no +assumptions about either points, and queries a StoreManager about the bindings +to a memory region through a generic interface that all StoreManagers share. If +a particular StoreManager cannot reason about the potential bindings of a given +memory region (e.g., '<tt>BasicStoreManager</tt>' does not reason about fields +of structures) then the StoreManager can simply return 'unknown' (represented by +'<tt>UnknownVal</tt>') for a particular region-binding. This separation of +concerns not only isolates the core analysis engine from the details of +reasoning about program memory but also facilities the option of a client of the +path-sensitive engine to easily swap in different StoreManager implementations +that internally reason about program memory in very different ways.</p> + +<p>The rest of this document is divided into two parts. We first discuss region +taxonomy and the semantics of regions. We then discuss the StoreManager +interface, and details of how the currently available StoreManager classes +implement region bindings.</p> + +<h2 id="regions">Memory Regions and Region Taxonomy</h2> + +<h3>Pointers</h3> + +<p>Before talking about the memory regions, we would talk about the pointers +since memory regions are essentially used to represent pointer values.</p> + +<p>The pointer is a type of values. Pointer values have two semantic aspects. +One is its physical value, which is an address or location. The other is the +type of the memory object residing in the address.</p> + +<p>Memory regions are designed to abstract these two properties of the pointer. +The physical value of a pointer is represented by MemRegion pointers. The rvalue +type of the region corresponds to the type of the pointee object.</p> + +<p>One complication is that we could have different view regions on the same +memory chunk. They represent the same memory location, but have different +abstract location, i.e., MemRegion pointers. Thus we need to canonicalize the +abstract locations to get a unique abstract location for one physical +location.</p> + +<p>Furthermore, these different view regions may or may not represent memory +objects of different types. Some different types are semantically the same, +for example, 'struct s' and 'my_type' are the same type.</p> + +<pre> +struct s; +typedef struct s my_type; +</pre> + +<p>But <tt>char</tt> and <tt>int</tt> are not the same type in the code below:</p> + +<pre> +void *p; +int *q = (int*) p; +char *r = (char*) p; +</pre> + +<p>Thus we need to canonicalize the MemRegion which is used in binding and +retrieving.</p> + +<h3>Regions</h3> +<p>Region is the entity used to model pointer values. A Region has the following +properties:</p> + +<ul> +<li>Kind</li> + +<li>ObjectType: the type of the object residing on the region.</li> + +<li>LocationType: the type of the pointer value that the region corresponds to. + Usually this is the pointer to the ObjectType. But sometimes we want to cache + this type explicitly, for example, for a CodeTextRegion.</li> + +<li>StartLocation</li> + +<li>EndLocation</li> +</ul> + +<h3>Symbolic Regions</h3> + +<p>A symbolic region is a map of the concept of symbolic values into the domain +of regions. It is the way that we represent symbolic pointers. Whenever a +symbolic pointer value is needed, a symbolic region is created to represent +it.</p> + +<p>A symbolic region has no type. It wraps a SymbolData. But sometimes we have +type information associated with a symbolic region. For this case, a +TypedViewRegion is created to layer the type information on top of the symbolic +region. The reason we do not carry type information with the symbolic region is +that the symbolic regions can have no type. To be consistent, we don't let them +to carry type information.</p> + +<p>Like a symbolic pointer, a symbolic region may be NULL, has unknown extent, +and represents a generic chunk of memory.</p> + +<p><em><b>NOTE</b>: We plan not to use loc::SymbolVal in RegionStore and remove it + gradually.</em></p> + +<p>Symbolic regions get their rvalue types through the following ways:</p> + +<ul> +<li>Through the parameter or global variable that points to it, e.g.: +<pre> +void f(struct s* p) { + ... +} +</pre> + +<p>The symbolic region pointed to by <tt>p</tt> has type <tt>struct +s</tt>.</p></li> + +<li>Through explicit or implicit casts, e.g.: +<pre> +void f(void* p) { + struct s* q = (struct s*) p; + ... +} +</pre> +</li> +</ul> + +<p>We attach the type information to the symbolic region lazily. For the first +case above, we create the <tt>TypedViewRegion</tt> only when the pointer is +actually used to access the pointee memory object, that is when the element or +field region is created. For the cast case, the <tt>TypedViewRegion</tt> is +created when visiting the <tt>CastExpr</tt>.</p> + +<p>The reason for doing lazy typing is that symbolic regions are sometimes only +used to do location comparison.</p> + +<h3>Pointer Casts</h3> + +<p>Pointer casts allow people to impose different 'views' onto a chunk of +memory.</p> + +<p>Usually we have two kinds of casts. One kind of casts cast down with in the +type hierarchy. It imposes more specific views onto more generic memory regions. +The other kind of casts cast up with in the type hierarchy. It strips away more +specific views on top of the more generic memory regions.</p> + +<p>We simulate the down casts by layering another <tt>TypedViewRegion</tt> on +top of the original region. We simulate the up casts by striping away the top +<tt>TypedViewRegion</tt>. Down casts is usually simple. For up casts, if the +there is no <tt>TypedViewRegion</tt> to be stripped, we return the original +region. If the underlying region is of the different type than the cast-to type, +we flag an error state.</p> + +<p>For toll-free bridging casts, we return the original region.</p> + +<p>We can set up a partial order for pointer types, with the most general type +<tt>void*</tt> at the top. The partial order forms a tree with <tt>void*</tt> as +its root node.</p> + +<p>Every <tt>MemRegion</tt> has a root position in the type tree. For example, +the pointee region of <tt>void *p</tt> has its root position at the root node of +the tree. <tt>VarRegion</tt> of <tt>int x</tt> has its root position at the 'int +type' node.</p> + +<p><tt>TypedViewRegion</tt> is used to move the region down or up in the tree. +Moving down in the tree adds a <tt>TypedViewRegion</tt>. Moving up in the tree +removes a <Tt>TypedViewRegion</tt>.</p> + +<p>Do we want to allow moving up beyond the root position? This happens +when:</p> <pre> int x; void *p = &x; </pre> + +<p>The region of <tt>x</tt> has its root position at 'int*' node. the cast to +void* moves that region up to the 'void*' node. I propose to not allow such +casts, and assign the region of <tt>x</tt> for <tt>p</tt>.</p> + +<p>Another non-ideal case is that people might cast to a non-generic pointer +from another non-generic pointer instead of first casting it back to the generic +pointer. Direct handling of this case would result in multiple layers of +TypedViewRegions. This enforces an incorrect semantic view to the region, +because we can only have one typed view on a region at a time. To avoid this +inconsistency, before casting the region, we strip the TypedViewRegion, then do +the cast. In summary, we only allow one layer of TypedViewRegion.</p> + +<h3>Region Bindings</h3> + +<p>The following region kinds are boundable: VarRegion, CompoundLiteralRegion, +StringRegion, ElementRegion, FieldRegion, and ObjCIvarRegion.</p> + +<p>When binding regions, we perform canonicalization on element regions and field +regions. This is because we can have different views on the same region, some +of which are essentially the same view with different sugar type names.</p> + +<p>To canonicalize a region, we get the canonical types for all TypedViewRegions +along the way up to the root region, and make new TypedViewRegions with those +canonical types.</p> + +<p>For Objective-C and C++, perhaps another canonicalization rule should be +added: for FieldRegion, the least derived class that has the field is used as +the type of the super region of the FieldRegion.</p> + +<p>All bindings and retrievings are done on the canonicalized regions.</p> + +<p>Canonicalization is transparent outside the region store manager, and more +specifically, unaware outside the Bind() and Retrieve() method. We don't need to +consider region canonicalization when doing pointer cast.</p> + +<h3>Constraint Manager</h3> + +<p>The constraint manager reasons about the abstract location of memory objects. +We can have different views on a region, but none of these views changes the +location of that object. Thus we should get the same abstract location for those +regions.</p> + +</body> +</html> diff --git a/clang/docs/AutomaticReferenceCounting.html b/clang/docs/AutomaticReferenceCounting.html new file mode 100644 index 0000000..1416df5 --- /dev/null +++ b/clang/docs/AutomaticReferenceCounting.html @@ -0,0 +1,2187 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>Objective-C Automatic Reference Counting (ARC)</title> +<link type="text/css" rel="stylesheet" href="../menu.css"> +<link type="text/css" rel="stylesheet" href="../content.css"> +<style type="text/css"> +/* Collapse the items in the ToC to the left. */ +div#toc ul { + padding-left: 0 +} + +/* Rationales appear in italic. */ +div.rationale { + font-style: italic +} + +div.rationale em { + font-style: normal +} + +/* Revisions are also italicized. */ +span.revision { + font-style: italic +} + +span.whenRevised { + font-weight: bold; + font-style: normal +} + +div h1 { font-size: 2em; margin: .67em 0 } +div div h1 { font-size: 1.5em; margin: .75em 0 } +div div div h1 { font-size: 1.17em; margin: .83em 0 } +div div div div h1 { margin: 1.12em 0 } + +span.term { font-style: italic; font-weight: bold } +</style> + +<script type="text/javascript"> +/// A little script to recursively build a table of contents. +function buildTOC(div, toc, ancestry) { + var children = div.childNodes; + var len = children.length; + + var childNumber = 0; + + var list = null; + for (var i = 0; i < len; ++i) { + var child = children[i]; + if (child.nodeName != "DIV") continue; + if (child.getAttribute("class") == "rationale") continue; + if (child.id == "toc") continue; + + // Okay, we're actually going to build a list node. + if (list === null) list = document.createElement("ul"); + + var childAncestry = ancestry + ++childNumber + "."; + + var headerNode = child.childNodes[1]; + var title = headerNode.innerHTML; + headerNode.insertBefore(document.createTextNode(childAncestry + " "), + headerNode.firstChild); + + var item = document.createElement("li"); + item.appendChild(document.createTextNode(childAncestry + " ")); + + var anchor = document.createElement("a"); + anchor.href = "#" + child.id; + anchor.innerHTML = title; + item.appendChild(anchor); + + buildTOC(child, item, childAncestry); + + list.appendChild(item); + } + if (list) toc.appendChild(list); +} + +function onLoad() { + var toc = document.getElementById("toc"); + var content = document.getElementById("content"); + buildTOC(content, toc, ""); +} +window.onload = onLoad; + +</script> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> +<h1>Automatic Reference Counting</h1> + +<div id="toc"> +</div> + +<div id="meta"> +<h1>About this document</h1> + +<div id="meta.purpose"> +<h1>Purpose</h1> + +<p>The first and primary purpose of this document is to serve as a +complete technical specification of Automatic Reference Counting. +Given a core Objective-C compiler and runtime, it should be possible +to write a compiler and runtime which implements these new +semantics.</p> + +<p>The secondary purpose is to act as a rationale for why ARC was +designed in this way. This should remain tightly focused on the +technical design and should not stray into marketing speculation.</p> + +</div> <!-- meta.purpose --> + +<div id="meta.background"> +<h1>Background</h1> + +<p>This document assumes a basic familiarity with C.</p> + +<p><span class="term">Blocks</span> are a C language extension for +creating anonymous functions. Users interact with and transfer block +objects using <span class="term">block pointers</span>, which are +represented like a normal pointer. A block may capture values from +local variables; when this occurs, memory must be dynamically +allocated. The initial allocation is done on the stack, but the +runtime provides a <tt>Block_copy</tt> function which, given a block +pointer, either copies the underlying block object to the heap, +setting its reference count to 1 and returning the new block pointer, +or (if the block object is already on the heap) increases its +reference count by 1. The paired function is <tt>Block_release</tt>, +which decreases the reference count by 1 and destroys the object if +the count reaches zero and is on the heap.</p> + +<p>Objective-C is a set of language extensions, significant enough to +be considered a different language. It is a strict superset of C. +The extensions can also be imposed on C++, producing a language called +Objective-C++. The primary feature is a single-inheritance object +system; we briefly describe the modern dialect.</p> + +<p>Objective-C defines a new type kind, collectively called +the <span class="term">object pointer types</span>. This kind has two +notable builtin members, <tt>id</tt> and <tt>Class</tt>; <tt>id</tt> +is the final supertype of all object pointers. The validity of +conversions between object pointer types is not checked at runtime. +Users may define <span class="term">classes</span>; each class is a +type, and the pointer to that type is an object pointer type. A class +may have a superclass; its pointer type is a subtype of its +superclass's pointer type. A class has a set +of <span class="term">ivars</span>, fields which appear on all +instances of that class. For every class <i>T</i> there's an +associated metaclass; it has no fields, its superclass is the +metaclass of <i>T</i>'s superclass, and its metaclass is a global +class. Every class has a global object whose class is the +class's metaclass; metaclasses have no associated type, so pointers to +this object have type <tt>Class</tt>.</p> + +<p>A class declaration (<tt>@interface</tt>) declares a set +of <span class="term">methods</span>. A method has a return type, a +list of argument types, and a <span class="term">selector</span>: a +name like <tt>foo:bar:baz:</tt>, where the number of colons +corresponds to the number of formal arguments. A method may be an +instance method, in which case it can be invoked on objects of the +class, or a class method, in which case it can be invoked on objects +of the metaclass. A method may be invoked by providing an object +(called the <span class="term">receiver</span>) and a list of formal +arguments interspersed with the selector, like so:</p> + +<pre>[receiver foo: fooArg bar: barArg baz: bazArg]</pre> + +<p>This looks in the dynamic class of the receiver for a method with +this name, then in that class's superclass, etc., until it finds +something it can execute. The receiver <q>expression</q> may also be +the name of a class, in which case the actual receiver is the class +object for that class, or (within method definitions) it may +be <tt>super</tt>, in which case the lookup algorithm starts with the +static superclass instead of the dynamic class. The actual methods +dynamically found in a class are not those declared in the +<tt>@interface</tt>, but those defined in a separate +<tt>@implementation</tt> declaration; however, when compiling a +call, typechecking is done based on the methods declared in the +<tt>@interface</tt>.</p> + +<p>Method declarations may also be grouped into +<span class="term">protocols</span>, which are not inherently +associated with any class, but which classes may claim to follow. +Object pointer types may be qualified with additional protocols that +the object is known to support.</p> + +<p><span class="term">Class extensions</span> are collections of ivars +and methods, designed to allow a class's <tt>@interface</tt> to be +split across multiple files; however, there is still a primary +implementation file which must see the <tt>@interface</tt>s of all +class extensions. +<span class="term">Categories</span> allow methods (but not ivars) to +be declared <i>post hoc</i> on an arbitrary class; the methods in the +category's <tt>@implementation</tt> will be dynamically added to that +class's method tables which the category is loaded at runtime, +replacing those methods in case of a collision.</p> + +<p>In the standard environment, objects are allocated on the heap, and +their lifetime is manually managed using a reference count. This is +done using two instance methods which all classes are expected to +implement: <tt>retain</tt> increases the object's reference count by +1, whereas <tt>release</tt> decreases it by 1 and calls the instance +method <tt>dealloc</tt> if the count reaches 0. To simplify certain +operations, there is also an <span class="term">autorelease +pool</span>, a thread-local list of objects to call <tt>release</tt> +on later; an object can be added to this pool by +calling <tt>autorelease</tt> on it.</p> + +<p>Block pointers may be converted to type <tt>id</tt>; block objects +are laid out in a way that makes them compatible with Objective-C +objects. There is a builtin class that all block objects are +considered to be objects of; this class implements <tt>retain</tt> by +adjusting the reference count, not by calling <tt>Block_copy</tt>.</p> + +</div> <!-- meta.background --> + +<div id="meta.evolution"> +<h1>Evolution</h1> + +<p>ARC is under continual evolution, and this document must be updated +as the language progresses.</p> + +<p>If a change increases the expressiveness of the language, for +example by lifting a restriction or by adding new syntax, the change +will be annotated with a revision marker, like so:</p> + +<blockquote> + ARC applies to Objective-C pointer types, block pointer types, and + <span class="revision"><span class="whenRevised">[beginning Apple + 8.0, LLVM 3.8]</span> BPTRs declared within <code>extern + "BCPL"</code> blocks</span>. +</blockquote> + +<p>For now, it is sensible to version this document by the releases of +its sole implementation (and its host project), clang. +<q>LLVM X.Y</q> refers to an open-source release of clang from the +LLVM project. <q>Apple X.Y</q> refers to an Apple-provided release of +the Apple LLVM Compiler. Other organizations that prepare their own, +separately-versioned clang releases and wish to maintain similar +information in this document should send requests to cfe-dev.</p> + +<p>If a change decreases the expressiveness of the language, for +example by imposing a new restriction, this should be taken as an +oversight in the original specification and something to be avoided +in all versions. Such changes are generally to be avoided.</p> + +</div> <!-- meta.evolution --> + +</div> <!-- meta --> + +<div id="general"> +<h1>General</h1> + +<p>Automatic Reference Counting implements automatic memory management +for Objective-C objects and blocks, freeing the programmer from the +need to explicitly insert retains and releases. It does not provide a +cycle collector; users must explicitly manage the lifetime of their +objects, breaking cycles manually or with weak or unsafe +references.</p> + +<p>ARC may be explicitly enabled with the compiler +flag <tt>-fobjc-arc</tt>. It may also be explicitly disabled with the +compiler flag <tt>-fno-objc-arc</tt>. The last of these two flags +appearing on the compile line <q>wins</q>.</p> + +<p>If ARC is enabled, <tt>__has_feature(objc_arc)</tt> will expand to +1 in the preprocessor. For more information about <tt>__has_feature</tt>, +see the <a href="LanguageExtensions.html#__has_feature_extension">language +extensions</a> document.</p> + +</div> <!-- general --> + +<div id="objects"> +<h1>Retainable object pointers</h1> + +<p>This section describes retainable object pointers, their basic +operations, and the restrictions imposed on their use under ARC. Note +in particular that it covers the rules for pointer <em>values</em> +(patterns of bits indicating the location of a pointed-to object), not +pointer +<em>objects</em> (locations in memory which store pointer values). +The rules for objects are covered in the next section.</p> + +<p>A <span class="term">retainable object pointer</span> +(or <q>retainable pointer</q>) is a value of +a <span class="term">retainable object pointer type</span> +(<q>retainable type</q>). There are three kinds of retainable object +pointer types:</p> +<ul> +<li>block pointers (formed by applying the caret (<tt>^</tt>) +declarator sigil to a function type)</li> +<li>Objective-C object pointers (<tt>id</tt>, <tt>Class</tt>, <tt>NSFoo*</tt>, etc.)</li> +<li>typedefs marked with <tt>__attribute__((NSObject))</tt></li> +</ul> + +<p>Other pointer types, such as <tt>int*</tt> and <tt>CFStringRef</tt>, +are not subject to ARC's semantics and restrictions.</p> + +<div class="rationale"> + +<p>Rationale: We are not at liberty to require +all code to be recompiled with ARC; therefore, ARC must interoperate +with Objective-C code which manages retains and releases manually. In +general, there are three requirements in order for a +compiler-supported reference-count system to provide reliable +interoperation:</p> + +<ul> +<li>The type system must reliably identify which objects are to be +managed. An <tt>int*</tt> might be a pointer to a <tt>malloc</tt>'ed +array, or it might be a interior pointer to such an array, or it might +point to some field or local variable. In contrast, values of the +retainable object pointer types are never interior.</li> +<li>The type system must reliably indicate how to +manage objects of a type. This usually means that the type must imply +a procedure for incrementing and decrementing retain counts. +Supporting single-ownership objects requires a lot more explicit +mediation in the language.</li> +<li>There must be reliable conventions for whether and +when <q>ownership</q> is passed between caller and callee, for both +arguments and return values. Objective-C methods follow such a +convention very reliably, at least for system libraries on Mac OS X, +and functions always pass objects at +0. The C-based APIs for Core +Foundation objects, on the other hand, have much more varied transfer +semantics.</li> +</ul> +</div> <!-- rationale --> + +<p>The use of <tt>__attribute__((NSObject))</tt> typedefs is not +recommended. If it's absolutely necessary to use this attribute, be +very explicit about using the typedef, and do not assume that it will +be preserved by language features like <tt>__typeof</tt> and C++ +template argument substitution.</p> + +<div class="rationale"><p>Rationale: any compiler operation which +incidentally strips type <q>sugar</q> from a type will yield a type +without the attribute, which may result in unexpected +behavior.</p></div> + +<div id="objects.retains"> +<h1>Retain count semantics</h1> + +<p>A retainable object pointer is either a <span class="term">null +pointer</span> or a pointer to a valid object. Furthermore, if it has +block pointer type and is not <tt>null</tt> then it must actually be a +pointer to a block object, and if it has <tt>Class</tt> type (possibly +protocol-qualified) then it must actually be a pointer to a class +object. Otherwise ARC does not enforce the Objective-C type system as +long as the implementing methods follow the signature of the static +type. It is undefined behavior if ARC is exposed to an invalid +pointer.</p> + +<p>For ARC's purposes, a valid object is one with <q>well-behaved</q> +retaining operations. Specifically, the object must be laid out such +that the Objective-C message send machinery can successfully send it +the following messages:</p> + +<ul> +<li><tt>retain</tt>, taking no arguments and returning a pointer to +the object.</li> +<li><tt>release</tt>, taking no arguments and returning <tt>void</tt>.</li> +<li><tt>autorelease</tt>, taking no arguments and returning a pointer +to the object.</li> +</ul> + +<p>The behavior of these methods is constrained in the following ways. +The term <span class="term">high-level semantics</span> is an +intentionally vague term; the intent is that programmers must +implement these methods in a way such that the compiler, modifying +code in ways it deems safe according to these constraints, will not +violate their requirements. For example, if the user puts logging +statements in <tt>retain</tt>, they should not be surprised if those +statements are executed more or less often depending on optimization +settings. These constraints are not exhaustive of the optimization +opportunities: values held in local variables are subject to +additional restrictions, described later in this document.</p> + +<p>It is undefined behavior if a computation history featuring a send +of <tt>retain</tt> followed by a send of <tt>release</tt> to the same +object, with no intervening <tt>release</tt> on that object, is not +equivalent under the high-level semantics to a computation +history in which these sends are removed. Note that this implies that +these methods may not raise exceptions.</p> + +<p>It is undefined behavior if a computation history features any use +whatsoever of an object following the completion of a send +of <tt>release</tt> that is not preceded by a send of <tt>retain</tt> +to the same object.</p> + +<p>The behavior of <tt>autorelease</tt> must be equivalent to sending +<tt>release</tt> when one of the autorelease pools currently in scope +is popped. It may not throw an exception.</p> + +<p>When the semantics call for performing one of these operations on a +retainable object pointer, if that pointer is <tt>null</tt> then the +effect is a no-op.</p> + +<p>All of the semantics described in this document are subject to +additional <a href="#optimization">optimization rules</a> which permit +the removal or optimization of operations based on local knowledge of +data flow. The semantics describe the high-level behaviors that the +compiler implements, not an exact sequence of operations that a +program will be compiled into.</p> + +</div> <!-- objects.retains --> + +<div id="objects.operands"> +<h1>Retainable object pointers as operands and arguments</h1> + +<p>In general, ARC does not perform retain or release operations when +simply using a retainable object pointer as an operand within an +expression. This includes:</p> +<ul> +<li>loading a retainable pointer from an object with non-weak +<a href="#ownership">ownership</a>,</li> +<li>passing a retainable pointer as an argument to a function or +method, and</li> +<li>receiving a retainable pointer as the result of a function or +method call.</li> +</ul> + +<div class="rationale"><p>Rationale: while this might seem +uncontroversial, it is actually unsafe when multiple expressions are +evaluated in <q>parallel</q>, as with binary operators and calls, +because (for example) one expression might load from an object while +another writes to it. However, C and C++ already call this undefined +behavior because the evaluations are unsequenced, and ARC simply +exploits that here to avoid needing to retain arguments across a large +number of calls.</p></div> + +<p>The remainder of this section describes exceptions to these rules, +how those exceptions are detected, and what those exceptions imply +semantically.</p> + +<div id="objects.operands.consumed"> +<h1>Consumed parameters</h1> + +<p>A function or method parameter of retainable object pointer type +may be marked as <span class="term">consumed</span>, signifying that +the callee expects to take ownership of a +1 retain count. This is +done by adding the <tt>ns_consumed</tt> attribute to the parameter +declaration, like so:</p> + +<pre>void foo(__attribute((ns_consumed)) id x); +- (void) foo: (id) __attribute((ns_consumed)) x;</pre> + +<p>This attribute is part of the type of the function or method, not +the type of the parameter. It controls only how the argument is +passed and received.</p> + +<p>When passing such an argument, ARC retains the argument prior to +making the call.</p> + +<p>When receiving such an argument, ARC releases the argument at the +end of the function, subject to the usual optimizations for local +values.</p> + +<div class="rationale"><p>Rationale: this formalizes direct transfers +of ownership from a caller to a callee. The most common scenario here +is passing the <tt>self</tt> parameter to <tt>init</tt>, but it is +useful to generalize. Typically, local optimization will remove any +extra retains and releases: on the caller side the retain will be +merged with a +1 source, and on the callee side the release will be +rolled into the initialization of the parameter.</p></div> + +<p>The implicit <tt>self</tt> parameter of a method may be marked as +consumed by adding <tt>__attribute__((ns_consumes_self))</tt> to the +method declaration. Methods in the <tt>init</tt> +<a href="#family">family</a> are treated as if they were implicitly +marked with this attribute.</p> + +<p>It is undefined behavior if an Objective-C message send to a method +with <tt>ns_consumed</tt> parameters (other than self) is made with a +null receiver. It is undefined behavior if the method to which an +Objective-C message send statically resolves to has a different set +of <tt>ns_consumed</tt> parameters than the method it dynamically +resolves to. It is undefined behavior if a block or function call is +made through a static type with a different set of <tt>ns_consumed</tt> +parameters than the implementation of the called block or function.</p> + +<div class="rationale"><p>Rationale: consumed parameters with null +receiver are a guaranteed leak. Mismatches with consumed parameters +will cause over-retains or over-releases, depending on the direction. +The rule about function calls is really just an application of the +existing C/C++ rule about calling functions through an incompatible +function type, but it's useful to state it explicitly.</p></div> + +</div> <!-- objects.operands.consumed --> + +<div id="objects.operands.retained-returns"> +<h1>Retained return values</h1> + +<p>A function or method which returns a retainable object pointer type +may be marked as returning a retained value, signifying that the +caller expects to take ownership of a +1 retain count. This is done +by adding the <tt>ns_returns_retained</tt> attribute to the function or +method declaration, like so:</p> + +<pre>id foo(void) __attribute((ns_returns_retained)); +- (id) foo __attribute((ns_returns_retained));</pre> + +<p>This attribute is part of the type of the function or method.</p> + +<p>When returning from such a function or method, ARC retains the +value at the point of evaluation of the return statement, before +leaving all local scopes.</p> + +<p>When receiving a return result from such a function or method, ARC +releases the value at the end of the full-expression it is contained +within, subject to the usual optimizations for local values.</p> + +<div class="rationale"><p>Rationale: this formalizes direct transfers of +ownership from a callee to a caller. The most common scenario this +models is the retained return from <tt>init</tt>, <tt>alloc</tt>, +<tt>new</tt>, and <tt>copy</tt> methods, but there are other cases in +the frameworks. After optimization there are typically no extra +retains and releases required.</p></div> + +<p>Methods in +the <tt>alloc</tt>, <tt>copy</tt>, <tt>init</tt>, <tt>mutableCopy</tt>, +and <tt>new</tt> <a href="#family">families</a> are implicitly marked +<tt>__attribute__((ns_returns_retained))</tt>. This may be suppressed +by explicitly marking the +method <tt>__attribute__((ns_returns_not_retained))</tt>.</p> + +<p>It is undefined behavior if the method to which an Objective-C +message send statically resolves has different retain semantics on its +result from the method it dynamically resolves to. It is undefined +behavior if a block or function call is made through a static type +with different retain semantics on its result from the implementation +of the called block or function.</p> + +<div class="rationale"><p>Rationale: Mismatches with returned results +will cause over-retains or over-releases, depending on the direction. +Again, the rule about function calls is really just an application of +the existing C/C++ rule about calling functions through an +incompatible function type.</p></div> + +</div> <!-- objects.operands.retained-returns --> + +<div id="objects.operands.other-returns"> +<h1>Unretained return values</h1> + +<p>A method or function which returns a retainable object type but +does not return a retained value must ensure that the object is +still valid across the return boundary.</p> + +<p>When returning from such a function or method, ARC retains the +value at the point of evaluation of the return statement, then leaves +all local scopes, and then balances out the retain while ensuring that +the value lives across the call boundary. In the worst case, this may +involve an <tt>autorelease</tt>, but callers must not assume that the +value is actually in the autorelease pool.</p> + +<p>ARC performs no extra mandatory work on the caller side, although +it may elect to do something to shorten the lifetime of the returned +value.</p> + +<div class="rationale"><p>Rationale: it is common in non-ARC code to not +return an autoreleased value; therefore the convention does not force +either path. It is convenient to not be required to do unnecessary +retains and autoreleases; this permits optimizations such as eliding +retain/autoreleases when it can be shown that the original pointer +will still be valid at the point of return.</p></div> + +<p>A method or function may be marked +with <tt>__attribute__((ns_returns_autoreleased))</tt> to indicate +that it returns a pointer which is guaranteed to be valid at least as +long as the innermost autorelease pool. There are no additional +semantics enforced in the definition of such a method; it merely +enables optimizations in callers.</p> + +</div> <!-- objects.operands.other-returns --> + +<div id="objects.operands.casts"> +<h1>Bridged casts</h1> + +<p>A <span class="term">bridged cast</span> is a C-style cast +annotated with one of three keywords:</p> + +<ul> +<li><tt>(__bridge T) op</tt> casts the operand to the destination +type <tt>T</tt>. If <tt>T</tt> is a retainable object pointer type, +then <tt>op</tt> must have a non-retainable pointer type. +If <tt>T</tt> is a non-retainable pointer type, then <tt>op</tt> must +have a retainable object pointer type. Otherwise the cast is +ill-formed. There is no transfer of ownership, and ARC inserts +no retain operations.</li> + +<li><tt>(__bridge_retained T) op</tt> casts the operand, which must +have retainable object pointer type, to the destination type, which +must be a non-retainable pointer type. ARC retains the value, subject +to the usual optimizations on local values, and the recipient is +responsible for balancing that +1.</li> + +<li><tt>(__bridge_transfer T) op</tt> casts the operand, which must +have non-retainable pointer type, to the destination type, which must +be a retainable object pointer type. ARC will release the value at +the end of the enclosing full-expression, subject to the usual +optimizations on local values.</li> +</ul> + +<p>These casts are required in order to transfer objects in and out of +ARC control; see the rationale in the section +on <a href="#objects.restrictions.conversion">conversion of retainable +object pointers</a>.</p> + +<p>Using a <tt>__bridge_retained</tt> or <tt>__bridge_transfer</tt> +cast purely to convince ARC to emit an unbalanced retain or release, +respectively, is poor form.</p> + +</div> <!-- objects.operands.casts --> + +</div> <!-- objects.operands --> + +<div id="objects.restrictions"> +<h1>Restrictions</h1> + +<div id="objects.restrictions.conversion"> +<h1>Conversion of retainable object pointers</h1> + +<p>In general, a program which attempts to implicitly or explicitly +convert a value of retainable object pointer type to any +non-retainable type, or vice-versa, is ill-formed. For example, an +Objective-C object pointer shall not be converted to <tt>void*</tt>. +As an exception, cast to <tt>intptr_t</tt> is allowed because such +casts are not transferring ownership. The <a href="#objects.operands.casts">bridged +casts</a> may be used to perform these conversions where +necessary.</p> + +<div class="rationale"><p>Rationale: we cannot ensure the correct +management of the lifetime of objects if they may be freely passed +around as unmanaged types. The bridged casts are provided so that the +programmer may explicitly describe whether the cast transfers control +into or out of ARC.</p></div> + +<p>However, the following exceptions apply.</p> + +</div> <!-- objects.restrictions.conversion --> + +<div id="objects.restrictions.conversion-exception-known"> +<h1>Conversion to retainable object pointer type of + expressions with known semantics</h1> + +<p><span class="revision"><span class="whenRevised">[beginning Apple + 4.0, LLVM 3.1]</span> These exceptions have been greatly expanded; + they previously applied only to a much-reduced subset which is + difficult to categorize but which included null pointers, message + sends (under the given rules), and the various global constants.</span></p> + +<p>An unbridged conversion to a retainable object pointer type from a +type other than a retainable object pointer type is ill-formed, as +discussed above, unless the operand of the cast has a syntactic form +which is known retained, known unretained, or known +retain-agnostic.</p> + +<p>An expression is <span class="term">known retain-agnostic</span> if +it is:</p> +<ul> +<li>an Objective-C string literal,</li> +<li>a load from a <tt>const</tt> system global variable of +<a href="#misc.c-retainable">C retainable pointer type</a>, or</li> +<li>a null pointer constant.</li> +</ul> + +<p>An expression is <span class="term">known unretained</span> if it +is an rvalue of <a href="#misc.c-retainable">C retainable +pointer type</a> and it is:</p> +<ul> +<li>a direct call to a function, and either that function has the + <tt>cf_returns_not_retained</tt> attribute or it is an + <a href="#misc.c-retainable.audit">audited</a> function that does not + have the <tt>cf_returns_retained</tt> attribute and does not follow + the create/copy naming convention,</li> +<li>a message send, and the declared method either has + the <tt>cf_returns_not_retained</tt> attribute or it has neither + the <tt>cf_returns_retained</tt> attribute nor a + <a href="#family">selector family</a> that implies a retained + result.</li> +</ul> + +<p>An expression is <span class="term">known retained</span> if it is +an rvalue of <a href="#misc.c-retainable">C retainable pointer type</a> +and it is:</p> +<ul> +<li>a message send, and the declared method either has the + <tt>cf_returns_retained</tt> attribute, or it does not have + the <tt>cf_returns_not_retained</tt> attribute but it does have a + <a href="#family">selector family</a> that implies a retained + result.</li> +</ul> + +<p>Furthermore:</p> +<ul> +<li>a comma expression is classified according to its right-hand side,</li> +<li>a statement expression is classified according to its result +expression, if it has one,</li> +<li>an lvalue-to-rvalue conversion applied to an Objective-C property +lvalue is classified according to the underlying message send, and</li> +<li>a conditional operator is classified according to its second and +third operands, if they agree in classification, or else the other +if one is known retain-agnostic.</li> +</ul> + +<p>If the cast operand is known retained, the conversion is treated as +a <tt>__bridge_transfer</tt> cast. If the cast operand is known +unretained or known retain-agnostic, the conversion is treated as +a <tt>__bridge</tt> cast.</p> + +<div class="rationale"><p>Rationale: Bridging casts are annoying. +Absent the ability to completely automate the management of CF +objects, however, we are left with relatively poor attempts to reduce +the need for a glut of explicit bridges. Hence these rules.</p> + +<p>We've so far consciously refrained from implicitly turning retained +CF results from function calls into <tt>__bridge_transfer</tt> casts. +The worry is that some code patterns — for example, creating a +CF value, assigning it to an ObjC-typed local, and then +calling <tt>CFRelease</tt> when done — are a bit too likely to +be accidentally accepted, leading to mysterious behavior.</p></div> + +</div> <!-- objects.restrictions.conversion-exception-known --> + +<div id="objects.restrictions.conversion-exception-contextual"> +<h1>Conversion from retainable object pointer type in certain contexts</h1> + +<p><span class="revision"><span class="whenRevised">[beginning Apple + 4.0, LLVM 3.1]</span></span></p> + +<p>If an expression of retainable object pointer type is explicitly +cast to a <a href="#misc.c-retainable">C retainable pointer type</a>, +the program is ill-formed as discussed above unless the result is +immediately used:</p> + +<ul> +<li>to initialize a parameter in an Objective-C message send where the +parameter is not marked with the <tt>cf_consumed</tt> attribute, or</li> +<li>to initialize a parameter in a direct call to +an <a href="#misc.c-retainable.audit">audited</a> function where the +parameter is not marked with the <tt>cf_consumed</tt> attribute.</li> +</ul> + +<div class="rationale"><p>Rationale: Consumed parameters are left out +because ARC would naturally balance them with a retain, which was +judged too treacherous. This is in part because several of the most +common consuming functions are in the <tt>Release</tt> family, and it +would be quite unfortunate for explicit releases to be silently +balanced out in this way.</p></div> + +</div> <!-- objects.restrictions.conversion-exception-contextual --> + +</div> <!-- objects.restrictions --> + +</div> <!-- objects --> + +<div id="ownership"> +<h1>Ownership qualification</h1> + +<p>This section describes the behavior of <em>objects</em> of +retainable object pointer type; that is, locations in memory which +store retainable object pointers.</p> + +<p>A type is a <span class="term">retainable object owner type</span> +if it is a retainable object pointer type or an array type whose +element type is a retainable object owner type.</p> + +<p>An <span class="term">ownership qualifier</span> is a type +qualifier which applies only to retainable object owner types. An array type is +ownership-qualified according to its element type, and adding an ownership +qualifier to an array type so qualifies its element type.</p> + +<p>A program is ill-formed if it attempts to apply an ownership qualifier +to a type which is already ownership-qualified, even if it is the same +qualifier. There is a single exception to this rule: an ownership qualifier +may be applied to a substituted template type parameter, which overrides the +ownership qualifier provided by the template argument.</p> + +<p>Except as described under +the <a href="#ownership.inference">inference rules</a>, a program is +ill-formed if it attempts to form a pointer or reference type to a +retainable object owner type which lacks an ownership qualifier.</p> + +<div class="rationale"><p>Rationale: these rules, together with the +inference rules, ensure that all objects and lvalues of retainable +object pointer type have an ownership qualifier. The ability to override an ownership qualifier during template substitution is required to counteract the <a href="#ownership.inference.template_arguments">inference of <tt>__strong</tt> for template type arguments</a>. </p></div> + +<p>There are four ownership qualifiers:</p> + +<ul> +<li><tt>__autoreleasing</tt></li> +<li><tt>__strong</tt></li> +<li><tt>__unsafe_unretained</tt></li> +<li><tt>__weak</tt></li> +</ul> + +<p>A type is <span class="term">nontrivially ownership-qualified</span> +if it is qualified with <tt>__autoreleasing</tt>, <tt>__strong</tt>, or +<tt>__weak</tt>.</p> + +<div id="ownership.spelling"> +<h1>Spelling</h1> + +<p>The names of the ownership qualifiers are reserved for the +implementation. A program may not assume that they are or are not +implemented with macros, or what those macros expand to.</p> + +<p>An ownership qualifier may be written anywhere that any other type +qualifier may be written.</p> + +<p>If an ownership qualifier appears in +the <i>declaration-specifiers</i>, the following rules apply:</p> + +<ul> +<li>if the type specifier is a retainable object owner type, the +qualifier applies to that type;</li> +<li>if the outermost non-array part of the declarator is a pointer or +block pointer, the qualifier applies to that type;</li> +<li>otherwise the program is ill-formed.</li> +</ul> + +<p>If an ownership qualifier appears on the declarator name, or on the +declared object, it is applied to outermost pointer or block-pointer +type.</p> + +<p>If an ownership qualifier appears anywhere else in a declarator, it +applies to the type there.</p> + +<div id="ownership.spelling.property"> +<h1>Property declarations</h1> + +<p>A property of retainable object pointer type may have ownership. +If the property's type is ownership-qualified, then the property has +that ownership. If the property has one of the following modifiers, +then the property has the corresponding ownership. A property is +ill-formed if it has conflicting sources of ownership, or if it has +redundant ownership modifiers, or if it has <tt>__autoreleasing</tt> +ownership.</p> + +<ul> +<li><tt>assign</tt> implies <tt>__unsafe_unretained</tt> ownership.</li> +<li><tt>copy</tt> implies <tt>__strong</tt> ownership, as well as the + usual behavior of copy semantics on the setter.</li> +<li><tt>retain</tt> implies <tt>__strong</tt> ownership.</li> +<li><tt>strong</tt> implies <tt>__strong</tt> ownership.</li> +<li><tt>unsafe_unretained</tt> implies <tt>__unsafe_unretained</tt> + ownership.</li> +<li><tt>weak</tt> implies <tt>__weak</tt> ownership.</li> +</ul> + +<p>With the exception of <tt>weak</tt>, these modifiers are available +in non-ARC modes.</p> + +<p>A property's specified ownership is preserved in its metadata, but +otherwise the meaning is purely conventional unless the property is +synthesized. If a property is synthesized, then the +<span class="term">associated instance variable</span> is the +instance variable which is named, possibly implicitly, by the +<tt>@synthesize</tt> declaration. If the associated instance variable +already exists, then its ownership qualification must equal the +ownership of the property; otherwise, the instance variable is created +with that ownership qualification.</p> + +<p>A property of retainable object pointer type which is synthesized +without a source of ownership has the ownership of its associated +instance variable, if it already exists; otherwise, +<span class="revision"><span class="whenRevised">[beginning Apple 3.1, +LLVM 3.1]</span> its ownership is implicitly <tt>strong</tt></span>. +Prior to this revision, it was ill-formed to synthesize such a +property.</p> + +<div class="rationale"><p>Rationale: using <tt>strong</tt> by default +is safe and consistent with the generic ARC rule about +<a href="#ownership.inference.variables">inferring ownership</a>. It +is, unfortunately, inconsistent with the non-ARC rule which states +that such properties are implicitly <tt>assign</tt>. However, that +rule is clearly untenable in ARC, since it leads to default-unsafe +code. The main merit to banning the properties is to avoid confusion +with non-ARC practice, which did not ultimately strike us as +sufficient to justify requiring extra syntax and (more importantly) +forcing novices to understand ownership rules just to declare a +property when the default is so reasonable. Changing the rule away +from non-ARC practice was acceptable because we had conservatively +banned the synthesis in order to give ourselves exactly this +leeway.</p></div> + +</div> <!-- ownership.spelling.property --> + +</div> <!-- ownership.spelling --> + +<div id="ownership.semantics"> +<h1>Semantics</h1> + +<p>There are five <span class="term">managed operations</span> which +may be performed on an object of retainable object pointer type. Each +qualifier specifies different semantics for each of these operations. +It is still undefined behavior to access an object outside of its +lifetime.</p> + +<p>A load or store with <q>primitive semantics</q> has the same +semantics as the respective operation would have on an <tt>void*</tt> +lvalue with the same alignment and non-ownership qualification.</p> + +<p><span class="term">Reading</span> occurs when performing a +lvalue-to-rvalue conversion on an object lvalue.</p> + +<ul> +<li>For <tt>__weak</tt> objects, the current pointee is retained and +then released at the end of the current full-expression. This must +execute atomically with respect to assignments and to the final +release of the pointee.</li> +<li>For all other objects, the lvalue is loaded with primitive +semantics.</li> +</ul> + +<p><span class="term">Assignment</span> occurs when evaluating +an assignment operator. The semantics vary based on the qualification:</p> +<ul> +<li>For <tt>__strong</tt> objects, the new pointee is first retained; +second, the lvalue is loaded with primitive semantics; third, the new +pointee is stored into the lvalue with primitive semantics; and +finally, the old pointee is released. This is not performed +atomically; external synchronization must be used to make this safe in +the face of concurrent loads and stores.</li> +<li>For <tt>__weak</tt> objects, the lvalue is updated to point to the +new pointee, unless the new pointee is an object currently undergoing +deallocation, in which case the lvalue is updated to a null pointer. +This must execute atomically with respect to other assignments to the +object, to reads from the object, and to the final release of the new +pointee.</li> +<li>For <tt>__unsafe_unretained</tt> objects, the new pointee is +stored into the lvalue using primitive semantics.</li> +<li>For <tt>__autoreleasing</tt> objects, the new pointee is retained, +autoreleased, and stored into the lvalue using primitive semantics.</li> +</ul> + +<p><span class="term">Initialization</span> occurs when an object's +lifetime begins, which depends on its storage duration. +Initialization proceeds in two stages:</p> +<ol> +<li>First, a null pointer is stored into the lvalue using primitive +semantics. This step is skipped if the object +is <tt>__unsafe_unretained</tt>.</li> +<li>Second, if the object has an initializer, that expression is +evaluated and then assigned into the object using the usual assignment +semantics.</li> +</ol> + +<p><span class="term">Destruction</span> occurs when an object's +lifetime ends. In all cases it is semantically equivalent to +assigning a null pointer to the object, with the proviso that of +course the object cannot be legally read after the object's lifetime +ends.</p> + +<p><span class="term">Moving</span> occurs in specific situations +where an lvalue is <q>moved from</q>, meaning that its current pointee +will be used but the object may be left in a different (but still +valid) state. This arises with <tt>__block</tt> variables and rvalue +references in C++. For <tt>__strong</tt> lvalues, moving is equivalent +to loading the lvalue with primitive semantics, writing a null pointer +to it with primitive semantics, and then releasing the result of the +load at the end of the current full-expression. For all other +lvalues, moving is equivalent to reading the object.</p> + +</div> <!-- ownership.semantics --> + +<div id="ownership.restrictions"> +<h1>Restrictions</h1> + +<div id="ownership.restrictions.weak"> +<h1>Weak-unavailable types</h1> + +<p>It is explicitly permitted for Objective-C classes to not +support <tt>__weak</tt> references. It is undefined behavior to +perform an operation with weak assignment semantics with a pointer to +an Objective-C object whose class does not support <tt>__weak</tt> +references.</p> + +<div class="rationale"><p>Rationale: historically, it has been +possible for a class to provide its own reference-count implementation +by overriding <tt>retain</tt>, <tt>release</tt>, etc. However, weak +references to an object require coordination with its class's +reference-count implementation because, among other things, weak loads +and stores must be atomic with respect to the final release. +Therefore, existing custom reference-count implementations will +generally not support weak references without additional effort. This +is unavoidable without breaking binary compatibility.</p></div> + +<p>A class may indicate that it does not support weak references by +providing the <tt>objc_arc_weak_unavailable</tt> attribute on the +class's interface declaration. A retainable object pointer type +is <span class="term">weak-unavailable</span> if is a pointer to an +(optionally protocol-qualified) Objective-C class <tt>T</tt> +where <tt>T</tt> or one of its superclasses has +the <tt>objc_arc_weak_unavailable</tt> attribute. A program is +ill-formed if it applies the <tt>__weak</tt> ownership qualifier to a +weak-unavailable type or if the value operand of a weak assignment +operation has a weak-unavailable type.</p> +</div> <!-- ownership.restrictions.weak --> + +<div id="ownership.restrictions.autoreleasing"> +<h1>Storage duration of <tt>__autoreleasing</tt> objects</h1> + +<p>A program is ill-formed if it declares an <tt>__autoreleasing</tt> +object of non-automatic storage duration. A program is ill-formed +if it captures an <tt>__autoreleasing</tt> object in a block or, +unless by reference, in a C++11 lambda.</p> + +<div class="rationale"><p>Rationale: autorelease pools are tied to the +current thread and scope by their nature. While it is possible to +have temporary objects whose instance variables are filled with +autoreleased objects, there is no way that ARC can provide any sort of +safety guarantee there.</p></div> + +<p>It is undefined behavior if a non-null pointer is assigned to +an <tt>__autoreleasing</tt> object while an autorelease pool is in +scope and then that object is read after the autorelease pool's scope +is left.</p> + +</div> + +<div id="ownership.restrictions.conversion.indirect"> +<h1>Conversion of pointers to ownership-qualified types</h1> + +<p>A program is ill-formed if an expression of type <tt>T*</tt> is +converted, explicitly or implicitly, to the type <tt>U*</tt>, +where <tt>T</tt> and <tt>U</tt> have different ownership +qualification, unless:</p> +<ul> +<li><tt>T</tt> is qualified with <tt>__strong</tt>, + <tt>__autoreleasing</tt>, or <tt>__unsafe_unretained</tt>, and + <tt>U</tt> is qualified with both <tt>const</tt> and + <tt>__unsafe_unretained</tt>; or</li> +<li>either <tt>T</tt> or <tt>U</tt> is <tt>cv void</tt>, where +<tt>cv</tt> is an optional sequence of non-ownership qualifiers; or</li> +<li>the conversion is requested with a <tt>reinterpret_cast</tt> in + Objective-C++; or</li> +<li>the conversion is a +well-formed <a href="#ownership.restrictions.pass_by_writeback">pass-by-writeback</a>.</li> +</ul> + +<p>The analogous rule applies to <tt>T&</tt> and <tt>U&</tt> in +Objective-C++.</p> + +<div class="rationale"><p>Rationale: these rules provide a reasonable +level of type-safety for indirect pointers, as long as the underlying +memory is not deallocated. The conversion to <tt>const +__unsafe_unretained</tt> is permitted because the semantics of reads +are equivalent across all these ownership semantics, and that's a very +useful and common pattern. The interconversion with <tt>void*</tt> is +useful for allocating memory or otherwise escaping the type system, +but use it carefully. <tt>reinterpret_cast</tt> is considered to be +an obvious enough sign of taking responsibility for any +problems.</p></div> + +<p>It is undefined behavior to access an ownership-qualified object +through an lvalue of a differently-qualified type, except that any +non-<tt>__weak</tt> object may be read through +an <tt>__unsafe_unretained</tt> lvalue.</p> + +<p>It is undefined behavior if a managed operation is performed on +a <tt>__strong</tt> or <tt>__weak</tt> object without a guarantee that +it contains a primitive zero bit-pattern, or if the storage for such +an object is freed or reused without the object being first assigned a +null pointer.</p> + +<div class="rationale"><p>Rationale: ARC cannot differentiate between +an assignment operator which is intended to <q>initialize</q> dynamic +memory and one which is intended to potentially replace a value. +Therefore the object's pointer must be valid before letting ARC at it. +Similarly, C and Objective-C do not provide any language hooks for +destroying objects held in dynamic memory, so it is the programmer's +responsibility to avoid leaks (<tt>__strong</tt> objects) and +consistency errors (<tt>__weak</tt> objects).</p> + +<p>These requirements are followed automatically in Objective-C++ when +creating objects of retainable object owner type with <tt>new</tt> +or <tt>new[]</tt> and destroying them with <tt>delete</tt>, +<tt>delete[]</tt>, or a pseudo-destructor expression. Note that +arrays of nontrivially-ownership-qualified type are not ABI compatible +with non-ARC code because the element type is non-POD: such arrays +that are <tt>new[]</tt>'d in ARC translation units cannot +be <tt>delete[]</tt>'d in non-ARC translation units and +vice-versa.</p></div> + +</div> + +<div id="ownership.restrictions.pass_by_writeback"> +<h1>Passing to an out parameter by writeback</h1> + +<p>If the argument passed to a parameter of type +<tt>T __autoreleasing *</tt> has type <tt>U oq *</tt>, +where <tt>oq</tt> is an ownership qualifier, then the argument is a +candidate for <span class="term">pass-by-writeback</span> if:</p> + +<ul> +<li><tt>oq</tt> is <tt>__strong</tt> or <tt>__weak</tt>, and</li> +<li>it would be legal to initialize a <tt>T __strong *</tt> with +a <tt>U __strong *</tt>.</li> +</ul> + +<p>For purposes of overload resolution, an implicit conversion +sequence requiring a pass-by-writeback is always worse than an +implicit conversion sequence not requiring a pass-by-writeback.</p> + +<p>The pass-by-writeback is ill-formed if the argument expression does +not have a legal form:</p> + +<ul> +<li><tt>&var</tt>, where <tt>var</tt> is a scalar variable of +automatic storage duration with retainable object pointer type</li> +<li>a conditional expression where the second and third operands are +both legal forms</li> +<li>a cast whose operand is a legal form</li> +<li>a null pointer constant</li> +</ul> + +<div class="rationale"><p>Rationale: the restriction in the form of +the argument serves two purposes. First, it makes it impossible to +pass the address of an array to the argument, which serves to protect +against an otherwise serious risk of mis-inferring an <q>array</q> +argument as an out-parameter. Second, it makes it much less likely +that the user will see confusing aliasing problems due to the +implementation, below, where their store to the writeback temporary is +not immediately seen in the original argument variable.</p></div> + +<p>A pass-by-writeback is evaluated as follows:</p> +<ol> +<li>The argument is evaluated to yield a pointer <tt>p</tt> of + type <tt>U oq *</tt>.</li> +<li>If <tt>p</tt> is a null pointer, then a null pointer is passed as + the argument, and no further work is required for the pass-by-writeback.</li> +<li>Otherwise, a temporary of type <tt>T __autoreleasing</tt> is + created and initialized to a null pointer.</li> +<li>If the parameter is not an Objective-C method parameter marked + <tt>out</tt>, then <tt>*p</tt> is read, and the result is written + into the temporary with primitive semantics.</li> +<li>The address of the temporary is passed as the argument to the + actual call.</li> +<li>After the call completes, the temporary is loaded with primitive + semantics, and that value is assigned into <tt>*p</tt>.</li> +</ol> + +<div class="rationale"><p>Rationale: this is all admittedly +convoluted. In an ideal world, we would see that a local variable is +being passed to an out-parameter and retroactively modify its type to +be <tt>__autoreleasing</tt> rather than <tt>__strong</tt>. This would +be remarkably difficult and not always well-founded under the C type +system. However, it was judged unacceptably invasive to require +programmers to write <tt>__autoreleasing</tt> on all the variables +they intend to use for out-parameters. This was the least bad +solution.</p></div> + +</div> + +<div id="ownership.restrictions.records"> +<h1>Ownership-qualified fields of structs and unions</h1> + +<p>A program is ill-formed if it declares a member of a C struct or +union to have a nontrivially ownership-qualified type.</p> + +<div class="rationale"><p>Rationale: the resulting type would be +non-POD in the C++ sense, but C does not give us very good language +tools for managing the lifetime of aggregates, so it is more +convenient to simply forbid them. It is still possible to manage this +with a <tt>void*</tt> or an <tt>__unsafe_unretained</tt> +object.</p></div> + +<p>This restriction does not apply in Objective-C++. However, +nontrivally ownership-qualified types are considered non-POD: in C++11 +terms, they are not trivially default constructible, copy +constructible, move constructible, copy assignable, move assignable, +or destructible. It is a violation of C++'s One Definition Rule to use +a class outside of ARC that, under ARC, would have a nontrivially +ownership-qualified member.</p> + +<div class="rationale"><p>Rationale: unlike in C, we can express all +the necessary ARC semantics for ownership-qualified subobjects as +suboperations of the (default) special member functions for the class. +These functions then become non-trivial. This has the non-obvious +result that the class will have a non-trivial copy constructor and +non-trivial destructor; if this would not normally be true outside of +ARC, objects of the type will be passed and returned in an +ABI-incompatible manner.</p></div> + +</div> + +</div> + +<div id="ownership.inference"> +<h1>Ownership inference</h1> + +<div id="ownership.inference.variables"> +<h1>Objects</h1> + +<p>If an object is declared with retainable object owner type, but +without an explicit ownership qualifier, its type is implicitly +adjusted to have <tt>__strong</tt> qualification.</p> + +<p>As a special case, if the object's base type is <tt>Class</tt> +(possibly protocol-qualified), the type is adjusted to +have <tt>__unsafe_unretained</tt> qualification instead.</p> + +</div> + +<div id="ownership.inference.indirect_parameters"> +<h1>Indirect parameters</h1> + +<p>If a function or method parameter has type <tt>T*</tt>, where +<tt>T</tt> is an ownership-unqualified retainable object pointer type, +then:</p> + +<ul> +<li>if <tt>T</tt> is <tt>const</tt>-qualified or <tt>Class</tt>, then +it is implicitly qualified with <tt>__unsafe_unretained</tt>;</li> +<li>otherwise, it is implicitly qualified +with <tt>__autoreleasing</tt>.</li> +</ul> + +<div class="rationale"><p>Rationale: <tt>__autoreleasing</tt> exists +mostly for this case, the Cocoa convention for out-parameters. Since +a pointer to <tt>const</tt> is obviously not an out-parameter, we +instead use a type more useful for passing arrays. If the user +instead intends to pass in a <em>mutable</em> array, inferring +<tt>__autoreleasing</tt> is the wrong thing to do; this directs some +of the caution in the following rules about writeback.</p></div> + +<p>Such a type written anywhere else would be ill-formed by the +general rule requiring ownership qualifiers.</p> + +<p>This rule does not apply in Objective-C++ if a parameter's type is +dependent in a template pattern and is only <em>instantiated</em> to +a type which would be a pointer to an unqualified retainable object +pointer type. Such code is still ill-formed.</p> + +<div class="rationale"><p>Rationale: the convention is very unlikely +to be intentional in template code.</p></div> + +</div> <!-- ownership.inference.indirect_parameters --> + +<div id="ownership.inference.template_arguments"> +<h1>Template arguments</h1> + +<p>If a template argument for a template type parameter is an +retainable object owner type that does not have an explicit ownership +qualifier, it is adjusted to have <tt>__strong</tt> +qualification. This adjustment occurs regardless of whether the +template argument was deduced or explicitly specified. </p> + +<div class="rationale"><p>Rationale: <tt>__strong</tt> is a useful default for containers (e.g., <tt>std::vector<id></tt>), which would otherwise require explicit qualification. Moreover, unqualified retainable object pointer types are unlikely to be useful within templates, since they generally need to have a qualifier applied to the before being used.</p></div> + +</div> <!-- ownership.inference.template_arguments --> +</div> <!-- ownership.inference --> +</div> <!-- ownership --> + + +<div id="family"> +<h1>Method families</h1> + +<p>An Objective-C method may fall into a <span class="term">method +family</span>, which is a conventional set of behaviors ascribed to it +by the Cocoa conventions.</p> + +<p>A method is in a certain method family if:</p> +<ul> +<li>it has a <tt>objc_method_family</tt> attribute placing it in that + family; or if not that,</li> +<li>it does not have an <tt>objc_method_family</tt> attribute placing + it in a different or no family, and</li> +<li>its selector falls into the corresponding selector family, and</li> +<li>its signature obeys the added restrictions of the method family.</li> +</ul> + +<p>A selector is in a certain selector family if, ignoring any leading +underscores, the first component of the selector either consists +entirely of the name of the method family or it begins with that name +followed by a character other than a lowercase letter. For +example, <tt>_perform:with:</tt> and <tt>performWith:</tt> would fall +into the <tt>perform</tt> family (if we recognized one), +but <tt>performing:with</tt> would not.</p> + +<p>The families and their added restrictions are:</p> + +<ul> +<li><tt>alloc</tt> methods must return a retainable object pointer type.</li> +<li><tt>copy</tt> methods must return a retainable object pointer type.</li> +<li><tt>mutableCopy</tt> methods must return a retainable object pointer type.</li> +<li><tt>new</tt> methods must return a retainable object pointer type.</li> +<li><tt>init</tt> methods must be instance methods and must return an +Objective-C pointer type. Additionally, a program is ill-formed if it +declares or contains a call to an <tt>init</tt> method whose return +type is neither <tt>id</tt> nor a pointer to a super-class or +sub-class of the declaring class (if the method was declared on +a class) or the static receiver type of the call (if it was declared +on a protocol). + +<div class="rationale"><p>Rationale: there are a fair number of existing +methods with <tt>init</tt>-like selectors which nonetheless don't +follow the <tt>init</tt> conventions. Typically these are either +accidental naming collisions or helper methods called during +initialization. Because of the peculiar retain/release behavior +of <tt>init</tt> methods, it's very important not to treat these +methods as <tt>init</tt> methods if they aren't meant to be. It was +felt that implicitly defining these methods out of the family based on +the exact relationship between the return type and the declaring class +would be much too subtle and fragile. Therefore we identify a small +number of legitimate-seeming return types and call everything else an +error. This serves the secondary purpose of encouraging programmers +not to accidentally give methods names in the <tt>init</tt> family.</p> + +<p>Note that a method with an <tt>init</tt>-family selector which +returns a non-Objective-C type (e.g. <tt>void</tt>) is perfectly +well-formed; it simply isn't in the <tt>init</tt> family.</p></div> +</li> +</ul> + +<p>A program is ill-formed if a method's declarations, +implementations, and overrides do not all have the same method +family.</p> + +<div id="family.attribute"> +<h1>Explicit method family control</h1> + +<p>A method may be annotated with the <tt>objc_method_family</tt> +attribute to precisely control which method family it belongs to. If +a method in an <tt>@implementation</tt> does not have this attribute, +but there is a method declared in the corresponding <tt>@interface</tt> +that does, then the attribute is copied to the declaration in the +<tt>@implementation</tt>. The attribute is available outside of ARC, +and may be tested for with the preprocessor query +<tt>__has_attribute(objc_method_family)</tt>.</p> + +<p>The attribute is spelled +<tt>__attribute__((objc_method_family(<i>family</i>)))</tt>. +If <i>family</i> is <tt>none</tt>, the method has no family, even if +it would otherwise be considered to have one based on its selector and +type. Otherwise, <i>family</i> must be one +of <tt>alloc</tt>, <tt>copy</tt>, <tt>init</tt>, +<tt>mutableCopy</tt>, or <tt>new</tt>, in which case the method is +considered to belong to the corresponding family regardless of its +selector. It is an error if a method that is explicitly added to a +family in this way does not meet the requirements of the family other +than the selector naming convention.</p> + +<div class="rationale"><p>Rationale: the rules codified in this document +describe the standard conventions of Objective-C. However, as these +conventions have not heretofore been enforced by an unforgiving +mechanical system, they are only imperfectly kept, especially as they +haven't always even been precisely defined. While it is possible to +define low-level ownership semantics with attributes like +<tt>ns_returns_retained</tt>, this attribute allows the user to +communicate semantic intent, which is of use both to ARC (which, e.g., +treats calls to <tt>init</tt> specially) and the static analyzer.</p></div> +</div> + +<div id="family.semantics"> +<h1>Semantics of method families</h1> + +<p>A method's membership in a method family may imply non-standard +semantics for its parameters and return type.</p> + +<p>Methods in the <tt>alloc</tt>, <tt>copy</tt>, <tt>mutableCopy</tt>, +and <tt>new</tt> families — that is, methods in all the +currently-defined families except <tt>init</tt> — implicitly +<a href="#objects.operands.retained_returns">return a retained +object</a> as if they were annotated with +the <tt>ns_returns_retained</tt> attribute. This can be overridden by +annotating the method with either of +the <tt>ns_returns_autoreleased</tt> or +<tt>ns_returns_not_retained</tt> attributes.</p> + +<p>Properties also follow same naming rules as methods. This means that +those in the <tt>alloc</tt>, <tt>copy</tt>, <tt>mutableCopy</tt>, +and <tt>new</tt> families provide access to +<a href="#objects.operands.retained_returns">retained objects</a>. +This can be overridden by annotating the property with +<tt>ns_returns_not_retained</tt> attribute.</p> + +<div id="family.semantics.init"> +<h1>Semantics of <tt>init</tt></h1> +<p>Methods in the <tt>init</tt> family implicitly +<a href="#objects.operands.consumed">consume</a> their <tt>self</tt> +parameter and <a href="#objects.operands.retained_returns">return a +retained object</a>. Neither of these properties can be altered +through attributes.</p> + +<p>A call to an <tt>init</tt> method with a receiver that is either +<tt>self</tt> (possibly parenthesized or casted) or <tt>super</tt> is +called a <span class="term">delegate init call</span>. It is an error +for a delegate init call to be made except from an <tt>init</tt> +method, and excluding blocks within such methods.</p> + +<p>As an exception to the <a href="misc.self">usual rule</a>, the +variable <tt>self</tt> is mutable in an <tt>init</tt> method and has +the usual semantics for a <tt>__strong</tt> variable. However, it is +undefined behavior and the program is ill-formed, no diagnostic +required, if an <tt>init</tt> method attempts to use the previous +value of <tt>self</tt> after the completion of a delegate init call. +It is conventional, but not required, for an <tt>init</tt> method to +return <tt>self</tt>.</p> + +<p>It is undefined behavior for a program to cause two or more calls +to <tt>init</tt> methods on the same object, except that +each <tt>init</tt> method invocation may perform at most one delegate +init call.</p> + +</div> <!-- family.semantics.init --> + +<div id="family.semantics.result_type"> +<h1>Related result types</h1> + +<p>Certain methods are candidates to have <span class="term">related +result types</span>:</p> +<ul> +<li>class methods in the <tt>alloc</tt> and <tt>new</tt> method families</li> +<li>instance methods in the <tt>init</tt> family</li> +<li>the instance method <tt>self</tt></li> +<li>outside of ARC, the instance methods <tt>retain</tt> and <tt>autorelease</tt></li> +</ul> + +<p>If the formal result type of such a method is <tt>id</tt> or +protocol-qualified <tt>id</tt>, or a type equal to the declaring class +or a superclass, then it is said to have a related result type. In +this case, when invoked in an explicit message send, it is assumed to +return a type related to the type of the receiver:</p> + +<ul> +<li>if it is a class method, and the receiver is a class +name <tt>T</tt>, the message send expression has type <tt>T*</tt>; +otherwise</li> +<li>if it is an instance method, and the receiver has type <tt>T</tt>, +the message send expression has type <tt>T</tt>; otherwise</li> +<li>the message send expression has the normal result type of the +method.</li> +</ul> + +<p>This is a new rule of the Objective-C language and applies outside +of ARC.</p> + +<div class="rationale"><p>Rationale: ARC's automatic code emission is +more prone than most code to signature errors, i.e. errors where a +call was emitted against one method signature, but the implementing +method has an incompatible signature. Having more precise type +information helps drastically lower this risk, as well as catching +a number of latent bugs.</p></div> + +</div> <!-- family.semantics.result_type --> +</div> <!-- family.semantics --> +</div> <!-- family --> + +<div id="optimization"> +<h1>Optimization</h1> + +<p>ARC applies aggressive rules for the optimization of local +behavior. These rules are based around a core assumption of +<span class="term">local balancing</span>: that other code will +perform retains and releases as necessary (and only as necessary) for +its own safety, and so the optimizer does not need to consider global +properties of the retain and release sequence. For example, if a +retain and release immediately bracket a call, the optimizer can +delete the retain and release on the assumption that the called +function will not do a constant number of unmotivated releases +followed by a constant number of <q>balancing</q> retains, such that +the local retain/release pair is the only thing preventing the called +function from ending up with a dangling reference.</p> + +<p>The optimizer assumes that when a new value enters local control, +e.g. from a load of a non-local object or as the result of a function +call, it is instaneously valid. Subsequently, a retain and release of +a value are necessary on a computation path only if there is a use of +that value before the release and after any operation which might +cause a release of the value (including indirectly or non-locally), +and only if the value is not demonstrably already retained.</p> + +<p>The complete optimization rules are quite complicated, but it would +still be useful to document them here.</p> + +<div id="optimization.precise"> +<h1>Precise lifetime semantics</h1> + +<p>In general, ARC maintains an invariant that a retainable object +pointer held in a <tt>__strong</tt> object will be retained for the +full formal lifetime of the object. Objects subject to this invariant +have <span class="term">precise lifetime semantics</span>.</p> + +<p>By default, local variables of automatic storage duration do not +have precise lifetime semantics. Such objects are simply strong +references which hold values of retainable object pointer type, and +these values are still fully subject to the optimizations on values +under local control.</p> + +<div class="rationale"><p>Rationale: applying these precise-lifetime +semantics strictly would be prohibitive. Many useful optimizations +that might theoretically decrease the lifetime of an object would be +rendered impossible. Essentially, it promises too much.</p></div> + +<p>A local variable of retainable object owner type and automatic +storage duration may be annotated with the <tt>objc_precise_lifetime</tt> +attribute to indicate that it should be considered to be an object +with precise lifetime semantics.</p> + +<div class="rationale"><p>Rationale: nonetheless, it is sometimes +useful to be able to force an object to be released at a precise time, +even if that object does not appear to be used. This is likely to be +uncommon enough that the syntactic weight of explicitly requesting +these semantics will not be burdensome, and may even make the code +clearer.</p></div> + +</div> <!-- optimization.precise --> + +</div> <!-- optimization --> + +<div id="misc"> +<h1>Miscellaneous</h1> + +<div id="misc.special_methods"> +<h1>Special methods</h1> + +<div id="misc.special_methods.retain"> +<h1>Memory management methods</h1> + +<p>A program is ill-formed if it contains a method definition, message +send, or <tt>@selector</tt> expression for any of the following +selectors:</p> +<ul> +<li><tt>autorelease</tt></li> +<li><tt>release</tt></li> +<li><tt>retain</tt></li> +<li><tt>retainCount</tt></li> +</ul> + +<div class="rationale"><p>Rationale: <tt>retainCount</tt> is banned +because ARC robs it of consistent semantics. The others were banned +after weighing three options for how to deal with message sends:</p> + +<p><b>Honoring</b> them would work out very poorly if a programmer +naively or accidentally tried to incorporate code written for manual +retain/release code into an ARC program. At best, such code would do +twice as much work as necessary; quite frequently, however, ARC and +the explicit code would both try to balance the same retain, leading +to crashes. The cost is losing the ability to perform <q>unrooted</q> +retains, i.e. retains not logically corresponding to a strong +reference in the object graph.</p> + +<p><b>Ignoring</b> them would badly violate user expectations about their +code. While it <em>would</em> make it easier to develop code simultaneously +for ARC and non-ARC, there is very little reason to do so except for +certain library developers. ARC and non-ARC translation units share +an execution model and can seamlessly interoperate. Within a +translation unit, a developer who faithfully maintains their code in +non-ARC mode is suffering all the restrictions of ARC for zero +benefit, while a developer who isn't testing the non-ARC mode is +likely to be unpleasantly surprised if they try to go back to it.</p> + +<p><b>Banning</b> them has the disadvantage of making it very awkward +to migrate existing code to ARC. The best answer to that, given a +number of other changes and restrictions in ARC, is to provide a +specialized tool to assist users in that migration.</p> + +<p>Implementing these methods was banned because they are too integral +to the semantics of ARC; many tricks which worked tolerably under +manual reference counting will misbehave if ARC performs an ephemeral +extra retain or two. If absolutely required, it is still possible to +implement them in non-ARC code, for example in a category; the +implementations must obey the <a href="#objects.retains">semantics</a> +laid out elsewhere in this document.</p> + +</div> +</div> <!-- misc.special_methods.retain --> + +<div id="misc.special_methods.dealloc"> +<h1><tt>dealloc</tt></h1> + +<p>A program is ill-formed if it contains a message send +or <tt>@selector</tt> expression for the selector <tt>dealloc</tt>.</p> + +<div class="rationale"><p>Rationale: there are no legitimate reasons +to call <tt>dealloc</tt> directly.</p></div> + +<p>A class may provide a method definition for an instance method +named <tt>dealloc</tt>. This method will be called after the final +<tt>release</tt> of the object but before it is deallocated or any of +its instance variables are destroyed. The superclass's implementation +of <tt>dealloc</tt> will be called automatically when the method +returns.</p> + +<div class="rationale"><p>Rationale: even though ARC destroys instance +variables automatically, there are still legitimate reasons to write +a <tt>dealloc</tt> method, such as freeing non-retainable resources. +Failing to call <tt>[super dealloc]</tt> in such a method is nearly +always a bug. Sometimes, the object is simply trying to prevent +itself from being destroyed, but <tt>dealloc</tt> is really far too +late for the object to be raising such objections. Somewhat more +legitimately, an object may have been pool-allocated and should not be +deallocated with <tt>free</tt>; for now, this can only be supported +with a <tt>dealloc</tt> implementation outside of ARC. Such an +implementation must be very careful to do all the other work +that <tt>NSObject</tt>'s <tt>dealloc</tt> would, which is outside the +scope of this document to describe.</p></div> + +</div> + +</div> <!-- misc.special_methods --> + +<div id="autoreleasepool"> +<h1><tt>@autoreleasepool</tt></h1> + +<p>To simplify the use of autorelease pools, and to bring them under +the control of the compiler, a new kind of statement is available in +Objective-C. It is written <tt>@autoreleasepool</tt> followed by +a <i>compound-statement</i>, i.e. by a new scope delimited by curly +braces. Upon entry to this block, the current state of the +autorelease pool is captured. When the block is exited normally, +whether by fallthrough or directed control flow (such +as <tt>return</tt> or <tt>break</tt>), the autorelease pool is +restored to the saved state, releasing all the objects in it. When +the block is exited with an exception, the pool is not drained.</p> + +<p><tt>@autoreleasepool</tt> may be used in non-ARC translation units, +with equivalent semantics.</p> + +<p>A program is ill-formed if it refers to the +<tt>NSAutoreleasePool</tt> class.</p> + +<div class="rationale"><p>Rationale: autorelease pools are clearly +important for the compiler to reason about, but it is far too much to +expect the compiler to accurately reason about control dependencies +between two calls. It is also very easy to accidentally forget to +drain an autorelease pool when using the manual API, and this can +significantly inflate the process's high-water-mark. The introduction +of a new scope is unfortunate but basically required for sane +interaction with the rest of the language. Not draining the pool +during an unwind is apparently required by the Objective-C exceptions +implementation.</p></div> + +</div> <!-- autoreleasepool --> + +<div id="misc.self"> +<h1><tt>self</tt></h1> + +<p>The <tt>self</tt> parameter variable of an Objective-C method is +never actually retained by the implementation. It is undefined +behavior, or at least dangerous, to cause an object to be deallocated +during a message send to that object.</p> + +<p>To make this safe, for Objective-C instance methods <tt>self</tt> is +implicitly <tt>const</tt> unless the method is in the <a +href="#family.semantics.init"><tt>init</tt> family</a>. Further, <tt>self</tt> +is <b>always</b> implicitly <tt>const</tt> within a class method.</p> + +<div class="rationale"><p>Rationale: the cost of +retaining <tt>self</tt> in all methods was found to be prohibitive, as +it tends to be live across calls, preventing the optimizer from +proving that the retain and release are unnecessary — for good +reason, as it's quite possible in theory to cause an object to be +deallocated during its execution without this retain and release. +Since it's extremely uncommon to actually do so, even unintentionally, +and since there's no natural way for the programmer to remove this +retain/release pair otherwise (as there is for other parameters by, +say, making the variable <tt>__unsafe_unretained</tt>), we chose to +make this optimizing assumption and shift some amount of risk to the +user.</p></div> + +</div> <!-- misc.self --> + +<div id="misc.enumeration"> +<h1>Fast enumeration iteration variables</h1> + +<p>If a variable is declared in the condition of an Objective-C fast +enumeration loop, and the variable has no explicit ownership +qualifier, then it is qualified with <tt>const __strong</tt> and +objects encountered during the enumeration are not actually +retained.</p> + +<div class="rationale"><p>Rationale: this is an optimization made +possible because fast enumeration loops promise to keep the objects +retained during enumeration, and the collection itself cannot be +synchronously modified. It can be overridden by explicitly qualifying +the variable with <tt>__strong</tt>, which will make the variable +mutable again and cause the loop to retain the objects it +encounters.</p></div> + +</div> <!-- misc.enumeration --> + +<div id="misc.blocks"> +<h1>Blocks</h1> + +<p>The implicit <tt>const</tt> capture variables created when +evaluating a block literal expression have the same ownership +semantics as the local variables they capture. The capture is +performed by reading from the captured variable and initializing the +capture variable with that value; the capture variable is destroyed +when the block literal is, i.e. at the end of the enclosing scope.</p> + +<p>The <a href="#ownership.inference">inference</a> rules apply +equally to <tt>__block</tt> variables, which is a shift in semantics +from non-ARC, where <tt>__block</tt> variables did not implicitly +retain during capture.</p> + +<p><tt>__block</tt> variables of retainable object owner type are +moved off the stack by initializing the heap copy with the result of +moving from the stack copy.</p> + +<p>With the exception of retains done as part of initializing +a <tt>__strong</tt> parameter variable or reading a <tt>__weak</tt> +variable, whenever these semantics call for retaining a value of +block-pointer type, it has the effect of a <tt>Block_copy</tt>. The +optimizer may remove such copies when it sees that the result is +used only as an argument to a call.</p> + +</div> <!-- misc.blocks --> + +<div id="misc.exceptions"> +<h1>Exceptions</h1> + +<p>By default in Objective C, ARC is not exception-safe for normal +releases:</p> +<ul> +<li>It does not end the lifetime of <tt>__strong</tt> variables when +their scopes are abnormally terminated by an exception.</li> +<li>It does not perform releases which would occur at the end of +a full-expression if that full-expression throws an exception.</li> +</ul> + +<p>A program may be compiled with the option +<tt>-fobjc-arc-exceptions</tt> in order to enable these, or with the +option <tt>-fno-objc-arc-exceptions</tt> to explicitly disable them, +with the last such argument <q>winning</q>.</p> + +<div class="rationale"><p>Rationale: the standard Cocoa convention is +that exceptions signal programmer error and are not intended to be +recovered from. Making code exceptions-safe by default would impose +severe runtime and code size penalties on code that typically does not +actually care about exceptions safety. Therefore, ARC-generated code +leaks by default on exceptions, which is just fine if the process is +going to be immediately terminated anyway. Programs which do care +about recovering from exceptions should enable the option.</p></div> + +<p>In Objective-C++, <tt>-fobjc-arc-exceptions</tt> is enabled by +default.</p> + +<div class="rationale"><p>Rationale: C++ already introduces pervasive +exceptions-cleanup code of the sort that ARC introduces. C++ +programmers who have not already disabled exceptions are much more +likely to actual require exception-safety.</p></div> + +<p>ARC does end the lifetimes of <tt>__weak</tt> objects when an +exception terminates their scope unless exceptions are disabled in the +compiler.</p> + +<div class="rationale"><p>Rationale: the consequence of a +local <tt>__weak</tt> object not being destroyed is very likely to be +corruption of the Objective-C runtime, so we want to be safer here. +Of course, potentially massive leaks are about as likely to take down +the process as this corruption is if the program does try to recover +from exceptions.</p></div> + +</div> <!-- misc.exceptions --> + +<div id="misc.interior"> +<h1>Interior pointers</h1> + +<p>An Objective-C method returning a non-retainable pointer may be +annotated with the <tt>objc_returns_inner_pointer</tt> attribute to +indicate that it returns a handle to the internal data of an object, +and that this reference will be invalidated if the object is +destroyed. When such a message is sent to an object, the object's +lifetime will be extended until at least the earliest of:</p> + +<ul> +<li>the last use of the returned pointer, or any pointer derived from +it, in the calling function or</li> +<li>the autorelease pool is restored to a previous state.</li> +</ul> + +<div class="rationale"><p>Rationale: not all memory and resources are +managed with reference counts; it is common for objects to manage +private resources in their own, private way. Typically these +resources are completely encapsulated within the object, but some +classes offer their users direct access for efficiency. If ARC is not +aware of methods that return such <q>interior</q> pointers, its +optimizations can cause the owning object to be reclaimed too soon. +This attribute informs ARC that it must tread lightly.</p> + +<p>The extension rules are somewhat intentionally vague. The +autorelease pool limit is there to permit a simple implementation to +simply retain and autorelease the receiver. The other limit permits +some amount of optimization. The phrase <q>derived from</q> is +intended to encompass the results both of pointer transformations, +such as casts and arithmetic, and of loading from such derived +pointers; furthermore, it applies whether or not such derivations are +applied directly in the calling code or by other utility code (for +example, the C library routine <tt>strchr</tt>). However, the +implementation never need account for uses after a return from the +code which calls the method returning an interior pointer.</p></div> + +<p>As an exception, no extension is required if the receiver is loaded +directly from a <tt>__strong</tt> object +with <a href="#optimization.precise">precise lifetime semantics</a>.</p> + +<div class="rationale"><p>Rationale: implicit autoreleases carry the +risk of significantly inflating memory use, so it's important to +provide users a way of avoiding these autoreleases. Tying this to +precise lifetime semantics is ideal, as for local variables this +requires a very explicit annotation, which allows ARC to trust the +user with good cheer.</p></div> + +</div> <!-- misc.interior --> + +<div id="misc.c-retainable"> +<h1>C retainable pointer types</h1> + +<p>A type is a <span class="term">C retainable pointer type</span> +if it is a pointer to (possibly qualified) <tt>void</tt> or a +pointer to a (possibly qualifier) <tt>struct</tt> or <tt>class</tt> +type.</p> + +<div class="rationale"><p>Rationale: ARC does not manage pointers of +CoreFoundation type (or any of the related families of retainable C +pointers which interoperate with Objective-C for retain/release +operation). In fact, ARC does not even know how to distinguish these +types from arbitrary C pointer types. The intent of this concept is +to filter out some obviously non-object types while leaving a hook for +later tightening if a means of exhaustively marking CF types is made +available.</p></div> + +<div id="misc.c-retainable.audit"> +<h1>Auditing of C retainable pointer interfaces</h1> + +<p><span class="revision"><span class="whenRevised">[beginning Apple 4.0, LLVM 3.1]</span></span></p> + +<p>A C function may be marked with the <tt>cf_audited_transfer</tt> +attribute to express that, except as otherwise marked with attributes, +it obeys the parameter (consuming vs. non-consuming) and return +(retained vs. non-retained) conventions for a C function of its name, +namely:</p> + +<ul> +<li>A parameter of C retainable pointer type is assumed to not be +consumed unless it is marked with the <tt>cf_consumed</tt> attribute, and</li> +<li>A result of C retainable pointer type is assumed to not be +returned retained unless the function is either +marked <tt>cf_returns_retained</tt> or it follows +the create/copy naming convention and is not +marked <tt>cf_returns_not_retained</tt>.</li> +</ul> + +<p>A function obeys the <span class="term">create/copy</span> naming +convention if its name contains as a substring:</p> +<ul> +<li>either <q>Create</q> or <q>Copy</q> not followed by a lowercase letter, or</li> +<li>either <q>create</q> or <q>copy</q> not followed by a lowercase +letter and not preceded by any letter, whether uppercase or lowercase.</li> +</ul> + +<p>A second attribute, <tt>cf_unknown_transfer</tt>, signifies that a +function's transfer semantics cannot be accurately captured using any +of these annotations. A program is ill-formed if it annotates the +same function with both <tt>cf_audited_transfer</tt> +and <tt>cf_unknown_transfer</tt>.</p> + +<p>A pragma is provided to faciliate the mass annotation of interfaces:</p> + +<pre>#pragma arc_cf_code_audited begin +... +#pragma arc_cf_code_audited end</pre> + +<p>All C functions declared within the extent of this pragma are +treated as if annotated with the <tt>cf_audited_transfer</tt> +attribute unless they otherwise have the <tt>cf_unknown_transfer</tt> +attribute. The pragma is accepted in all language modes. A program +is ill-formed if it attempts to change files, whether by including a +file or ending the current file, within the extent of this pragma.</p> + +<p>It is possible to test for all the features in this section with +<tt>__has_feature(arc_cf_code_audited)</tt>.</p> + +<div class="rationale"><p>Rationale: A significant inconvenience in +ARC programming is the necessity of interacting with APIs based around +C retainable pointers. These features are designed to make it +relatively easy for API authors to quickly review and annotate their +interfaces, in turn improving the fidelity of tools such as the static +analyzer and ARC. The single-file restriction on the pragma is +designed to eliminate the risk of accidentally annotating some other +header's interfaces.</p></div> + +</div> <!-- misc.c-retainable.audit --> + +</div> <!-- misc.c-retainable --> + +</div> <!-- misc --> + +<div id="runtime"> +<h1>Runtime support</h1> + +<p>This section describes the interaction between the ARC runtime and +the code generated by the ARC compiler. This is not part of the ARC +language specification; instead, it is effectively a language-specific +ABI supplement, akin to the <q>Itanium</q> generic ABI for C++.</p> + +<p>Ownership qualification does not alter the storage requirements for +objects, except that it is undefined behavior if a <tt>__weak</tt> +object is inadequately aligned for an object of type <tt>id</tt>. The +other qualifiers may be used on explicitly under-aligned memory.</p> + +<p>The runtime tracks <tt>__weak</tt> objects which holds non-null +values. It is undefined behavior to direct modify a <tt>__weak</tt> +object which is being tracked by the runtime except through an +<a href="#runtime.objc_storeWeak"><tt>objc_storeWeak</tt></a>, +<a href="#runtime.objc_destroyWeak"><tt>objc_destroyWeak</tt></a>, +or <a href="#runtime.objc_moveWeak"><tt>objc_moveWeak</tt></a> +call.</p> + +<p>The runtime must provide a number of new entrypoints which the +compiler may emit, which are described in the remainder of this +section.</p> + +<div class="rationale"><p>Rationale: Several of these functions are +semantically equivalent to a message send; we emit calls to C +functions instead because:</p> +<ul> +<li>the machine code to do so is significantly smaller,</li> +<li>it is much easier to recognize the C functions in the ARC optimizer, and</li> +<li>a sufficient sophisticated runtime may be able to avoid the +message send in common cases.</li> +</ul> + +<p>Several other of these functions are <q>fused</q> operations which +can be described entirely in terms of other operations. We use the +fused operations primarily as a code-size optimization, although in +some cases there is also a real potential for avoiding redundant +operations in the runtime.</p> + +</div> + +<div id="runtime.objc_autorelease"> +<h1><tt>id objc_autorelease(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +adds the object to the innermost autorelease pool exactly as if the +object had been sent the <tt>autorelease</tt> message.</p> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_autorelease --> + +<div id="runtime.objc_autoreleasePoolPop"> +<h1><tt>void objc_autoreleasePoolPop(void *pool);</tt></h1> +<p><i>Precondition:</i> <tt>pool</tt> is the result of a previous call to +<a href="runtime.objc_autoreleasePoolPush"><tt>objc_autoreleasePoolPush</tt></a> +on the current thread, where neither <tt>pool</tt> nor any enclosing +pool have previously been popped.</p> +<p>Releases all the objects added to the given autorelease pool and +any autorelease pools it encloses, then sets the current autorelease +pool to the pool directly enclosing <tt>pool</tt>.</p> +</div> <!-- runtime.objc_autoreleasePoolPop --> + +<div id="runtime.objc_autoreleasePoolPush"> +<h1><tt>void *objc_autoreleasePoolPush(void);</tt></h1> +<p>Creates a new autorelease pool that is enclosed by the current +pool, makes that the current pool, and returns an opaque <q>handle</q> +to it.</p> + +<div class="rationale"><p>Rationale: while the interface is described +as an explicit hierarchy of pools, the rules allow the implementation +to just keep a stack of objects, using the stack depth as the opaque +pool handle.</p></div> + +</div> <!-- runtime.objc_autoreleasePoolPush --> + +<div id="runtime.objc_autoreleaseReturnValue"> +<h1><tt>id objc_autoreleaseReturnValue(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +makes a best effort to hand off ownership of a retain count on the +object to a call +to <a href="runtime.objc_retainAutoreleasedReturnValue"><tt>objc_retainAutoreleasedReturnValue</tt></a> +for the same object in an enclosing call frame. If this is not +possible, the object is autoreleased as above.</p> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_autoreleaseReturnValue --> + +<div id="runtime.objc_copyWeak"> +<h1><tt>void objc_copyWeak(id *dest, id *src);</tt></h1> +<p><i>Precondition:</i> <tt>src</tt> is a valid pointer which either +contains a null pointer or has been registered as a <tt>__weak</tt> +object. <tt>dest</tt> is a valid pointer which has not been +registered as a <tt>__weak</tt> object.</p> +<p><tt>dest</tt> is initialized to be equivalent to <tt>src</tt>, +potentially registering it with the runtime. Equivalent to the +following code:</p> +<pre>void objc_copyWeak(id *dest, id *src) { + objc_release(objc_initWeak(dest, objc_loadWeakRetained(src))); +}</pre> +<p>Must be atomic with respect to calls to <tt>objc_storeWeak</tt> +on <tt>src</tt>.</p> +</div> <!-- runtime.objc_copyWeak --> + +<div id="runtime.objc_destroyWeak"> +<h1><tt>void objc_destroyWeak(id *object);</tt></h1> +<p><i>Precondition:</i> <tt>object</tt> is a valid pointer which +either contains a null pointer or has been registered as +a <tt>__weak</tt> object.</p> +<p><tt>object</tt> is unregistered as a weak object, if it ever was. +The current value of <tt>object</tt> is left unspecified; otherwise, +equivalent to the following code:</p> +<pre>void objc_destroyWeak(id *object) { + objc_storeWeak(object, nil); +}</pre> +<p>Does not need to be atomic with respect to calls +to <tt>objc_storeWeak</tt> on <tt>object</tt>.</p> +</div> <!-- runtime.objc_destroyWeak --> + +<div id="runtime.objc_initWeak"> +<h1><tt>id objc_initWeak(id *object, id value);</tt></h1> +<p><i>Precondition:</i> <tt>object</tt> is a valid pointer which has +not been registered as a <tt>__weak</tt> object. <tt>value</tt> is +null or a pointer to a valid object.</p> +<p>If <tt>value</tt> is a null pointer or the object to which it +points has begun deallocation, <tt>object</tt> is zero-initialized. +Otherwise, <tt>object</tt> is registered as a <tt>__weak</tt> object +pointing to <tt>value</tt>. Equivalent to the following code:</p> +<pre>id objc_initWeak(id *object, id value) { + *object = nil; + return objc_storeWeak(object, value); +}</pre> +<p>Returns the value of <tt>object</tt> after the call.</p> +<p>Does not need to be atomic with respect to calls +to <tt>objc_storeWeak</tt> on <tt>object</tt>.</p> +</div> <!-- runtime.objc_initWeak --> + +<div id="runtime.objc_loadWeak"> +<h1><tt>id objc_loadWeak(id *object);</tt></h1> +<p><i>Precondition:</i> <tt>object</tt> is a valid pointer which +either contains a null pointer or has been registered as +a <tt>__weak</tt> object.</p> +<p>If <tt>object</tt> is registered as a <tt>__weak</tt> object, and +the last value stored into <tt>object</tt> has not yet been +deallocated or begun deallocation, retains and autoreleases that value +and returns it. Otherwise returns null. Equivalent to the following +code:</p> +<pre>id objc_loadWeak(id *object) { + return objc_autorelease(objc_loadWeakRetained(object)); +}</pre> +<p>Must be atomic with respect to calls to <tt>objc_storeWeak</tt> +on <tt>object</tt>.</p> +<div class="rationale">Rationale: loading weak references would be +inherently prone to race conditions without the retain.</div> +</div> <!-- runtime.objc_loadWeak --> + +<div id="runtime.objc_loadWeakRetained"> +<h1><tt>id objc_loadWeakRetained(id *object);</tt></h1> +<p><i>Precondition:</i> <tt>object</tt> is a valid pointer which +either contains a null pointer or has been registered as +a <tt>__weak</tt> object.</p> +<p>If <tt>object</tt> is registered as a <tt>__weak</tt> object, and +the last value stored into <tt>object</tt> has not yet been +deallocated or begun deallocation, retains that value and returns it. +Otherwise returns null.</p> +<p>Must be atomic with respect to calls to <tt>objc_storeWeak</tt> +on <tt>object</tt>.</p> +</div> <!-- runtime.objc_loadWeakRetained --> + +<div id="runtime.objc_moveWeak"> +<h1><tt>void objc_moveWeak(id *dest, id *src);</tt></h1> +<p><i>Precondition:</i> <tt>src</tt> is a valid pointer which either +contains a null pointer or has been registered as a <tt>__weak</tt> +object. <tt>dest</tt> is a valid pointer which has not been +registered as a <tt>__weak</tt> object.</p> +<p><tt>dest</tt> is initialized to be equivalent to <tt>src</tt>, +potentially registering it with the runtime. <tt>src</tt> may then be +left in its original state, in which case this call is equivalent +to <a href="#runtime.objc_copyWeak"><tt>objc_copyWeak</tt></a>, or it +may be left as null.</p> +<p>Must be atomic with respect to calls to <tt>objc_storeWeak</tt> +on <tt>src</tt>.</p> +</div> <!-- runtime.objc_moveWeak --> + +<div id="runtime.objc_release"> +<h1><tt>void objc_release(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +performs a release operation exactly as if the object had been sent +the <tt>release</tt> message.</p> +</div> <!-- runtime.objc_release --> + +<div id="runtime.objc_retain"> +<h1><tt>id objc_retain(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +performs a retain operation exactly as if the object had been sent +the <tt>retain</tt> message.</p> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_retain --> + +<div id="runtime.objc_retainAutorelease"> +<h1><tt>id objc_retainAutorelease(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +performs a retain operation followed by an autorelease operation. +Equivalent to the following code:</p> +<pre>id objc_retainAutorelease(id value) { + return objc_autorelease(objc_retain(value)); +}</pre> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_retainAutorelease --> + +<div id="runtime.objc_retainAutoreleaseReturnValue"> +<h1><tt>id objc_retainAutoreleaseReturnValue(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +performs a retain operation followed by the operation described in +<a href="#runtime.objc_autoreleaseReturnValue"><tt>objc_autoreleaseReturnValue</tt></a>. +Equivalent to the following code:</p> +<pre>id objc_retainAutoreleaseReturnValue(id value) { + return objc_autoreleaseReturnValue(objc_retain(value)); +}</pre> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_retainAutoreleaseReturnValue --> + +<div id="runtime.objc_retainAutoreleasedReturnValue"> +<h1><tt>id objc_retainAutoreleasedReturnValue(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, it +attempts to accept a hand off of a retain count from a call to +<a href="#runtime.objc_autoreleaseReturnValue"><tt>objc_autoreleaseReturnValue</tt></a> +on <tt>value</tt> in a recently-called function or something it +calls. If that fails, it performs a retain operation exactly +like <a href="#runtime.objc_retain"><tt>objc_retain</tt></a>.</p> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_retainAutoreleasedReturnValue --> + +<div id="runtime.objc_retainBlock"> +<h1><tt>id objc_retainBlock(id value);</tt></h1> +<p><i>Precondition:</i> <tt>value</tt> is null or a pointer to a +valid block object.</p> +<p>If <tt>value</tt> is null, this call has no effect. Otherwise, if +the block pointed to by <tt>value</tt> is still on the stack, it is +copied to the heap and the address of the copy is returned. Otherwise +a retain operation is performed on the block exactly as if it had been +sent the <tt>retain</tt> message.</p> +</div> <!-- runtime.objc_retainBlock --> + +<div id="runtime.objc_storeStrong"> +<h1><tt>id objc_storeStrong(id *object, id value);</tt></h1> +<p><i>Precondition:</i> <tt>object</tt> is a valid pointer to +a <tt>__strong</tt> object which is adequately aligned for a +pointer. <tt>value</tt> is null or a pointer to a valid object.</p> +<p>Performs the complete sequence for assigning to a <tt>__strong</tt> +object of non-block type. Equivalent to the following code:</p> +<pre>id objc_storeStrong(id *object, id value) { + value = [value retain]; + id oldValue = *object; + *object = value; + [oldValue release]; + return value; +}</pre> +<p>Always returns <tt>value</tt>.</p> +</div> <!-- runtime.objc_storeStrong --> + +<div id="runtime.objc_storeWeak"> +<h1><tt>id objc_storeWeak(id *object, id value);</tt></h1> +<p><i>Precondition:</i> <tt>object</tt> is a valid pointer which +either contains a null pointer or has been registered as +a <tt>__weak</tt> object. <tt>value</tt> is null or a pointer to a +valid object.</p> +<p>If <tt>value</tt> is a null pointer or the object to which it +points has begun deallocation, <tt>object</tt> is assigned null +and unregistered as a <tt>__weak</tt> object. Otherwise, +<tt>object</tt> is registered as a <tt>__weak</tt> object or has its +registration updated to point to <tt>value</tt>.</p> +<p>Returns the value of <tt>object</tt> after the call.</p> +</div> <!-- runtime.objc_storeWeak --> + +</div> <!-- runtime --> +</div> <!-- root --> +</body> +</html> diff --git a/clang/docs/Block-ABI-Apple.txt b/clang/docs/Block-ABI-Apple.txt new file mode 100644 index 0000000..917059b --- /dev/null +++ b/clang/docs/Block-ABI-Apple.txt @@ -0,0 +1,669 @@ +Block Implementation Specification + +Copyright 2008-2010 Apple, Inc. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +0. History + +2008/7/14 - created +2008/8/21 - revised, C++ +2008/9/24 - add NULL isa field to __block storage +2008/10/1 - revise block layout to use a static descriptor structure +2008/10/6 - revise block layout to use an unsigned long int flags +2008/10/28 - specify use of _Block_object_assign/dispose for all "Object" types in helper functions +2008/10/30 - revise new layout to have invoke function in same place +2008/10/30 - add __weak support + +2010/3/16 - rev for stret return, signature field +2010/4/6 - improved wording + +This document describes the Apple ABI implementation specification of Blocks. + +The first shipping version of this ABI is found in Mac OS X 10.6, and shall be referred to as 10.6.ABI. As of 2010/3/16, the following describes the ABI contract with the runtime and the compiler, and, as necessary, will be referred to as ABI.2010.3.16. + +Since the Apple ABI references symbols from other elements of the system, any attempt to use this ABI on systems prior to SnowLeopard is undefined. + +1. High Level + +The ABI of blocks consist of their layout and the runtime functions required by the compiler. +A Block consists of a structure of the following form: + +struct Block_literal_1 { + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int flags; + int reserved; + void (*invoke)(void *, ...); + struct Block_descriptor_1 { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + // optional helper functions + void (*copy_helper)(void *dst, void *src); // IFF (1<<25) + void (*dispose_helper)(void *src); // IFF (1<<25) + // required ABI.2010.3.16 + const char *signature; // IFF (1<<30) + } *descriptor; + // imported variables +}; + +The following flags bits are in use thusly for a possible ABI.2010.3.16: + +enum { + BLOCK_HAS_COPY_DISPOSE = (1 << 25), + BLOCK_HAS_CTOR = (1 << 26), // helpers have C++ code + BLOCK_IS_GLOBAL = (1 << 28), + BLOCK_HAS_STRET = (1 << 29), // IFF BLOCK_HAS_SIGNATURE + BLOCK_HAS_SIGNATURE = (1 << 30), +}; + +In 10.6.ABI the (1<<29) was usually set and was always ignored by the runtime - it had been a transitional marker that did not get deleted after the transition. This bit is now paired with (1<<30), and represented as the pair (3<<30), for the following combinations of valid bit settings, and their meanings. + +switch (flags & (3<<29)) { + case (0<<29): 10.6.ABI, no signature field available + case (1<<29): 10.6.ABI, no signature field available + case (2<<29): ABI.2010.3.16, regular calling convention, presence of signature field + case (3<<29): ABI.2010.3.16, stret calling convention, presence of signature field, +} + +The signature field is not always populated. + +The following discussions are presented as 10.6.ABI otherwise. + +Block literals may occur within functions where the structure is created in stack local memory. They may also appear as initialization expressions for Block variables of global or static local variables. + +When a Block literal expression is evaluated the stack based structure is initialized as follows: + +1) static descriptor structure is declared and initialized as follows: +1a) the invoke function pointer is set to a function that takes the Block structure as its first argument and the rest of the arguments (if any) to the Block and executes the Block compound statement. +1b) the size field is set to the size of the following Block literal structure. +1c) the copy_helper and dispose_helper function pointers are set to respective helper functions if they are required by the Block literal +2) a stack (or global) Block literal data structure is created and initialized as follows: +2a) the isa field is set to the address of the external _NSConcreteStackBlock, which is a block of uninitialized memory supplied in libSystem, or _NSConcreteGlobalBlock if this is a static or file level block literal. +2) The flags field is set to zero unless there are variables imported into the block that need helper functions for program level Block_copy() and Block_release() operations, in which case the (1<<25) flags bit is set. + + +As an example, the Block literal expression + ^ { printf("hello world\n"); } +would cause to be created on a 32-bit system: + +struct __block_literal_1 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_1 *); + struct __block_descriptor_1 *descriptor; +}; + +void __block_invoke_1(struct __block_literal_1 *_block) { + printf("hello world\n"); +} + +static struct __block_descriptor_1 { + unsigned long int reserved; + unsigned long int Block_size; +} __block_descriptor_1 = { 0, sizeof(struct __block_literal_1), __block_invoke_1 }; + +and where the block literal appeared + + struct __block_literal_1 _block_literal = { + &_NSConcreteStackBlock, + (1<<29), <uninitialized>, + __block_invoke_1, + &__block_descriptor_1 + }; + +Blocks import other Block references, const copies of other variables, and variables marked __block. In Objective-C variables may additionally be objects. + +When a Block literal expression used as the initial value of a global or static local variable it is initialized as follows: + struct __block_literal_1 __block_literal_1 = { + &_NSConcreteGlobalBlock, + (1<<28)|(1<<29), <uninitialized>, + __block_invoke_1, + &__block_descriptor_1 + }; +that is, a different address is provided as the first value and a particular (1<<28) bit is set in the flags field, and otherwise it is the same as for stack based Block literals. This is an optimization that can be used for any Block literal that imports no const or __block storage variables. + + +2. Imported Variables + +Variables of "auto" storage class are imported as const copies. Variables of "__block" storage class are imported as a pointer to an enclosing data structure. Global variables are simply referenced and not considered as imported. + +2.1 Imported const copy variables + +Automatic storage variables not marked with __block are imported as const copies. + +The simplest example is that of importing a variable of type int. + + int x = 10; + void (^vv)(void) = ^{ printf("x is %d\n", x); } + x = 11; + vv(); + +would be compiled + +struct __block_literal_2 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_2 *); + struct __block_descriptor_2 *descriptor; + const int x; +}; + +void __block_invoke_2(struct __block_literal_2 *_block) { + printf("x is %d\n", _block->x); +} + +static struct __block_descriptor_2 { + unsigned long int reserved; + unsigned long int Block_size; +} __block_descriptor_2 = { 0, sizeof(struct __block_literal_2) }; + +and + + struct __block_literal_2 __block_literal_2 = { + &_NSConcreteStackBlock, + (1<<29), <uninitialized>, + __block_invoke_2, + &__block_descriptor_2, + x + }; + +In summary, scalars, structures, unions, and function pointers are generally imported as const copies with no need for helper functions. + +2.2 Imported const copy of Block reference + +The first case where copy and dispose helper functions are required is for the case of when a block itself is imported. In this case both a copy_helper function and a dispose_helper function are needed. The copy_helper function is passed both the existing stack based pointer and the pointer to the new heap version and should call back into the runtime to actually do the copy operation on the imported fields within the block. The runtime functions are all described in Section 5.0 Runtime Helper Functions. + +An example: + + void (^existingBlock)(void) = ...; + void (^vv)(void) = ^{ existingBlock(); } + vv(); + +struct __block_literal_3 { + ...; // existing block +}; + +struct __block_literal_4 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_4 *); + struct __block_literal_3 *const existingBlock; +}; + +void __block_invoke_4(struct __block_literal_2 *_block) { + __block->existingBlock->invoke(__block->existingBlock); +} + +void __block_copy_4(struct __block_literal_4 *dst, struct __block_literal_4 *src) { + //_Block_copy_assign(&dst->existingBlock, src->existingBlock, 0); + _Block_object_assign(&dst->existingBlock, src->existingBlock, BLOCK_FIELD_IS_BLOCK); +} + +void __block_dispose_4(struct __block_literal_4 *src) { + // was _Block_destroy + _Block_object_dispose(src->existingBlock, BLOCK_FIELD_IS_BLOCK); +} + +static struct __block_descriptor_4 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_4 *dst, struct __block_literal_4 *src); + void (*dispose_helper)(struct __block_literal_4 *); +} __block_descriptor_4 = { + 0, + sizeof(struct __block_literal_4), + __block_copy_4, + __block_dispose_4, +}; + +and where it is used + + struct __block_literal_4 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<29), <uninitialized> + __block_invoke_4, + & __block_descriptor_4 + existingBlock, + }; + +2.2.1 Importing __attribute__((NSObject)) variables. + +GCC introduces __attribute__((NSObject)) on structure pointers to mean "this is an object". This is useful because many low level data structures are declared as opaque structure pointers, e.g. CFStringRef, CFArrayRef, etc. When used from C, however, these are still really objects and are the second case where that requires copy and dispose helper functions to be generated. The copy helper functions generated by the compiler should use the _Block_object_assign runtime helper function and in the dispose helper the _Block_object_dispose runtime helper function should be called. + +For example, block xyzzy in the following + + struct Opaque *__attribute__((NSObject)) objectPointer = ...; + ... + void (^xyzzy)(void) = ^{ CFPrint(objectPointer); }; + +would have helper functions + +void __block_copy_xyzzy(struct __block_literal_5 *dst, struct __block_literal_5 *src) { + _Block_object_assign(&dst->objectPointer, src-> objectPointer, BLOCK_FIELD_IS_OBJECT); +} + +void __block_dispose_xyzzy(struct __block_literal_5 *src) { + _Block_object_dispose(src->objectPointer, BLOCK_FIELD_IS_OBJECT); +} + +generated. + + +2.3 Imported __block marked variables. + +2.3.1 Layout of __block marked variables + +The compiler must embed variables that are marked __block in a specialized structure of the form: + +struct _block_byref_xxxx { + void *isa; + struct Block_byref *forwarding; + int flags; //refcount; + int size; + typeof(marked_variable) marked_variable; +}; + +Variables of certain types require helper functions for when Block_copy() and Block_release() are performed upon a referencing Block. At the "C" level only variables that are of type Block or ones that have __attribute__((NSObject)) marked require helper functions. In Objective-C objects require helper functions and in C++ stack based objects require helper functions. Variables that require helper functions use the form: + +struct _block_byref_xxxx { + void *isa; + struct _block_byref_xxxx *forwarding; + int flags; //refcount; + int size; + // helper functions called via Block_copy() and Block_release() + void (*byref_keep)(void *dst, void *src); + void (*byref_dispose)(void *); + typeof(marked_variable) marked_variable; +}; + +The structure is initialized such that + a) the forwarding pointer is set to the beginning of its enclosing structure, + b) the size field is initialized to the total size of the enclosing structure, + c) the flags field is set to either 0 if no helper functions are needed or (1<<25) if they are, + d) the helper functions are initialized (if present) + e) the variable itself is set to its initial value. + f) the isa field is set to NULL + +2.3.2 Access to __block variables from within its lexical scope. + +In order to "move" the variable to the heap upon a copy_helper operation the compiler must rewrite access to such a variable to be indirect through the structures forwarding pointer. For example: + + int __block i = 10; + i = 11; + +would be rewritten to be: + + struct _block_byref_i { + void *isa; + struct _block_byref_i *forwarding; + int flags; //refcount; + int size; + int captured_i; + } i = { NULL, &i, 0, sizeof(struct _block_byref_i), 10 }; + + i.forwarding->captured_i = 11; + +In the case of a Block reference variable being marked __block the helper code generated must use the _Block_object_assign and _Block_object_dispose routines supplied by the runtime to make the copies. For example: + + __block void (voidBlock)(void) = blockA; + voidBlock = blockB; + +would translate into + +struct _block_byref_voidBlock { + void *isa; + struct _block_byref_voidBlock *forwarding; + int flags; //refcount; + int size; + void (*byref_keep)(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src); + void (*byref_dispose)(struct _block_byref_voidBlock *); + void (^captured_voidBlock)(void); +}; + +void _block_byref_keep_helper(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src) { + //_Block_copy_assign(&dst->captured_voidBlock, src->captured_voidBlock, 0); + _Block_object_assign(&dst->captured_voidBlock, src->captured_voidBlock, BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER); +} + +void _block_byref_dispose_helper(struct _block_byref_voidBlock *param) { + //_Block_destroy(param->captured_voidBlock, 0); + _Block_object_dispose(param->captured_voidBlock, BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER)} + +and + struct _block_byref_voidBlock voidBlock = {( .forwarding=&voidBlock, .flags=(1<<25), .size=sizeof(struct _block_byref_voidBlock *), + .byref_keep=_block_byref_keep_helper, .byref_dispose=_block_byref_dispose_helper, + .captured_voidBlock=blockA )}; + + voidBlock.forwarding->captured_voidBlock = blockB; + + +2.3.3 Importing __block variables into Blocks + +A Block that uses a __block variable in its compound statement body must import the variable and emit copy_helper and dispose_helper helper functions that, in turn, call back into the runtime to actually copy or release the byref data block using the functions _Block_object_assign and _Block_object_dispose. + +For example: + + int __block i = 2; + functioncall(^{ i = 10; }); + +would translate to + +struct _block_byref_i { + void *isa; // set to NULL + struct _block_byref_voidBlock *forwarding; + int flags; //refcount; + int size; + void (*byref_keep)(struct _block_byref_i *dst, struct _block_byref_i *src); + void (*byref_dispose)(struct _block_byref_i *); + int captured_i; +}; + + +struct __block_literal_5 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_5 *); + struct __block_descriptor_5 *descriptor; + struct _block_byref_i *i_holder; +}; + +void __block_invoke_5(struct __block_literal_5 *_block) { + _block->forwarding->captured_i = 10; +} + +void __block_copy_5(struct __block_literal_5 *dst, struct __block_literal_5 *src) { + //_Block_byref_assign_copy(&dst->captured_i, src->captured_i); + _Block_object_assign(&dst->captured_i, src->captured_i, BLOCK_FIELD_IS_BYREF | BLOCK_BYREF_CALLER); +} + +void __block_dispose_5(struct __block_literal_5 *src) { + //_Block_byref_release(src->captured_i); + _Block_object_dispose(src->captured_i, BLOCK_FIELD_IS_BYREF | BLOCK_BYREF_CALLER); +} + +static struct __block_descriptor_5 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_5 *dst, struct __block_literal_5 *src); + void (*dispose_helper)(struct __block_literal_5 *); +} __block_descriptor_5 = { 0, sizeof(struct __block_literal_5) __block_copy_5, __block_dispose_5 }; + +and + + struct _block_byref_i i = {( .forwarding=&i, .flags=0, .size=sizeof(struct _block_byref_i) )}; + struct __block_literal_5 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<29), <uninitialized>, + __block_invoke_5, + &__block_descriptor_5, + 2, + }; + +2.3.4 Importing __attribute__((NSObject)) __block variables + +A __block variable that is also marked __attribute__((NSObject)) should have byref_keep and byref_dispose helper functions that use _Block_object_assign and _Block_object_dispose. + +2.3.5 __block escapes + +Because Blocks referencing __block variables may have Block_copy() performed upon them the underlying storage for the variables may move to the heap. In Objective-C Garbage Collection Only compilation environments the heap used is the garbage collected one and no further action is required. Otherwise the compiler must issue a call to potentially release any heap storage for __block variables at all escapes or terminations of their scope. The call should be: + + _Block_object_dispose(&_block_byref_xxx, BLOCK_FIELD_IS_BYREF); + + +2.3.6 Nesting + +Blocks may contain Block literal expressions. Any variables used within inner blocks are imported into all enclosing Block scopes even if the variables are not used. This includes const imports as well as __block variables. + +3. Objective C Extensions to Blocks + +3.1 Importing Objects + +Objects should be treated as __attribute__((NSObject)) variables; all copy_helper, dispose_helper, byref_keep, and byref_dispose helper functions should use _Block_object_assign and _Block_object_dispose. There should be no code generated that uses -retain or -release methods. + + +3.2 Blocks as Objects + +The compiler will treat Blocks as objects when synthesizing property setters and getters, will characterize them as objects when generating garbage collection strong and weak layout information in the same manner as objects, and will issue strong and weak write-barrier assignments in the same manner as objects. + +3.3 __weak __block Support + +Objective-C (and Objective-C++) support the __weak attribute on __block variables. Under normal circumstances the compiler uses the Objective-C runtime helper support functions objc_assign_weak and objc_read_weak. Both should continue to be used for all reads and writes of __weak __block variables: + objc_read_weak(&block->byref_i->forwarding->i) + +The __weak variable is stored in a _block_byref_xxxx structure and the Block has copy and dispose helpers for this structure that call: + _Block_object_assign(&dest->_block_byref_i, src-> _block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BYREF); +and + _Block_object_dispose(src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BYREF); + + +In turn, the block_byref copy support helpers distinguish between whether the __block variable is a Block or not and should either call: + _Block_object_assign(&dest->_block_byref_i, src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_OBJECT | BLOCK_BYREF_CALLER); +for something declared as an object or + _Block_object_assign(&dest->_block_byref_i, src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER); +for something declared as a Block. + +A full example follows: + + + __block __weak id obj = <initialization expression>; + functioncall(^{ [obj somemessage]; }); + +would translate to + +struct _block_byref_obj { + void *isa; // uninitialized + struct _block_byref_obj *forwarding; + int flags; //refcount; + int size; + void (*byref_keep)(struct _block_byref_i *dst, struct _block_byref_i *src); + void (*byref_dispose)(struct _block_byref_i *); + id captured_obj; +}; + +void _block_byref_obj_keep(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src) { + //_Block_copy_assign(&dst->captured_obj, src->captured_obj, 0); + _Block_object_assign(&dst->captured_obj, src->captured_obj, BLOCK_FIELD_IS_OBJECT | BLOCK_FIELD_IS_WEAK | BLOCK_BYREF_CALLER); +} + +void _block_byref_obj_dispose(struct _block_byref_voidBlock *param) { + //_Block_destroy(param->captured_obj, 0); + _Block_object_dispose(param->captured_obj, BLOCK_FIELD_IS_OBJECT | BLOCK_FIELD_IS_WEAK | BLOCK_BYREF_CALLER); +}; + +for the block byref part and + +struct __block_literal_5 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_5 *); + struct __block_descriptor_5 *descriptor; + struct _block_byref_obj *byref_obj; +}; + +void __block_invoke_5(struct __block_literal_5 *_block) { + [objc_read_weak(&_block->byref_obj->forwarding->captured_obj) somemessage]; +} + +void __block_copy_5(struct __block_literal_5 *dst, struct __block_literal_5 *src) { + //_Block_byref_assign_copy(&dst->byref_obj, src->byref_obj); + _Block_object_assign(&dst->byref_obj, src->byref_obj, BLOCK_FIELD_IS_BYREF | BLOCK_FIELD_IS_WEAK); +} + +void __block_dispose_5(struct __block_literal_5 *src) { + //_Block_byref_release(src->byref_obj); + _Block_object_dispose(src->byref_obj, BLOCK_FIELD_IS_BYREF | BLOCK_FIELD_IS_WEAK); +} + +static struct __block_descriptor_5 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_5 *dst, struct __block_literal_5 *src); + void (*dispose_helper)(struct __block_literal_5 *); +} __block_descriptor_5 = { 0, sizeof(struct __block_literal_5), __block_copy_5, __block_dispose_5 }; + +and within the compound statement: + + struct _block_byref_obj obj = {( .forwarding=&obj, .flags=(1<<25), .size=sizeof(struct _block_byref_obj), + .byref_keep=_block_byref_obj_keep, .byref_dispose=_block_byref_obj_dispose, + .captured_obj = <initialization expression> )}; + + struct __block_literal_5 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<29), <uninitialized>, + __block_invoke_5, + &__block_descriptor_5, + &obj, // a reference to the on-stack structure containing "captured_obj" + }; + + + functioncall(_block_literal->invoke(&_block_literal)); + + +4.0 C++ Support + +Within a block stack based C++ objects are copied into const copies using the copy constructor. It is an error if a stack based C++ object is used within a block if it does not have a copy constructor. In addition both copy and destroy helper routines must be synthesized for the block to support the Block_copy() operation, and the flags work marked with the (1<<26) bit in addition to the (1<<25) bit. The copy helper should call the constructor using appropriate offsets of the variable within the supplied stack based block source and heap based destination for all const constructed copies, and similarly should call the destructor in the destroy routine. + +As an example, suppose a C++ class FOO existed with a copy constructor. Within a code block a stack version of a FOO object is declared and used within a Block literal expression: + +{ + FOO foo; + void (^block)(void) = ^{ printf("%d\n", foo.value()); }; +} + +The compiler would synthesize + +struct __block_literal_10 { + void *isa; + int flags; + int reserved; + void (*invoke)(struct __block_literal_10 *); + struct __block_descriptor_10 *descriptor; + const FOO foo; +}; + +void __block_invoke_10(struct __block_literal_10 *_block) { + printf("%d\n", _block->foo.value()); +} + +void __block_literal_10(struct __block_literal_10 *dst, struct __block_literal_10 *src) { + FOO_ctor(&dst->foo, &src->foo); +} + +void __block_dispose_10(struct __block_literal_10 *src) { + FOO_dtor(&src->foo); +} + +static struct __block_descriptor_10 { + unsigned long int reserved; + unsigned long int Block_size; + void (*copy_helper)(struct __block_literal_10 *dst, struct __block_literal_10 *src); + void (*dispose_helper)(struct __block_literal_10 *); +} __block_descriptor_10 = { 0, sizeof(struct __block_literal_10), __block_copy_10, __block_dispose_10 }; + +and the code would be: +{ + FOO foo; + comp_ctor(&foo); // default constructor + struct __block_literal_10 _block_literal = { + &_NSConcreteStackBlock, + (1<<25)|(1<<26)|(1<<29), <uninitialized>, + __block_invoke_10, + &__block_descriptor_10, + }; + comp_ctor(&_block_literal->foo, &foo); // const copy into stack version + struct __block_literal_10 &block = &_block_literal; // assign literal to block variable + block->invoke(block); // invoke block + comp_dtor(&_block_literal->foo); // destroy stack version of const block copy + comp_dtor(&foo); // destroy original version +} + + +C++ objects stored in __block storage start out on the stack in a block_byref data structure as do other variables. Such objects (if not const objects) must support a regular copy constructor. The block_byref data structure will have copy and destroy helper routines synthesized by the compiler. The copy helper will have code created to perform the copy constructor based on the initial stack block_byref data structure, and will also set the (1<<26) bit in addition to the (1<<25) bit. The destroy helper will have code to do the destructor on the object stored within the supplied block_byref heap data structure. For example, + + __block FOO blockStorageFoo; + +requires the normal constructor for the embedded blockStorageFoo object + + FOO_ctor(& _block_byref_blockStorageFoo->blockStorageFoo); + +and at scope termination the destructor: + + FOO_dtor(& _block_byref_blockStorageFoo->blockStorageFoo); + +Note that the forwarding indirection is NOT used. + +The compiler would need to generate (if used from a block literal) the following copy/dispose helpers: + +void _block_byref_obj_keep(struct _block_byref_blockStorageFoo *dst, struct _block_byref_blockStorageFoo *src) { + FOO_ctor(&dst->blockStorageFoo, &src->blockStorageFoo); +} + +void _block_byref_obj_dispose(struct _block_byref_blockStorageFoo *src) { + FOO_dtor(&src->blockStorageFoo); +} + +for the appropriately named constructor and destructor for the class/struct FOO. + +To support member variable and function access the compiler will synthesize a const pointer to a block version of the "this" pointer. + +5.0 Runtime Helper Functions + +The runtime helper functions are described in /usr/local/include/Block_private.h. To summarize their use, a block requires copy/dispose helpers if it imports any block variables, __block storage variables, __attribute__((NSObject)) variables, or C++ const copied objects with constructor/destructors. The (1<<26) bit is set and functions are generated. + +The block copy helper function should, for each of the variables of the type mentioned above, call + _Block_object_assign(&dst->target, src->target, BLOCK_FIELD_<appropo>); +in the copy helper and + _Block_object_dispose(->target, BLOCK_FIELD_<appropo>); +in the dispose helper where + <appropo> is + +enum { + BLOCK_FIELD_IS_OBJECT = 3, // id, NSObject, __attribute__((NSObject)), block, ... + BLOCK_FIELD_IS_BLOCK = 7, // a block variable + BLOCK_FIELD_IS_BYREF = 8, // the on stack structure holding the __block variable + + BLOCK_FIELD_IS_WEAK = 16, // declared __weak + + BLOCK_BYREF_CALLER = 128, // called from byref copy/dispose helpers +}; + +and of course the CTORs/DTORs for const copied C++ objects. + +The block_byref data structure similarly requires copy/dispose helpers for block variables, __attribute__((NSObject)) variables, or C++ const copied objects with constructor/destructors, and again the (1<<26) bit is set and functions are generated in the same manner. + +Under ObjC we allow __weak as an attribute on __block variables, and this causes the addition of BLOCK_FIELD_IS_WEAK orred onto the BLOCK_FIELD_IS_BYREF flag when copying the block_byref structure in the block copy helper, and onto the BLOCK_FIELD_<appropo> field within the block_byref copy/dispose helper calls. + +The prototypes, and summary, of the helper functions are + +/* Certain field types require runtime assistance when being copied to the heap. The following function is used + to copy fields of types: blocks, pointers to byref structures, and objects (including __attribute__((NSObject)) pointers. + BLOCK_FIELD_IS_WEAK is orthogonal to the other choices which are mutually exclusive. + Only in a Block copy helper will one see BLOCK_FIELD_IS_BYREF. + */ +void _Block_object_assign(void *destAddr, const void *object, const int flags); + +/* Similarly a compiler generated dispose helper needs to call back for each field of the byref data structure. + (Currently the implementation only packs one field into the byref structure but in principle there could be more). + The same flags used in the copy helper should be used for each call generated to this function: + */ +void _Block_object_dispose(const void *object, const int flags); diff --git a/clang/docs/BlockLanguageSpec.txt b/clang/docs/BlockLanguageSpec.txt new file mode 100644 index 0000000..f7bbda3 --- /dev/null +++ b/clang/docs/BlockLanguageSpec.txt @@ -0,0 +1,165 @@ +Language Specification for Blocks + +2008/2/25 — created +2008/7/28 — revised, __block syntax +2008/8/13 — revised, Block globals +2008/8/21 — revised, C++ elaboration +2008/11/1 — revised, __weak support +2009/1/12 — revised, explicit return types +2009/2/10 — revised, __block objects need retain + +Copyright 2008-2009 Apple, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +The Block Type + +A new derived type is introduced to C and, by extension, Objective-C, C++, and Objective-C++. Like function types, the Block type is a pair consisting of a result value type and a list of parameter types very similar to a function type. Blocks are intended to be used much like functions with the key distinction being that in addition to executable code they also contain various variable bindings to automatic (stack) or managed (heap) memory. + +The abstract declarator int (^)(char, float) describes a reference to a Block that, when invoked, takes two parameters, the first of type char and the second of type float, and returns a value of type int. The Block referenced is of opaque data that may reside in automatic (stack) memory, global memory, or heap memory. + + +Block Variable Declarations + +A variable with Block type is declared using function pointer style notation substituting ^ for *. The following are valid Block variable declarations: + void (^blockReturningVoidWithVoidArgument)(void); + int (^blockReturningIntWithIntAndCharArguments)(int, char); + void (^arrayOfTenBlocksReturningVoidWithIntArgument[10])(int); + +Variadic ... arguments are supported. [variadic.c] A Block that takes no arguments must specify void in the argument list [voidarg.c]. An empty parameter list does not represent, as K&R provide, an unspecified argument list. Note: both gcc and clang support K&R style as a convenience. + +A Block reference may be cast to a pointer of arbitrary type and vice versa. [cast.c] A Block reference may not be dereferenced via the pointer dereference operator *, and thus a Block's size may not be computed at compile time. [sizeof.c] + + +Block Literal Expressions + +A Block literal expression produces a reference to a Block. It is introduced by the use of the ^ token as a unary operator. + Block_literal_expression ::= ^ block_decl compound_statement_body + block_decl ::= + block_decl ::= parameter_list + block_decl ::= type_expression + +...where type expression is extended to allow ^ as a Block reference (pointer) where * is allowed as a function reference (pointer). + +The following Block literal: + ^ void (void) { printf("hello world\n"); } + +...produces a reference to a Block with no arguments with no return value. + +The return type is optional and is inferred from the return statements. If the return statements return a value, they all must return a value of the same type. If there is no value returned the inferred type of the Block is void; otherwise it is the type of the return statement value. + +If the return type is omitted and the argument list is ( void ), the ( void ) argument list may also be omitted. + +So: + ^ ( void ) { printf("hello world\n"); } + +...and: + ^ { printf("hello world\n"); } + +...are exactly equivalent constructs for the same expression. + +The type_expression extends C expression parsing to accommodate Block reference declarations as it accommodates function pointer declarations. + +Given: + typedef int (*pointerToFunctionThatReturnsIntWithCharArg)(char); + pointerToFunctionThatReturnsIntWithCharArg functionPointer; + + ^ pointerToFunctionThatReturnsIntWithCharArg (float x) { return functionPointer; } + +...and: + ^ int ((*)(float x))(char) { return functionPointer; } + +...are equivalent expressions, as is: + + ^(float x) { return functionPointer; } + +[returnfunctionptr.c] + +The compound statement body establishes a new lexical scope within that of its parent. Variables used within the scope of the compound statement are bound to the Block in the normal manner with the exception of those in automatic (stack) storage. Thus one may access functions and global variables as one would expect, as well as static local variables. [testme] + +Local automatic (stack) variables referenced within the compound statement of a Block are imported and captured by the Block as const copies. The capture (binding) is performed at the time of the Block literal expression evaluation. + +The lifetime of variables declared in a Block is that of a function; each activation frame contains a new copy of variables declared within the local scope of the Block. Such variable declarations should be allowed anywhere [testme] rather than only when C99 parsing is requested, including for statements. [testme] + +Block literal expressions may occur within Block literal expressions (nest) and all variables captured by any nested blocks are implicitly also captured in the scopes of their enclosing Blocks. + +A Block literal expression may be used as the initialization value for Block variables at global or local static scope. + + +The Invoke Operator + +Blocks are invoked using function call syntax with a list of expression parameters of types corresponding to the declaration and returning a result type also according to the declaration. Given: + int (^x)(char); + void (^z)(void); + int (^(*y))(char) = &x; + +...the following are all legal Block invocations: + x('a'); + (*y)('a'); + (true ? x : *y)('a') + + +The Copy and Release Operations + +The compiler and runtime provide copy and release operations for Block references that create and, in matched use, release allocated storage for referenced Blocks. + +The copy operation Block_copy() is styled as a function that takes an arbitrary Block reference and returns a Block reference of the same type. The release operation, Block_release(), is styled as a function that takes an arbitrary Block reference and, if dynamically matched to a Block copy operation, allows recovery of the referenced allocated memory. + + +The __block Storage Qualifier + +In addition to the new Block type we also introduce a new storage qualifier, __block, for local variables. [testme: a __block declaration within a block literal] The __block storage qualifier is mutually exclusive to the existing local storage qualifiers auto, register, and static.[testme] Variables qualified by __block act as if they were in allocated storage and this storage is automatically recovered after last use of said variable. An implementation may choose an optimization where the storage is initially automatic and only "moved" to allocated (heap) storage upon a Block_copy of a referencing Block. Such variables may be mutated as normal variables are. + +In the case where a __block variable is a Block one must assume that the __block variable resides in allocated storage and as such is assumed to reference a Block that is also in allocated storage (that it is the result of a Block_copy operation). Despite this there is no provision to do a Block_copy or a Block_release if an implementation provides initial automatic storage for Blocks. This is due to the inherent race condition of potentially several threads trying to update the shared variable and the need for synchronization around disposing of older values and copying new ones. Such synchronization is beyond the scope of this language specification. + + +Control Flow + +The compound statement of a Block is treated much like a function body with respect to control flow in that goto, break, and continue do not escape the Block. Exceptions are treated "normally" in that when thrown they pop stack frames until a catch clause is found. + + +Objective-C Extensions + +Objective-C extends the definition of a Block reference type to be that also of id. A variable or expression of Block type may be messaged or used as a parameter wherever an id may be. The converse is also true. Block references may thus appear as properties and are subject to the assign, retain, and copy attribute logic that is reserved for objects. + +All Blocks are constructed to be Objective-C objects regardless of whether the Objective-C runtime is operational in the program or not. Blocks using automatic (stack) memory are objects and may be messaged, although they may not be assigned into __weak locations if garbage collection is enabled. + +Within a Block literal expression within a method definition references to instance variables are also imported into the lexical scope of the compound statement. These variables are implicitly qualified as references from self, and so self is imported as a const copy. The net effect is that instance variables can be mutated. + +The Block_copy operator retains all objects held in variables of automatic storage referenced within the Block expression (or form strong references if running under garbage collection). Object variables of __block storage type are assumed to hold normal pointers with no provision for retain and release messages. + +Foundation defines (and supplies) -copy and -release methods for Blocks. + +In the Objective-C and Objective-C++ languages, we allow the __weak specifier for __block variables of object type. If garbage collection is not enabled, this qualifier causes these variables to be kept without retain messages being sent. This knowingly leads to dangling pointers if the Block (or a copy) outlives the lifetime of this object. + +In garbage collected environments, the __weak variable is set to nil when the object it references is collected, as long as the __block variable resides in the heap (either by default or via Block_copy()). The initial Apple implementation does in fact start __block variables on the stack and migrate them to the heap only as a result of a Block_copy() operation. + +It is a runtime error to attempt to assign a reference to a stack-based Block into any storage marked __weak, including __weak __block variables. + + +C++ Extensions + +Block literal expressions within functions are extended to allow const use of C++ objects, pointers, or references held in automatic storage. + +For example, given class Foo with member function fighter(void): + Foo foo; + Foo &fooRef = foo; + Foo *fooPtr = &foo; + +...a Block that used foo would import the variables as const variations: + const Foo block_foo = foo; // const copy constructor + const Foo &block_fooRef = fooRef; + Foo *const block_fooPtr = fooPtr; + +Stack-local objects are copied into a Block via a copy const constructor. If no such constructor exists, it is considered an error to reference such objects from within the Block compound statements. A destructor is run as control leaves the compound statement that contains the Block literal expression. + +If a Block originates on the stack, a const copy constructor of the stack-based Block const copy is performed when a Block_copy operation is called; when the last Block_release (or subsequently GC) occurs, a destructor is run on the heap copy. + +Variables declared as residing in __block storage may be initially allocated in the heap or may first appear on the stack and be copied to the heap as a result of a Block_copy() operation. When copied from the stack, a normal copy constructor is used to initialize the heap-based version from the original stack version. The destructor for a const copied object is run at the normal end of scope. The destructor for any initial stack based version is also called at normal end of scope. + +Within a member function, access to member functions and variables is done via an implicit const copy of a this pointer. + +Member variables that are Blocks may not be overloaded by the types of their arguments. + diff --git a/clang/docs/DriverArchitecture.png b/clang/docs/DriverArchitecture.png Binary files differnew file mode 100644 index 0000000..056a70a --- /dev/null +++ b/clang/docs/DriverArchitecture.png diff --git a/clang/docs/DriverInternals.html b/clang/docs/DriverInternals.html new file mode 100644 index 0000000..ce707b9 --- /dev/null +++ b/clang/docs/DriverInternals.html @@ -0,0 +1,523 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <title>Clang Driver Manual</title> + <link type="text/css" rel="stylesheet" href="../menu.css"> + <link type="text/css" rel="stylesheet" href="../content.css"> + <style type="text/css"> + td { + vertical-align: top; + } + </style> + </head> + <body> + + <!--#include virtual="../menu.html.incl"--> + + <div id="content"> + + <h1>Driver Design & Internals</h1> + + <ul> + <li><a href="#intro">Introduction</a></li> + <li><a href="#features">Features and Goals</a> + <ul> + <li><a href="#gcccompat">GCC Compatibility</a></li> + <li><a href="#components">Flexible</a></li> + <li><a href="#performance">Low Overhead</a></li> + <li><a href="#simple">Simple</a></li> + </ul> + </li> + <li><a href="#design">Design</a> + <ul> + <li><a href="#int_intro">Internals Introduction</a></li> + <li><a href="#int_overview">Design Overview</a></li> + <li><a href="#int_notes">Additional Notes</a> + <ul> + <li><a href="#int_compilation">The Compilation Object</a></li> + <li><a href="#int_unified_parsing">Unified Parsing & Pipelining</a></li> + <li><a href="#int_toolchain_translation">ToolChain Argument Translation</a></li> + <li><a href="#int_unused_warnings">Unused Argument Warnings</a></li> + </ul> + </li> + <li><a href="#int_gcc_concepts">Relation to GCC Driver Concepts</a></li> + </ul> + </li> + </ul> + + + <!-- ======================================================================= --> + <h2 id="intro">Introduction</h2> + <!-- ======================================================================= --> + + <p>This document describes the Clang driver. The purpose of this + document is to describe both the motivation and design goals + for the driver, as well as details of the internal + implementation.</p> + + <!-- ======================================================================= --> + <h2 id="features">Features and Goals</h2> + <!-- ======================================================================= --> + + <p>The Clang driver is intended to be a production quality + compiler driver providing access to the Clang compiler and + tools, with a command line interface which is compatible with + the gcc driver.</p> + + <p>Although the driver is part of and driven by the Clang + project, it is logically a separate tool which shares many of + the same goals as Clang:</p> + + <p><b>Features</b>:</p> + <ul> + <li><a href="#gcccompat">GCC Compatibility</a></li> + <li><a href="#components">Flexible</a></li> + <li><a href="#performance">Low Overhead</a></li> + <li><a href="#simple">Simple</a></li> + </ul> + + <!--=======================================================================--> + <h3 id="gcccompat">GCC Compatibility</h3> + <!--=======================================================================--> + + <p>The number one goal of the driver is to ease the adoption of + Clang by allowing users to drop Clang into a build system + which was designed to call GCC. Although this makes the driver + much more complicated than might otherwise be necessary, we + decided that being very compatible with the gcc command line + interface was worth it in order to allow users to quickly test + clang on their projects.</p> + + <!--=======================================================================--> + <h3 id="components">Flexible</h3> + <!--=======================================================================--> + + <p>The driver was designed to be flexible and easily accommodate + new uses as we grow the clang and LLVM infrastructure. As one + example, the driver can easily support the introduction of + tools which have an integrated assembler; something we hope to + add to LLVM in the future.</p> + + <p>Similarly, most of the driver functionality is kept in a + library which can be used to build other tools which want to + implement or accept a gcc like interface. </p> + + <!--=======================================================================--> + <h3 id="performance">Low Overhead</h3> + <!--=======================================================================--> + + <p>The driver should have as little overhead as possible. In + practice, we found that the gcc driver by itself incurred a + small but meaningful overhead when compiling many small + files. The driver doesn't do much work compared to a + compilation, but we have tried to keep it as efficient as + possible by following a few simple principles:</p> + <ul> + <li>Avoid memory allocation and string copying when + possible.</li> + + <li>Don't parse arguments more than once.</li> + + <li>Provide a few simple interfaces for efficiently searching + arguments.</li> + </ul> + + <!--=======================================================================--> + <h3 id="simple">Simple</h3> + <!--=======================================================================--> + + <p>Finally, the driver was designed to be "as simple as + possible", given the other goals. Notably, trying to be + completely compatible with the gcc driver adds a significant + amount of complexity. However, the design of the driver + attempts to mitigate this complexity by dividing the process + into a number of independent stages instead of a single + monolithic task.</p> + + <!-- ======================================================================= --> + <h2 id="design">Internal Design and Implementation</h2> + <!-- ======================================================================= --> + + <ul> + <li><a href="#int_intro">Internals Introduction</a></li> + <li><a href="#int_overview">Design Overview</a></li> + <li><a href="#int_notes">Additional Notes</a></li> + <li><a href="#int_gcc_concepts">Relation to GCC Driver Concepts</a></li> + </ul> + + <!--=======================================================================--> + <h3><a name="int_intro">Internals Introduction</a></h3> + <!--=======================================================================--> + + <p>In order to satisfy the stated goals, the driver was designed + to completely subsume the functionality of the gcc executable; + that is, the driver should not need to delegate to gcc to + perform subtasks. On Darwin, this implies that the Clang + driver also subsumes the gcc driver-driver, which is used to + implement support for building universal images (binaries and + object files). This also implies that the driver should be + able to call the language specific compilers (e.g. cc1) + directly, which means that it must have enough information to + forward command line arguments to child processes + correctly.</p> + + <!--=======================================================================--> + <h3><a name="int_overview">Design Overview</a></h3> + <!--=======================================================================--> + + <p>The diagram below shows the significant components of the + driver architecture and how they relate to one another. The + orange components represent concrete data structures built by + the driver, the green components indicate conceptually + distinct stages which manipulate these data structures, and + the blue components are important helper classes. </p> + + <div style="text-align:center"> + <a href="DriverArchitecture.png"> + <img width=400 src="DriverArchitecture.png" + alt="Driver Architecture Diagram"> + </a> + </div> + + <!--=======================================================================--> + <h3><a name="int_stages">Driver Stages</a></h3> + <!--=======================================================================--> + + <p>The driver functionality is conceptually divided into five stages:</p> + + <ol> + <li> + <b>Parse: Option Parsing</b> + + <p>The command line argument strings are decomposed into + arguments (<tt>Arg</tt> instances). The driver expects to + understand all available options, although there is some + facility for just passing certain classes of options + through (like <tt>-Wl,</tt>).</p> + + <p>Each argument corresponds to exactly one + abstract <tt>Option</tt> definition, which describes how + the option is parsed along with some additional + metadata. The Arg instances themselves are lightweight and + merely contain enough information for clients to determine + which option they correspond to and their values (if they + have additional parameters).</p> + + <p>For example, a command line like "-Ifoo -I foo" would + parse to two Arg instances (a JoinedArg and a SeparateArg + instance), but each would refer to the same Option.</p> + + <p>Options are lazily created in order to avoid populating + all Option classes when the driver is loaded. Most of the + driver code only needs to deal with options by their + unique ID (e.g., <tt>options::OPT_I</tt>),</p> + + <p>Arg instances themselves do not generally store the + values of parameters. In many cases, this would + simply result in creating unnecessary string + copies. Instead, Arg instances are always embedded inside + an ArgList structure, which contains the original vector + of argument strings. Each Arg itself only needs to contain + an index into this vector instead of storing its values + directly.</p> + + <p>The clang driver can dump the results of this + stage using the <tt>-ccc-print-options</tt> flag (which + must precede any actual command line arguments). For + example:</p> + <pre> + $ <b>clang -ccc-print-options -Xarch_i386 -fomit-frame-pointer -Wa,-fast -Ifoo -I foo t.c</b> + Option 0 - Name: "-Xarch_", Values: {"i386", "-fomit-frame-pointer"} + Option 1 - Name: "-Wa,", Values: {"-fast"} + Option 2 - Name: "-I", Values: {"foo"} + Option 3 - Name: "-I", Values: {"foo"} + Option 4 - Name: "<input>", Values: {"t.c"} + </pre> + + <p>After this stage is complete the command line should be + broken down into well defined option objects with their + appropriate parameters. Subsequent stages should rarely, + if ever, need to do any string processing.</p> + </li> + + <li> + <b>Pipeline: Compilation Job Construction</b> + + <p>Once the arguments are parsed, the tree of subprocess + jobs needed for the desired compilation sequence are + constructed. This involves determining the input files and + their types, what work is to be done on them (preprocess, + compile, assemble, link, etc.), and constructing a list of + Action instances for each task. The result is a list of + one or more top-level actions, each of which generally + corresponds to a single output (for example, an object or + linked executable).</p> + + <p>The majority of Actions correspond to actual tasks, + however there are two special Actions. The first is + InputAction, which simply serves to adapt an input + argument for use as an input to other Actions. The second + is BindArchAction, which conceptually alters the + architecture to be used for all of its input Actions.</p> + + <p>The clang driver can dump the results of this + stage using the <tt>-ccc-print-phases</tt> flag. For + example:</p> + <pre> + $ <b>clang -ccc-print-phases -x c t.c -x assembler t.s</b> + 0: input, "t.c", c + 1: preprocessor, {0}, cpp-output + 2: compiler, {1}, assembler + 3: assembler, {2}, object + 4: input, "t.s", assembler + 5: assembler, {4}, object + 6: linker, {3, 5}, image + </pre> + <p>Here the driver is constructing seven distinct actions, + four to compile the "t.c" input into an object file, two to + assemble the "t.s" input, and one to link them together.</p> + + <p>A rather different compilation pipeline is shown here; in + this example there are two top level actions to compile + the input files into two separate object files, where each + object file is built using <tt>lipo</tt> to merge results + built for two separate architectures.</p> + <pre> + $ <b>clang -ccc-print-phases -c -arch i386 -arch x86_64 t0.c t1.c</b> + 0: input, "t0.c", c + 1: preprocessor, {0}, cpp-output + 2: compiler, {1}, assembler + 3: assembler, {2}, object + 4: bind-arch, "i386", {3}, object + 5: bind-arch, "x86_64", {3}, object + 6: lipo, {4, 5}, object + 7: input, "t1.c", c + 8: preprocessor, {7}, cpp-output + 9: compiler, {8}, assembler + 10: assembler, {9}, object + 11: bind-arch, "i386", {10}, object + 12: bind-arch, "x86_64", {10}, object + 13: lipo, {11, 12}, object + </pre> + + <p>After this stage is complete the compilation process is + divided into a simple set of actions which need to be + performed to produce intermediate or final outputs (in + some cases, like <tt>-fsyntax-only</tt>, there is no + "real" final output). Phases are well known compilation + steps, such as "preprocess", "compile", "assemble", + "link", etc.</p> + </li> + + <li> + <b>Bind: Tool & Filename Selection</b> + + <p>This stage (in conjunction with the Translate stage) + turns the tree of Actions into a list of actual subprocess + to run. Conceptually, the driver performs a top down + matching to assign Action(s) to Tools. The ToolChain is + responsible for selecting the tool to perform a particular + action; once selected the driver interacts with the tool + to see if it can match additional actions (for example, by + having an integrated preprocessor). + + <p>Once Tools have been selected for all actions, the driver + determines how the tools should be connected (for example, + using an inprocess module, pipes, temporary files, or user + provided filenames). If an output file is required, the + driver also computes the appropriate file name (the suffix + and file location depend on the input types and options + such as <tt>-save-temps</tt>). + + <p>The driver interacts with a ToolChain to perform the Tool + bindings. Each ToolChain contains information about all + the tools needed for compilation for a particular + architecture, platform, and operating system. A single + driver invocation may query multiple ToolChains during one + compilation in order to interact with tools for separate + architectures.</p> + + <p>The results of this stage are not computed directly, but + the driver can print the results via + the <tt>-ccc-print-bindings</tt> option. For example:</p> + <pre> + $ <b>clang -ccc-print-bindings -arch i386 -arch ppc t0.c</b> + # "i386-apple-darwin9" - "clang", inputs: ["t0.c"], output: "/tmp/cc-Sn4RKF.s" + # "i386-apple-darwin9" - "darwin::Assemble", inputs: ["/tmp/cc-Sn4RKF.s"], output: "/tmp/cc-gvSnbS.o" + # "i386-apple-darwin9" - "darwin::Link", inputs: ["/tmp/cc-gvSnbS.o"], output: "/tmp/cc-jgHQxi.out" + # "ppc-apple-darwin9" - "gcc::Compile", inputs: ["t0.c"], output: "/tmp/cc-Q0bTox.s" + # "ppc-apple-darwin9" - "gcc::Assemble", inputs: ["/tmp/cc-Q0bTox.s"], output: "/tmp/cc-WCdicw.o" + # "ppc-apple-darwin9" - "gcc::Link", inputs: ["/tmp/cc-WCdicw.o"], output: "/tmp/cc-HHBEBh.out" + # "i386-apple-darwin9" - "darwin::Lipo", inputs: ["/tmp/cc-jgHQxi.out", "/tmp/cc-HHBEBh.out"], output: "a.out" + </pre> + + <p>This shows the tool chain, tool, inputs and outputs which + have been bound for this compilation sequence. Here clang + is being used to compile t0.c on the i386 architecture and + darwin specific versions of the tools are being used to + assemble and link the result, but generic gcc versions of + the tools are being used on PowerPC.</p> + </li> + + <li> + <b>Translate: Tool Specific Argument Translation</b> + + <p>Once a Tool has been selected to perform a particular + Action, the Tool must construct concrete Jobs which will be + executed during compilation. The main work is in translating + from the gcc style command line options to whatever options + the subprocess expects.</p> + + <p>Some tools, such as the assembler, only interact with a + handful of arguments and just determine the path of the + executable to call and pass on their input and output + arguments. Others, like the compiler or the linker, may + translate a large number of arguments in addition.</p> + + <p>The ArgList class provides a number of simple helper + methods to assist with translating arguments; for example, + to pass on only the last of arguments corresponding to some + option, or all arguments for an option.</p> + + <p>The result of this stage is a list of Jobs (executable + paths and argument strings) to execute.</p> + </li> + + <li> + <b>Execute</b> + <p>Finally, the compilation pipeline is executed. This is + mostly straightforward, although there is some interaction + with options + like <tt>-pipe</tt>, <tt>-pass-exit-codes</tt> + and <tt>-time</tt>.</p> + </li> + + </ol> + + <!--=======================================================================--> + <h3><a name="int_notes">Additional Notes</a></h3> + <!--=======================================================================--> + + <h4 id="int_compilation">The Compilation Object</h4> + + <p>The driver constructs a Compilation object for each set of + command line arguments. The Driver itself is intended to be + invariant during construction of a Compilation; an IDE should be + able to construct a single long lived driver instance to use + for an entire build, for example.</p> + + <p>The Compilation object holds information that is particular + to each compilation sequence. For example, the list of used + temporary files (which must be removed once compilation is + finished) and result files (which should be removed if + compilation fails).</p> + + <h4 id="int_unified_parsing">Unified Parsing & Pipelining</h4> + + <p>Parsing and pipelining both occur without reference to a + Compilation instance. This is by design; the driver expects that + both of these phases are platform neutral, with a few very well + defined exceptions such as whether the platform uses a driver + driver.</p> + + <h4 id="int_toolchain_translation">ToolChain Argument Translation</h4> + + <p>In order to match gcc very closely, the clang driver + currently allows tool chains to perform their own translation of + the argument list (into a new ArgList data structure). Although + this allows the clang driver to match gcc easily, it also makes + the driver operation much harder to understand (since the Tools + stop seeing some arguments the user provided, and see new ones + instead).</p> + + <p>For example, on Darwin <tt>-gfull</tt> gets translated into two + separate arguments, <tt>-g</tt> + and <tt>-fno-eliminate-unused-debug-symbols</tt>. Trying to write Tool + logic to do something with <tt>-gfull</tt> will not work, because Tool + argument translation is done after the arguments have been + translated.</p> + + <p>A long term goal is to remove this tool chain specific + translation, and instead force each tool to change its own logic + to do the right thing on the untranslated original arguments.</p> + + <h4 id="int_unused_warnings">Unused Argument Warnings</h4> + <p>The driver operates by parsing all arguments but giving Tools + the opportunity to choose which arguments to pass on. One + downside of this infrastructure is that if the user misspells + some option, or is confused about which options to use, some + command line arguments the user really cared about may go + unused. This problem is particularly important when using + clang as a compiler, since the clang compiler does not support + anywhere near all the options that gcc does, and we want to make + sure users know which ones are being used.</p> + + <p>To support this, the driver maintains a bit associated with + each argument of whether it has been used (at all) during the + compilation. This bit usually doesn't need to be set by hand, + as the key ArgList accessors will set it automatically.</p> + + <p>When a compilation is successful (there are no errors), the + driver checks the bit and emits an "unused argument" warning for + any arguments which were never accessed. This is conservative + (the argument may not have been used to do what the user wanted) + but still catches the most obvious cases.</p> + + <!--=======================================================================--> + <h3><a name="int_gcc_concepts">Relation to GCC Driver Concepts</a></h3> + <!--=======================================================================--> + + <p>For those familiar with the gcc driver, this section provides + a brief overview of how things from the gcc driver map to the + clang driver.</p> + + <ul> + <li> + <b>Driver Driver</b> + <p>The driver driver is fully integrated into the clang + driver. The driver simply constructs additional Actions to + bind the architecture during the <i>Pipeline</i> + phase. The tool chain specific argument translation is + responsible for handling <tt>-Xarch_</tt>.</p> + + <p>The one caveat is that this approach + requires <tt>-Xarch_</tt> not be used to alter the + compilation itself (for example, one cannot + provide <tt>-S</tt> as an <tt>-Xarch_</tt> argument). The + driver attempts to reject such invocations, and overall + there isn't a good reason to abuse <tt>-Xarch_</tt> to + that end in practice.</p> + + <p>The upside is that the clang driver is more efficient and + does little extra work to support universal builds. It also + provides better error reporting and UI consistency.</p> + </li> + + <li> + <b>Specs</b> + <p>The clang driver has no direct correspondent for + "specs". The majority of the functionality that is + embedded in specs is in the Tool specific argument + translation routines. The parts of specs which control the + compilation pipeline are generally part of + the <i>Pipeline</i> stage.</p> + </li> + + <li> + <b>Toolchains</b> + <p>The gcc driver has no direct understanding of tool + chains. Each gcc binary roughly corresponds to the + information which is embedded inside a single + ToolChain.</p> + + <p>The clang driver is intended to be portable and support + complex compilation environments. All platform and tool + chain specific code should be protected behind either + abstract or well defined interfaces (such as whether the + platform supports use as a driver driver).</p> + </li> + </ul> + </div> + </body> +</html> diff --git a/clang/docs/InternalsManual.html b/clang/docs/InternalsManual.html new file mode 100644 index 0000000..bd6af8d --- /dev/null +++ b/clang/docs/InternalsManual.html @@ -0,0 +1,2011 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>"Clang" CFE Internals Manual</title> +<link type="text/css" rel="stylesheet" href="../menu.css"> +<link type="text/css" rel="stylesheet" href="../content.css"> +<style type="text/css"> +td { + vertical-align: top; +} +</style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>"Clang" CFE Internals Manual</h1> + +<ul> +<li><a href="#intro">Introduction</a></li> +<li><a href="#libsupport">LLVM Support Library</a></li> +<li><a href="#libbasic">The Clang 'Basic' Library</a> + <ul> + <li><a href="#Diagnostics">The Diagnostics Subsystem</a></li> + <li><a href="#SourceLocation">The SourceLocation and SourceManager + classes</a></li> + <li><a href="#SourceRange">SourceRange and CharSourceRange</a></li> + </ul> +</li> +<li><a href="#libdriver">The Driver Library</a> +</li> +<li><a href="#pch">Precompiled Headers</a> +<li><a href="#libfrontend">The Frontend Library</a> +</li> +<li><a href="#liblex">The Lexer and Preprocessor Library</a> + <ul> + <li><a href="#Token">The Token class</a></li> + <li><a href="#Lexer">The Lexer class</a></li> + <li><a href="#AnnotationToken">Annotation Tokens</a></li> + <li><a href="#TokenLexer">The TokenLexer class</a></li> + <li><a href="#MultipleIncludeOpt">The MultipleIncludeOpt class</a></li> + </ul> +</li> +<li><a href="#libparse">The Parser Library</a> +</li> +<li><a href="#libast">The AST Library</a> + <ul> + <li><a href="#Type">The Type class and its subclasses</a></li> + <li><a href="#QualType">The QualType class</a></li> + <li><a href="#DeclarationName">Declaration names</a></li> + <li><a href="#DeclContext">Declaration contexts</a> + <ul> + <li><a href="#Redeclarations">Redeclarations and Overloads</a></li> + <li><a href="#LexicalAndSemanticContexts">Lexical and Semantic + Contexts</a></li> + <li><a href="#TransparentContexts">Transparent Declaration Contexts</a></li> + <li><a href="#MultiDeclContext">Multiply-Defined Declaration Contexts</a></li> + </ul> + </li> + <li><a href="#CFG">The CFG class</a></li> + <li><a href="#Constants">Constant Folding in the Clang AST</a></li> + </ul> +</li> +<li><a href="#Howtos">Howto guides</a> + <ul> + <li><a href="#AddingAttributes">How to add an attribute</a></li> + <li><a href="#AddingExprStmt">How to add a new expression or statement</a></li> + </ul> +</li> +</ul> + + +<!-- ======================================================================= --> +<h2 id="intro">Introduction</h2> +<!-- ======================================================================= --> + +<p>This document describes some of the more important APIs and internal design +decisions made in the Clang C front-end. The purpose of this document is to +both capture some of this high level information and also describe some of the +design decisions behind it. This is meant for people interested in hacking on +Clang, not for end-users. The description below is categorized by +libraries, and does not describe any of the clients of the libraries.</p> + +<!-- ======================================================================= --> +<h2 id="libsupport">LLVM Support Library</h2> +<!-- ======================================================================= --> + +<p>The LLVM libsupport library provides many underlying libraries and +<a href="http://llvm.org/docs/ProgrammersManual.html">data-structures</a>, +including command line option processing, various containers and a system +abstraction layer, which is used for file system access.</p> + +<!-- ======================================================================= --> +<h2 id="libbasic">The Clang 'Basic' Library</h2> +<!-- ======================================================================= --> + +<p>This library certainly needs a better name. The 'basic' library contains a +number of low-level utilities for tracking and manipulating source buffers, +locations within the source buffers, diagnostics, tokens, target abstraction, +and information about the subset of the language being compiled for.</p> + +<p>Part of this infrastructure is specific to C (such as the TargetInfo class), +other parts could be reused for other non-C-based languages (SourceLocation, +SourceManager, Diagnostics, FileManager). When and if there is future demand +we can figure out if it makes sense to introduce a new library, move the general +classes somewhere else, or introduce some other solution.</p> + +<p>We describe the roles of these classes in order of their dependencies.</p> + + +<!-- ======================================================================= --> +<h3 id="Diagnostics">The Diagnostics Subsystem</h3> +<!-- ======================================================================= --> + +<p>The Clang Diagnostics subsystem is an important part of how the compiler +communicates with the human. Diagnostics are the warnings and errors produced +when the code is incorrect or dubious. In Clang, each diagnostic produced has +(at the minimum) a unique ID, an English translation associated with it, a <a +href="#SourceLocation">SourceLocation</a> to "put the caret", and a severity (e.g. +<tt>WARNING</tt> or <tt>ERROR</tt>). They can also optionally include a number +of arguments to the dianostic (which fill in "%0"'s in the string) as well as a +number of source ranges that related to the diagnostic.</p> + +<p>In this section, we'll be giving examples produced by the Clang command line +driver, but diagnostics can be <a href="#DiagnosticClient">rendered in many +different ways</a> depending on how the DiagnosticClient interface is +implemented. A representative example of a diagnostic is:</p> + +<pre> +t.c:38:15: error: invalid operands to binary expression ('int *' and '_Complex float') + <span style="color:darkgreen">P = (P-42) + Gamma*4;</span> + <span style="color:blue">~~~~~~ ^ ~~~~~~~</span> +</pre> + +<p>In this example, you can see the English translation, the severity (error), +you can see the source location (the caret ("^") and file/line/column info), +the source ranges "~~~~", arguments to the diagnostic ("int*" and "_Complex +float"). You'll have to believe me that there is a unique ID backing the +diagnostic :).</p> + +<p>Getting all of this to happen has several steps and involves many moving +pieces, this section describes them and talks about best practices when adding +a new diagnostic.</p> + +<!-- ============================= --> +<h4>The Diagnostic*Kinds.td files</h4> +<!-- ============================= --> + +<p>Diagnostics are created by adding an entry to one of the <tt> +clang/Basic/Diagnostic*Kinds.td</tt> files, depending on what library will +be using it. From this file, tblgen generates the unique ID of the diagnostic, +the severity of the diagnostic and the English translation + format string.</p> + +<p>There is little sanity with the naming of the unique ID's right now. Some +start with err_, warn_, ext_ to encode the severity into the name. Since the +enum is referenced in the C++ code that produces the diagnostic, it is somewhat +useful for it to be reasonably short.</p> + +<p>The severity of the diagnostic comes from the set {<tt>NOTE</tt>, +<tt>WARNING</tt>, <tt>EXTENSION</tt>, <tt>EXTWARN</tt>, <tt>ERROR</tt>}. The +<tt>ERROR</tt> severity is used for diagnostics indicating the program is never +acceptable under any circumstances. When an error is emitted, the AST for the +input code may not be fully built. The <tt>EXTENSION</tt> and <tt>EXTWARN</tt> +severities are used for extensions to the language that Clang accepts. This +means that Clang fully understands and can represent them in the AST, but we +produce diagnostics to tell the user their code is non-portable. The difference +is that the former are ignored by default, and the later warn by default. The +<tt>WARNING</tt> severity is used for constructs that are valid in the currently +selected source language but that are dubious in some way. The <tt>NOTE</tt> +level is used to staple more information onto previous diagnostics.</p> + +<p>These <em>severities</em> are mapped into a smaller set (the +Diagnostic::Level enum, {<tt>Ignored</tt>, <tt>Note</tt>, <tt>Warning</tt>, +<tt>Error</tt>, <tt>Fatal</tt> }) of output <em>levels</em> by the diagnostics +subsystem based on various configuration options. Clang internally supports a +fully fine grained mapping mechanism that allows you to map almost any +diagnostic to the output level that you want. The only diagnostics that cannot +be mapped are <tt>NOTE</tt>s, which always follow the severity of the previously +emitted diagnostic and <tt>ERROR</tt>s, which can only be mapped to +<tt>Fatal</tt> (it is not possible to turn an error into a warning, +for example).</p> + +<p>Diagnostic mappings are used in many ways. For example, if the user +specifies <tt>-pedantic</tt>, <tt>EXTENSION</tt> maps to <tt>Warning</tt>, if +they specify <tt>-pedantic-errors</tt>, it turns into <tt>Error</tt>. This is +used to implement options like <tt>-Wunused_macros</tt>, <tt>-Wundef</tt> etc. +</p> + +<p> +Mapping to <tt>Fatal</tt> should only be used for diagnostics that are +considered so severe that error recovery won't be able to recover sensibly from +them (thus spewing a ton of bogus errors). One example of this class of error +are failure to #include a file. +</p> + +<!-- ================= --> +<h4>The Format String</h4> +<!-- ================= --> + +<p>The format string for the diagnostic is very simple, but it has some power. +It takes the form of a string in English with markers that indicate where and +how arguments to the diagnostic are inserted and formatted. For example, here +are some simple format strings:</p> + +<pre> + "binary integer literals are an extension" + "format string contains '\\0' within the string body" + "more '<b>%%</b>' conversions than data arguments" + "invalid operands to binary expression (<b>%0</b> and <b>%1</b>)" + "overloaded '<b>%0</b>' must be a <b>%select{unary|binary|unary or binary}2</b> operator" + " (has <b>%1</b> parameter<b>%s1</b>)" +</pre> + +<p>These examples show some important points of format strings. You can use any + plain ASCII character in the diagnostic string except "%" without a problem, + but these are C strings, so you have to use and be aware of all the C escape + sequences (as in the second example). If you want to produce a "%" in the + output, use the "%%" escape sequence, like the third diagnostic. Finally, + Clang uses the "%...[digit]" sequences to specify where and how arguments to + the diagnostic are formatted.</p> + +<p>Arguments to the diagnostic are numbered according to how they are specified + by the C++ code that <a href="#producingdiag">produces them</a>, and are + referenced by <tt>%0</tt> .. <tt>%9</tt>. If you have more than 10 arguments + to your diagnostic, you are doing something wrong :). Unlike printf, there + is no requirement that arguments to the diagnostic end up in the output in + the same order as they are specified, you could have a format string with + <tt>"%1 %0"</tt> that swaps them, for example. The text in between the + percent and digit are formatting instructions. If there are no instructions, + the argument is just turned into a string and substituted in.</p> + +<p>Here are some "best practices" for writing the English format string:</p> + +<ul> +<li>Keep the string short. It should ideally fit in the 80 column limit of the + <tt>DiagnosticKinds.td</tt> file. This avoids the diagnostic wrapping when + printed, and forces you to think about the important point you are conveying + with the diagnostic.</li> +<li>Take advantage of location information. The user will be able to see the + line and location of the caret, so you don't need to tell them that the + problem is with the 4th argument to the function: just point to it.</li> +<li>Do not capitalize the diagnostic string, and do not end it with a + period.</li> +<li>If you need to quote something in the diagnostic string, use single + quotes.</li> +</ul> + +<p>Diagnostics should never take random English strings as arguments: you +shouldn't use <tt>"you have a problem with %0"</tt> and pass in things like +<tt>"your argument"</tt> or <tt>"your return value"</tt> as arguments. Doing +this prevents <a href="#translation">translating</a> the Clang diagnostics to +other languages (because they'll get random English words in their otherwise +localized diagnostic). The exceptions to this are C/C++ language keywords +(e.g. auto, const, mutable, etc) and C/C++ operators (<tt>/=</tt>). Note +that things like "pointer" and "reference" are not keywords. On the other +hand, you <em>can</em> include anything that comes from the user's source code, +including variable names, types, labels, etc. The 'select' format can be +used to achieve this sort of thing in a localizable way, see below.</p> + +<!-- ==================================== --> +<h4>Formatting a Diagnostic Argument</h4> +<!-- ==================================== --> + +<p>Arguments to diagnostics are fully typed internally, and come from a couple +different classes: integers, types, names, and random strings. Depending on +the class of the argument, it can be optionally formatted in different ways. +This gives the DiagnosticClient information about what the argument means +without requiring it to use a specific presentation (consider this MVC for +Clang :).</p> + +<p>Here are the different diagnostic argument formats currently supported by +Clang:</p> + +<table> +<tr><td colspan="2"><b>"s" format</b></td></tr> +<tr><td>Example:</td><td><tt>"requires %1 parameter%s1"</tt></td></tr> +<tr><td>Class:</td><td>Integers</td></tr> +<tr><td>Description:</td><td>This is a simple formatter for integers that is + useful when producing English diagnostics. When the integer is 1, it prints + as nothing. When the integer is not 1, it prints as "s". This allows some + simple grammatical forms to be to be handled correctly, and eliminates the + need to use gross things like <tt>"requires %1 parameter(s)"</tt>.</td></tr> + +<tr><td colspan="2"><b>"select" format</b></td></tr> +<tr><td>Example:</td><td><tt>"must be a %select{unary|binary|unary or binary}2 + operator"</tt></td></tr> +<tr><td>Class:</td><td>Integers</td></tr> +<tr><td>Description:</td><td><p>This format specifier is used to merge multiple + related diagnostics together into one common one, without requiring the + difference to be specified as an English string argument. Instead of + specifying the string, the diagnostic gets an integer argument and the + format string selects the numbered option. In this case, the "%2" value + must be an integer in the range [0..2]. If it is 0, it prints 'unary', if + it is 1 it prints 'binary' if it is 2, it prints 'unary or binary'. This + allows other language translations to substitute reasonable words (or entire + phrases) based on the semantics of the diagnostic instead of having to do + things textually.</p> + <p>The selected string does undergo formatting.</p></td></tr> + +<tr><td colspan="2"><b>"plural" format</b></td></tr> +<tr><td>Example:</td><td><tt>"you have %1 %plural{1:mouse|:mice}1 connected to + your computer"</tt></td></tr> +<tr><td>Class:</td><td>Integers</td></tr> +<tr><td>Description:</td><td><p>This is a formatter for complex plural forms. + It is designed to handle even the requirements of languages with very + complex plural forms, as many Baltic languages have. The argument consists + of a series of expression/form pairs, separated by ':', where the first form + whose expression evaluates to true is the result of the modifier.</p> + <p>An expression can be empty, in which case it is always true. See the + example at the top. Otherwise, it is a series of one or more numeric + conditions, separated by ','. If any condition matches, the expression + matches. Each numeric condition can take one of three forms.</p> + <ul> + <li>number: A simple decimal number matches if the argument is the same + as the number. Example: <tt>"%plural{1:mouse|:mice}4"</tt></li> + <li>range: A range in square brackets matches if the argument is within + the range. Then range is inclusive on both ends. Example: + <tt>"%plural{0:none|1:one|[2,5]:some|:many}2"</tt></li> + <li>modulo: A modulo operator is followed by a number, and + equals sign and either a number or a range. The tests are the + same as for plain + numbers and ranges, but the argument is taken modulo the number first. + Example: <tt>"%plural{%100=0:even hundred|%100=[1,50]:lower half|:everything + else}1"</tt></li> + </ul> + <p>The parser is very unforgiving. A syntax error, even whitespace, will + abort, as will a failure to match the argument against any + expression.</p></td></tr> + +<tr><td colspan="2"><b>"ordinal" format</b></td></tr> +<tr><td>Example:</td><td><tt>"ambiguity in %ordinal0 argument"</tt></td></tr> +<tr><td>Class:</td><td>Integers</td></tr> +<tr><td>Description:</td><td><p>This is a formatter which represents the + argument number as an ordinal: the value <tt>1</tt> becomes <tt>1st</tt>, + <tt>3</tt> becomes <tt>3rd</tt>, and so on. Values less than <tt>1</tt> + are not supported.</p> + <p>This formatter is currently hard-coded to use English ordinals.</p></td></tr> + +<tr><td colspan="2"><b>"objcclass" format</b></td></tr> +<tr><td>Example:</td><td><tt>"method %objcclass0 not found"</tt></td></tr> +<tr><td>Class:</td><td>DeclarationName</td></tr> +<tr><td>Description:</td><td><p>This is a simple formatter that indicates the + DeclarationName corresponds to an Objective-C class method selector. As + such, it prints the selector with a leading '+'.</p></td></tr> + +<tr><td colspan="2"><b>"objcinstance" format</b></td></tr> +<tr><td>Example:</td><td><tt>"method %objcinstance0 not found"</tt></td></tr> +<tr><td>Class:</td><td>DeclarationName</td></tr> +<tr><td>Description:</td><td><p>This is a simple formatter that indicates the + DeclarationName corresponds to an Objective-C instance method selector. As + such, it prints the selector with a leading '-'.</p></td></tr> + +<tr><td colspan="2"><b>"q" format</b></td></tr> +<tr><td>Example:</td><td><tt>"candidate found by name lookup is %q0"</tt></td></tr> +<tr><td>Class:</td><td>NamedDecl*</td></tr> +<tr><td>Description</td><td><p>This formatter indicates that the fully-qualified name of the declaration should be printed, e.g., "std::vector" rather than "vector".</p></td></tr> + +</table> + +<p>It is really easy to add format specifiers to the Clang diagnostics system, +but they should be discussed before they are added. If you are creating a lot +of repetitive diagnostics and/or have an idea for a useful formatter, please +bring it up on the cfe-dev mailing list.</p> + +<!-- ===================================================== --> +<h4 id="producingdiag">Producing the Diagnostic</h4> +<!-- ===================================================== --> + +<p>Now that you've created the diagnostic in the DiagnosticKinds.td file, you +need to write the code that detects the condition in question and emits the +new diagnostic. Various components of Clang (e.g. the preprocessor, Sema, +etc) provide a helper function named "Diag". It creates a diagnostic and +accepts the arguments, ranges, and other information that goes along with +it.</p> + +<p>For example, the binary expression error comes from code like this:</p> + +<pre> + if (various things that are bad) + Diag(Loc, diag::err_typecheck_invalid_operands) + << lex->getType() << rex->getType() + << lex->getSourceRange() << rex->getSourceRange(); +</pre> + +<p>This shows that use of the Diag method: they take a location (a <a +href="#SourceLocation">SourceLocation</a> object) and a diagnostic enum value +(which matches the name from DiagnosticKinds.td). If the diagnostic takes +arguments, they are specified with the << operator: the first argument +becomes %0, the second becomes %1, etc. The diagnostic interface allows you to +specify arguments of many different types, including <tt>int</tt> and +<tt>unsigned</tt> for integer arguments, <tt>const char*</tt> and +<tt>std::string</tt> for string arguments, <tt>DeclarationName</tt> and +<tt>const IdentifierInfo*</tt> for names, <tt>QualType</tt> for types, etc. +SourceRanges are also specified with the << operator, but do not have a +specific ordering requirement.</p> + +<p>As you can see, adding and producing a diagnostic is pretty straightforward. +The hard part is deciding exactly what you need to say to help the user, picking +a suitable wording, and providing the information needed to format it correctly. +The good news is that the call site that issues a diagnostic should be +completely independent of how the diagnostic is formatted and in what language +it is rendered. +</p> + +<!-- ==================================================== --> +<h4 id="fix-it-hints">Fix-It Hints</h4> +<!-- ==================================================== --> + +<p>In some cases, the front end emits diagnostics when it is clear +that some small change to the source code would fix the problem. For +example, a missing semicolon at the end of a statement or a use of +deprecated syntax that is easily rewritten into a more modern form. +Clang tries very hard to emit the diagnostic and recover gracefully +in these and other cases.</p> + +<p>However, for these cases where the fix is obvious, the diagnostic +can be annotated with a hint (referred to as a "fix-it hint") that +describes how to change the code referenced by the diagnostic to fix +the problem. For example, it might add the missing semicolon at the +end of the statement or rewrite the use of a deprecated construct +into something more palatable. Here is one such example from the C++ +front end, where we warn about the right-shift operator changing +meaning from C++98 to C++11:</p> + +<pre> +test.cpp:3:7: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++11 +A<100 >> 2> *a; + ^ + ( ) +</pre> + +<p>Here, the fix-it hint is suggesting that parentheses be added, +and showing exactly where those parentheses would be inserted into the +source code. The fix-it hints themselves describe what changes to make +to the source code in an abstract manner, which the text diagnostic +printer renders as a line of "insertions" below the caret line. <a +href="#DiagnosticClient">Other diagnostic clients</a> might choose +to render the code differently (e.g., as markup inline) or even give +the user the ability to automatically fix the problem.</p> + +<p>All fix-it hints are described by the <code>FixItHint</code> class, +instances of which should be attached to the diagnostic using the +<< operator in the same way that highlighted source ranges and +arguments are passed to the diagnostic. Fix-it hints can be created +with one of three constructors:</p> + +<dl> + <dt><code>FixItHint::CreateInsertion(Loc, Code)</code></dt> + <dd>Specifies that the given <code>Code</code> (a string) should be inserted + before the source location <code>Loc</code>.</dd> + + <dt><code>FixItHint::CreateRemoval(Range)</code></dt> + <dd>Specifies that the code in the given source <code>Range</code> + should be removed.</dd> + + <dt><code>FixItHint::CreateReplacement(Range, Code)</code></dt> + <dd>Specifies that the code in the given source <code>Range</code> + should be removed, and replaced with the given <code>Code</code> string.</dd> +</dl> + +<!-- ============================================================= --> +<h4><a name="DiagnosticClient">The DiagnosticClient Interface</a></h4> +<!-- ============================================================= --> + +<p>Once code generates a diagnostic with all of the arguments and the rest of +the relevant information, Clang needs to know what to do with it. As previously +mentioned, the diagnostic machinery goes through some filtering to map a +severity onto a diagnostic level, then (assuming the diagnostic is not mapped to +"<tt>Ignore</tt>") it invokes an object that implements the DiagnosticClient +interface with the information.</p> + +<p>It is possible to implement this interface in many different ways. For +example, the normal Clang DiagnosticClient (named 'TextDiagnosticPrinter') turns +the arguments into strings (according to the various formatting rules), prints +out the file/line/column information and the string, then prints out the line of +code, the source ranges, and the caret. However, this behavior isn't required. +</p> + +<p>Another implementation of the DiagnosticClient interface is the +'TextDiagnosticBuffer' class, which is used when Clang is in -verify mode. +Instead of formatting and printing out the diagnostics, this implementation just +captures and remembers the diagnostics as they fly by. Then -verify compares +the list of produced diagnostics to the list of expected ones. If they disagree, +it prints out its own output. +</p> + +<p>There are many other possible implementations of this interface, and this is +why we prefer diagnostics to pass down rich structured information in arguments. +For example, an HTML output might want declaration names be linkified to where +they come from in the source. Another example is that a GUI might let you click +on typedefs to expand them. This application would want to pass significantly +more information about types through to the GUI than a simple flat string. The +interface allows this to happen.</p> + +<!-- ====================================================== --> +<h4><a name="translation">Adding Translations to Clang</a></h4> +<!-- ====================================================== --> + +<p>Not possible yet! Diagnostic strings should be written in UTF-8, the client +can translate to the relevant code page if needed. Each translation completely +replaces the format string for the diagnostic.</p> + + +<!-- ======================================================================= --> +<h3 id="SourceLocation">The SourceLocation and SourceManager classes</h3> +<!-- ======================================================================= --> + +<p>Strangely enough, the SourceLocation class represents a location within the +source code of the program. Important design points include:</p> + +<ol> +<li>sizeof(SourceLocation) must be extremely small, as these are embedded into + many AST nodes and are passed around often. Currently it is 32 bits.</li> +<li>SourceLocation must be a simple value object that can be efficiently + copied.</li> +<li>We should be able to represent a source location for any byte of any input + file. This includes in the middle of tokens, in whitespace, in trigraphs, + etc.</li> +<li>A SourceLocation must encode the current #include stack that was active when + the location was processed. For example, if the location corresponds to a + token, it should contain the set of #includes active when the token was + lexed. This allows us to print the #include stack for a diagnostic.</li> +<li>SourceLocation must be able to describe macro expansions, capturing both + the ultimate instantiation point and the source of the original character + data.</li> +</ol> + +<p>In practice, the SourceLocation works together with the SourceManager class +to encode two pieces of information about a location: its spelling location +and its instantiation location. For most tokens, these will be the same. +However, for a macro expansion (or tokens that came from a _Pragma directive) +these will describe the location of the characters corresponding to the token +and the location where the token was used (i.e. the macro instantiation point +or the location of the _Pragma itself).</p> + +<p>The Clang front-end inherently depends on the location of a token being +tracked correctly. If it is ever incorrect, the front-end may get confused and +die. The reason for this is that the notion of the 'spelling' of a Token in +Clang depends on being able to find the original input characters for the token. +This concept maps directly to the "spelling location" for the token.</p> + + +<!-- ======================================================================= --> +<h3 id="SourceRange">SourceRange and CharSourceRange</h3> +<!-- ======================================================================= --> +<!-- mostly taken from + http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-August/010595.html --> + +<p>Clang represents most source ranges by [first, last], where first and last +each point to the beginning of their respective tokens. For example +consider the SourceRange of the following statement:</p> +<pre> +x = foo + bar; +^first ^last +</pre> + +<p>To map from this representation to a character-based +representation, the 'last' location needs to be adjusted to point to +(or past) the end of that token with either +<code>Lexer::MeasureTokenLength()</code> or +<code>Lexer::getLocForEndOfToken()</code>. For the rare cases +where character-level source ranges information is needed we use +the <code>CharSourceRange</code> class.</p> + + +<!-- ======================================================================= --> +<h2 id="libdriver">The Driver Library</h2> +<!-- ======================================================================= --> + +<p>The clang Driver and library are documented <a +href="DriverInternals.html">here</a>.<p> + +<!-- ======================================================================= --> +<h2 id="pch">Precompiled Headers</h2> +<!-- ======================================================================= --> + +<p>Clang supports two implementations of precompiled headers. The + default implementation, precompiled headers (<a + href="PCHInternals.html">PCH</a>) uses a serialized representation + of Clang's internal data structures, encoded with the <a + href="http://llvm.org/docs/BitCodeFormat.html">LLVM bitstream + format</a>. Pretokenized headers (<a + href="PTHInternals.html">PTH</a>), on the other hand, contain a + serialized representation of the tokens encountered when + preprocessing a header (and anything that header includes).</p> + + +<!-- ======================================================================= --> +<h2 id="libfrontend">The Frontend Library</h2> +<!-- ======================================================================= --> + +<p>The Frontend library contains functionality useful for building +tools on top of the clang libraries, for example several methods for +outputting diagnostics.</p> + +<!-- ======================================================================= --> +<h2 id="liblex">The Lexer and Preprocessor Library</h2> +<!-- ======================================================================= --> + +<p>The Lexer library contains several tightly-connected classes that are involved +with the nasty process of lexing and preprocessing C source code. The main +interface to this library for outside clients is the large <a +href="#Preprocessor">Preprocessor</a> class. +It contains the various pieces of state that are required to coherently read +tokens out of a translation unit.</p> + +<p>The core interface to the Preprocessor object (once it is set up) is the +Preprocessor::Lex method, which returns the next <a href="#Token">Token</a> from +the preprocessor stream. There are two types of token providers that the +preprocessor is capable of reading from: a buffer lexer (provided by the <a +href="#Lexer">Lexer</a> class) and a buffered token stream (provided by the <a +href="#TokenLexer">TokenLexer</a> class). + + +<!-- ======================================================================= --> +<h3 id="Token">The Token class</h3> +<!-- ======================================================================= --> + +<p>The Token class is used to represent a single lexed token. Tokens are +intended to be used by the lexer/preprocess and parser libraries, but are not +intended to live beyond them (for example, they should not live in the ASTs).<p> + +<p>Tokens most often live on the stack (or some other location that is efficient +to access) as the parser is running, but occasionally do get buffered up. For +example, macro definitions are stored as a series of tokens, and the C++ +front-end periodically needs to buffer tokens up for tentative parsing and +various pieces of look-ahead. As such, the size of a Token matter. On a 32-bit +system, sizeof(Token) is currently 16 bytes.</p> + +<p>Tokens occur in two forms: "<a href="#AnnotationToken">Annotation +Tokens</a>" and normal tokens. Normal tokens are those returned by the lexer, +annotation tokens represent semantic information and are produced by the parser, +replacing normal tokens in the token stream. Normal tokens contain the +following information:</p> + +<ul> +<li><b>A SourceLocation</b> - This indicates the location of the start of the +token.</li> + +<li><b>A length</b> - This stores the length of the token as stored in the +SourceBuffer. For tokens that include them, this length includes trigraphs and +escaped newlines which are ignored by later phases of the compiler. By pointing +into the original source buffer, it is always possible to get the original +spelling of a token completely accurately.</li> + +<li><b>IdentifierInfo</b> - If a token takes the form of an identifier, and if +identifier lookup was enabled when the token was lexed (e.g. the lexer was not +reading in 'raw' mode) this contains a pointer to the unique hash value for the +identifier. Because the lookup happens before keyword identification, this +field is set even for language keywords like 'for'.</li> + +<li><b>TokenKind</b> - This indicates the kind of token as classified by the +lexer. This includes things like <tt>tok::starequal</tt> (for the "*=" +operator), <tt>tok::ampamp</tt> for the "&&" token, and keyword values +(e.g. <tt>tok::kw_for</tt>) for identifiers that correspond to keywords. Note +that some tokens can be spelled multiple ways. For example, C++ supports +"operator keywords", where things like "and" are treated exactly like the +"&&" operator. In these cases, the kind value is set to +<tt>tok::ampamp</tt>, which is good for the parser, which doesn't have to +consider both forms. For something that cares about which form is used (e.g. +the preprocessor 'stringize' operator) the spelling indicates the original +form.</li> + +<li><b>Flags</b> - There are currently four flags tracked by the +lexer/preprocessor system on a per-token basis: + + <ol> + <li><b>StartOfLine</b> - This was the first token that occurred on its input + source line.</li> + <li><b>LeadingSpace</b> - There was a space character either immediately + before the token or transitively before the token as it was expanded + through a macro. The definition of this flag is very closely defined by + the stringizing requirements of the preprocessor.</li> + <li><b>DisableExpand</b> - This flag is used internally to the preprocessor to + represent identifier tokens which have macro expansion disabled. This + prevents them from being considered as candidates for macro expansion ever + in the future.</li> + <li><b>NeedsCleaning</b> - This flag is set if the original spelling for the + token includes a trigraph or escaped newline. Since this is uncommon, + many pieces of code can fast-path on tokens that did not need cleaning. + </ol> +</li> +</ul> + +<p>One interesting (and somewhat unusual) aspect of normal tokens is that they +don't contain any semantic information about the lexed value. For example, if +the token was a pp-number token, we do not represent the value of the number +that was lexed (this is left for later pieces of code to decide). Additionally, +the lexer library has no notion of typedef names vs variable names: both are +returned as identifiers, and the parser is left to decide whether a specific +identifier is a typedef or a variable (tracking this requires scope information +among other things). The parser can do this translation by replacing tokens +returned by the preprocessor with "Annotation Tokens".</p> + +<!-- ======================================================================= --> +<h3 id="AnnotationToken">Annotation Tokens</h3> +<!-- ======================================================================= --> + +<p>Annotation Tokens are tokens that are synthesized by the parser and injected +into the preprocessor's token stream (replacing existing tokens) to record +semantic information found by the parser. For example, if "foo" is found to be +a typedef, the "foo" <tt>tok::identifier</tt> token is replaced with an +<tt>tok::annot_typename</tt>. This is useful for a couple of reasons: 1) this +makes it easy to handle qualified type names (e.g. "foo::bar::baz<42>::t") +in C++ as a single "token" in the parser. 2) if the parser backtracks, the +reparse does not need to redo semantic analysis to determine whether a token +sequence is a variable, type, template, etc.</p> + +<p>Annotation Tokens are created by the parser and reinjected into the parser's +token stream (when backtracking is enabled). Because they can only exist in +tokens that the preprocessor-proper is done with, it doesn't need to keep around +flags like "start of line" that the preprocessor uses to do its job. +Additionally, an annotation token may "cover" a sequence of preprocessor tokens +(e.g. <tt>a::b::c</tt> is five preprocessor tokens). As such, the valid fields +of an annotation token are different than the fields for a normal token (but +they are multiplexed into the normal Token fields):</p> + +<ul> +<li><b>SourceLocation "Location"</b> - The SourceLocation for the annotation +token indicates the first token replaced by the annotation token. In the example +above, it would be the location of the "a" identifier.</li> + +<li><b>SourceLocation "AnnotationEndLoc"</b> - This holds the location of the +last token replaced with the annotation token. In the example above, it would +be the location of the "c" identifier.</li> + +<li><b>void* "AnnotationValue"</b> - This contains an opaque object +that the parser gets from Sema. The parser merely preserves the +information for Sema to later interpret based on the annotation token +kind.</li> + +<li><b>TokenKind "Kind"</b> - This indicates the kind of Annotation token this +is. See below for the different valid kinds.</li> +</ul> + +<p>Annotation tokens currently come in three kinds:</p> + +<ol> +<li><b>tok::annot_typename</b>: This annotation token represents a +resolved typename token that is potentially qualified. The +AnnotationValue field contains the <tt>QualType</tt> returned by +Sema::getTypeName(), possibly with source location information +attached.</li> + +<li><b>tok::annot_cxxscope</b>: This annotation token represents a C++ +scope specifier, such as "A::B::". This corresponds to the grammar +productions "::" and ":: [opt] nested-name-specifier". The +AnnotationValue pointer is a <tt>NestedNameSpecifier*</tt> returned by +the Sema::ActOnCXXGlobalScopeSpecifier and +Sema::ActOnCXXNestedNameSpecifier callbacks.</li> + +<li><b>tok::annot_template_id</b>: This annotation token represents a +C++ template-id such as "foo<int, 4>", where "foo" is the name +of a template. The AnnotationValue pointer is a pointer to a malloc'd +TemplateIdAnnotation object. Depending on the context, a parsed +template-id that names a type might become a typename annotation token +(if all we care about is the named type, e.g., because it occurs in a +type specifier) or might remain a template-id token (if we want to +retain more source location information or produce a new type, e.g., +in a declaration of a class template specialization). template-id +annotation tokens that refer to a type can be "upgraded" to typename +annotation tokens by the parser.</li> + +</ol> + +<p>As mentioned above, annotation tokens are not returned by the preprocessor, +they are formed on demand by the parser. This means that the parser has to be +aware of cases where an annotation could occur and form it where appropriate. +This is somewhat similar to how the parser handles Translation Phase 6 of C99: +String Concatenation (see C99 5.1.1.2). In the case of string concatenation, +the preprocessor just returns distinct tok::string_literal and +tok::wide_string_literal tokens and the parser eats a sequence of them wherever +the grammar indicates that a string literal can occur.</p> + +<p>In order to do this, whenever the parser expects a tok::identifier or +tok::coloncolon, it should call the TryAnnotateTypeOrScopeToken or +TryAnnotateCXXScopeToken methods to form the annotation token. These methods +will maximally form the specified annotation tokens and replace the current +token with them, if applicable. If the current tokens is not valid for an +annotation token, it will remain an identifier or :: token.</p> + + + +<!-- ======================================================================= --> +<h3 id="Lexer">The Lexer class</h3> +<!-- ======================================================================= --> + +<p>The Lexer class provides the mechanics of lexing tokens out of a source +buffer and deciding what they mean. The Lexer is complicated by the fact that +it operates on raw buffers that have not had spelling eliminated (this is a +necessity to get decent performance), but this is countered with careful coding +as well as standard performance techniques (for example, the comment handling +code is vectorized on X86 and PowerPC hosts).</p> + +<p>The lexer has a couple of interesting modal features:</p> + +<ul> +<li>The lexer can operate in 'raw' mode. This mode has several features that + make it possible to quickly lex the file (e.g. it stops identifier lookup, + doesn't specially handle preprocessor tokens, handles EOF differently, etc). + This mode is used for lexing within an "<tt>#if 0</tt>" block, for + example.</li> +<li>The lexer can capture and return comments as tokens. This is required to + support the -C preprocessor mode, which passes comments through, and is + used by the diagnostic checker to identifier expect-error annotations.</li> +<li>The lexer can be in ParsingFilename mode, which happens when preprocessing + after reading a #include directive. This mode changes the parsing of '<' + to return an "angled string" instead of a bunch of tokens for each thing + within the filename.</li> +<li>When parsing a preprocessor directive (after "<tt>#</tt>") the + ParsingPreprocessorDirective mode is entered. This changes the parser to + return EOD at a newline.</li> +<li>The Lexer uses a LangOptions object to know whether trigraphs are enabled, + whether C++ or ObjC keywords are recognized, etc.</li> +</ul> + +<p>In addition to these modes, the lexer keeps track of a couple of other + features that are local to a lexed buffer, which change as the buffer is + lexed:</p> + +<ul> +<li>The Lexer uses BufferPtr to keep track of the current character being + lexed.</li> +<li>The Lexer uses IsAtStartOfLine to keep track of whether the next lexed token + will start with its "start of line" bit set.</li> +<li>The Lexer keeps track of the current #if directives that are active (which + can be nested).</li> +<li>The Lexer keeps track of an <a href="#MultipleIncludeOpt"> + MultipleIncludeOpt</a> object, which is used to + detect whether the buffer uses the standard "<tt>#ifndef XX</tt> / + <tt>#define XX</tt>" idiom to prevent multiple inclusion. If a buffer does, + subsequent includes can be ignored if the XX macro is defined.</li> +</ul> + +<!-- ======================================================================= --> +<h3 id="TokenLexer">The TokenLexer class</h3> +<!-- ======================================================================= --> + +<p>The TokenLexer class is a token provider that returns tokens from a list +of tokens that came from somewhere else. It typically used for two things: 1) +returning tokens from a macro definition as it is being expanded 2) returning +tokens from an arbitrary buffer of tokens. The later use is used by _Pragma and +will most likely be used to handle unbounded look-ahead for the C++ parser.</p> + +<!-- ======================================================================= --> +<h3 id="MultipleIncludeOpt">The MultipleIncludeOpt class</h3> +<!-- ======================================================================= --> + +<p>The MultipleIncludeOpt class implements a really simple little state machine +that is used to detect the standard "<tt>#ifndef XX</tt> / <tt>#define XX</tt>" +idiom that people typically use to prevent multiple inclusion of headers. If a +buffer uses this idiom and is subsequently #include'd, the preprocessor can +simply check to see whether the guarding condition is defined or not. If so, +the preprocessor can completely ignore the include of the header.</p> + + + +<!-- ======================================================================= --> +<h2 id="libparse">The Parser Library</h2> +<!-- ======================================================================= --> + +<!-- ======================================================================= --> +<h2 id="libast">The AST Library</h2> +<!-- ======================================================================= --> + +<!-- ======================================================================= --> +<h3 id="Type">The Type class and its subclasses</h3> +<!-- ======================================================================= --> + +<p>The Type class (and its subclasses) are an important part of the AST. Types +are accessed through the ASTContext class, which implicitly creates and uniques +them as they are needed. Types have a couple of non-obvious features: 1) they +do not capture type qualifiers like const or volatile (See +<a href="#QualType">QualType</a>), and 2) they implicitly capture typedef +information. Once created, types are immutable (unlike decls).</p> + +<p>Typedefs in C make semantic analysis a bit more complex than it would +be without them. The issue is that we want to capture typedef information +and represent it in the AST perfectly, but the semantics of operations need to +"see through" typedefs. For example, consider this code:</p> + +<code> +void func() {<br> + typedef int foo;<br> + foo X, *Y;<br> + typedef foo* bar;<br> + bar Z;<br> + *X; <i>// error</i><br> + **Y; <i>// error</i><br> + **Z; <i>// error</i><br> +}<br> +</code> + +<p>The code above is illegal, and thus we expect there to be diagnostics emitted +on the annotated lines. In this example, we expect to get:</p> + +<pre> +<b>test.c:6:1: error: indirection requires pointer operand ('foo' invalid)</b> +*X; // error +<span style="color:blue">^~</span> +<b>test.c:7:1: error: indirection requires pointer operand ('foo' invalid)</b> +**Y; // error +<span style="color:blue">^~~</span> +<b>test.c:8:1: error: indirection requires pointer operand ('foo' invalid)</b> +**Z; // error +<span style="color:blue">^~~</span> +</pre> + +<p>While this example is somewhat silly, it illustrates the point: we want to +retain typedef information where possible, so that we can emit errors about +"<tt>std::string</tt>" instead of "<tt>std::basic_string<char, std:...</tt>". +Doing this requires properly keeping typedef information (for example, the type +of "X" is "foo", not "int"), and requires properly propagating it through the +various operators (for example, the type of *Y is "foo", not "int"). In order +to retain this information, the type of these expressions is an instance of the +TypedefType class, which indicates that the type of these expressions is a +typedef for foo. +</p> + +<p>Representing types like this is great for diagnostics, because the +user-specified type is always immediately available. There are two problems +with this: first, various semantic checks need to make judgements about the +<em>actual structure</em> of a type, ignoring typedefs. Second, we need an +efficient way to query whether two types are structurally identical to each +other, ignoring typedefs. The solution to both of these problems is the idea of +canonical types.</p> + +<!-- =============== --> +<h4>Canonical Types</h4> +<!-- =============== --> + +<p>Every instance of the Type class contains a canonical type pointer. For +simple types with no typedefs involved (e.g. "<tt>int</tt>", "<tt>int*</tt>", +"<tt>int**</tt>"), the type just points to itself. For types that have a +typedef somewhere in their structure (e.g. "<tt>foo</tt>", "<tt>foo*</tt>", +"<tt>foo**</tt>", "<tt>bar</tt>"), the canonical type pointer points to their +structurally equivalent type without any typedefs (e.g. "<tt>int</tt>", +"<tt>int*</tt>", "<tt>int**</tt>", and "<tt>int*</tt>" respectively).</p> + +<p>This design provides a constant time operation (dereferencing the canonical +type pointer) that gives us access to the structure of types. For example, +we can trivially tell that "bar" and "foo*" are the same type by dereferencing +their canonical type pointers and doing a pointer comparison (they both point +to the single "<tt>int*</tt>" type).</p> + +<p>Canonical types and typedef types bring up some complexities that must be +carefully managed. Specifically, the "isa/cast/dyncast" operators generally +shouldn't be used in code that is inspecting the AST. For example, when type +checking the indirection operator (unary '*' on a pointer), the type checker +must verify that the operand has a pointer type. It would not be correct to +check that with "<tt>isa<PointerType>(SubExpr->getType())</tt>", +because this predicate would fail if the subexpression had a typedef type.</p> + +<p>The solution to this problem are a set of helper methods on Type, used to +check their properties. In this case, it would be correct to use +"<tt>SubExpr->getType()->isPointerType()</tt>" to do the check. This +predicate will return true if the <em>canonical type is a pointer</em>, which is +true any time the type is structurally a pointer type. The only hard part here +is remembering not to use the <tt>isa/cast/dyncast</tt> operations.</p> + +<p>The second problem we face is how to get access to the pointer type once we +know it exists. To continue the example, the result type of the indirection +operator is the pointee type of the subexpression. In order to determine the +type, we need to get the instance of PointerType that best captures the typedef +information in the program. If the type of the expression is literally a +PointerType, we can return that, otherwise we have to dig through the +typedefs to find the pointer type. For example, if the subexpression had type +"<tt>foo*</tt>", we could return that type as the result. If the subexpression +had type "<tt>bar</tt>", we want to return "<tt>foo*</tt>" (note that we do +<em>not</em> want "<tt>int*</tt>"). In order to provide all of this, Type has +a getAsPointerType() method that checks whether the type is structurally a +PointerType and, if so, returns the best one. If not, it returns a null +pointer.</p> + +<p>This structure is somewhat mystical, but after meditating on it, it will +make sense to you :).</p> + +<!-- ======================================================================= --> +<h3 id="QualType">The QualType class</h3> +<!-- ======================================================================= --> + +<p>The QualType class is designed as a trivial value class that is +small, passed by-value and is efficient to query. The idea of +QualType is that it stores the type qualifiers (const, volatile, +restrict, plus some extended qualifiers required by language +extensions) separately from the types themselves. QualType is +conceptually a pair of "Type*" and the bits for these type qualifiers.</p> + +<p>By storing the type qualifiers as bits in the conceptual pair, it is +extremely efficient to get the set of qualifiers on a QualType (just return the +field of the pair), add a type qualifier (which is a trivial constant-time +operation that sets a bit), and remove one or more type qualifiers (just return +a QualType with the bitfield set to empty).</p> + +<p>Further, because the bits are stored outside of the type itself, we do not +need to create duplicates of types with different sets of qualifiers (i.e. there +is only a single heap allocated "int" type: "const int" and "volatile const int" +both point to the same heap allocated "int" type). This reduces the heap size +used to represent bits and also means we do not have to consider qualifiers when +uniquing types (<a href="#Type">Type</a> does not even contain qualifiers).</p> + +<p>In practice, the two most common type qualifiers (const and +restrict) are stored in the low bits of the pointer to the Type +object, together with a flag indicating whether extended qualifiers +are present (which must be heap-allocated). This means that QualType +is exactly the same size as a pointer.</p> + +<!-- ======================================================================= --> +<h3 id="DeclarationName">Declaration names</h3> +<!-- ======================================================================= --> + +<p>The <tt>DeclarationName</tt> class represents the name of a + declaration in Clang. Declarations in the C family of languages can + take several different forms. Most declarations are named by + simple identifiers, e.g., "<code>f</code>" and "<code>x</code>" in + the function declaration <code>f(int x)</code>. In C++, declaration + names can also name class constructors ("<code>Class</code>" + in <code>struct Class { Class(); }</code>), class destructors + ("<code>~Class</code>"), overloaded operator names ("operator+"), + and conversion functions ("<code>operator void const *</code>"). In + Objective-C, declaration names can refer to the names of Objective-C + methods, which involve the method name and the parameters, + collectively called a <i>selector</i>, e.g., + "<code>setWidth:height:</code>". Since all of these kinds of + entities - variables, functions, Objective-C methods, C++ + constructors, destructors, and operators - are represented as + subclasses of Clang's common <code>NamedDecl</code> + class, <code>DeclarationName</code> is designed to efficiently + represent any kind of name.</p> + +<p>Given + a <code>DeclarationName</code> <code>N</code>, <code>N.getNameKind()</code> + will produce a value that describes what kind of name <code>N</code> + stores. There are 8 options (all of the names are inside + the <code>DeclarationName</code> class)</p> +<dl> + <dt>Identifier</dt> + <dd>The name is a simple + identifier. Use <code>N.getAsIdentifierInfo()</code> to retrieve the + corresponding <code>IdentifierInfo*</code> pointing to the actual + identifier. Note that C++ overloaded operators (e.g., + "<code>operator+</code>") are represented as special kinds of + identifiers. Use <code>IdentifierInfo</code>'s <code>getOverloadedOperatorID</code> + function to determine whether an identifier is an overloaded + operator name.</dd> + + <dt>ObjCZeroArgSelector, ObjCOneArgSelector, + ObjCMultiArgSelector</dt> + <dd>The name is an Objective-C selector, which can be retrieved as a + <code>Selector</code> instance + via <code>N.getObjCSelector()</code>. The three possible name + kinds for Objective-C reflect an optimization within + the <code>DeclarationName</code> class: both zero- and + one-argument selectors are stored as a + masked <code>IdentifierInfo</code> pointer, and therefore require + very little space, since zero- and one-argument selectors are far + more common than multi-argument selectors (which use a different + structure).</dd> + + <dt>CXXConstructorName</dt> + <dd>The name is a C++ constructor + name. Use <code>N.getCXXNameType()</code> to retrieve + the <a href="#QualType">type</a> that this constructor is meant to + construct. The type is always the canonical type, since all + constructors for a given type have the same name.</dd> + + <dt>CXXDestructorName</dt> + <dd>The name is a C++ destructor + name. Use <code>N.getCXXNameType()</code> to retrieve + the <a href="#QualType">type</a> whose destructor is being + named. This type is always a canonical type.</dd> + + <dt>CXXConversionFunctionName</dt> + <dd>The name is a C++ conversion function. Conversion functions are + named according to the type they convert to, e.g., "<code>operator void + const *</code>". Use <code>N.getCXXNameType()</code> to retrieve + the type that this conversion function converts to. This type is + always a canonical type.</dd> + + <dt>CXXOperatorName</dt> + <dd>The name is a C++ overloaded operator name. Overloaded operators + are named according to their spelling, e.g., + "<code>operator+</code>" or "<code>operator new + []</code>". Use <code>N.getCXXOverloadedOperator()</code> to + retrieve the overloaded operator (a value of + type <code>OverloadedOperatorKind</code>).</dd> +</dl> + +<p><code>DeclarationName</code>s are cheap to create, copy, and + compare. They require only a single pointer's worth of storage in + the common cases (identifiers, zero- + and one-argument Objective-C selectors) and use dense, uniqued + storage for the other kinds of + names. Two <code>DeclarationName</code>s can be compared for + equality (<code>==</code>, <code>!=</code>) using a simple bitwise + comparison, can be ordered + with <code><</code>, <code>></code>, <code><=</code>, + and <code>>=</code> (which provide a lexicographical ordering for + normal identifiers but an unspecified ordering for other kinds of + names), and can be placed into LLVM <code>DenseMap</code>s + and <code>DenseSet</code>s.</p> + +<p><code>DeclarationName</code> instances can be created in different + ways depending on what kind of name the instance will store. Normal + identifiers (<code>IdentifierInfo</code> pointers) and Objective-C selectors + (<code>Selector</code>) can be implicitly converted + to <code>DeclarationName</code>s. Names for C++ constructors, + destructors, conversion functions, and overloaded operators can be retrieved from + the <code>DeclarationNameTable</code>, an instance of which is + available as <code>ASTContext::DeclarationNames</code>. The member + functions <code>getCXXConstructorName</code>, <code>getCXXDestructorName</code>, + <code>getCXXConversionFunctionName</code>, and <code>getCXXOperatorName</code>, respectively, + return <code>DeclarationName</code> instances for the four kinds of + C++ special function names.</p> + +<!-- ======================================================================= --> +<h3 id="DeclContext">Declaration contexts</h3> +<!-- ======================================================================= --> +<p>Every declaration in a program exists within some <i>declaration + context</i>, such as a translation unit, namespace, class, or + function. Declaration contexts in Clang are represented by + the <code>DeclContext</code> class, from which the various + declaration-context AST nodes + (<code>TranslationUnitDecl</code>, <code>NamespaceDecl</code>, <code>RecordDecl</code>, <code>FunctionDecl</code>, + etc.) will derive. The <code>DeclContext</code> class provides + several facilities common to each declaration context:</p> +<dl> + <dt>Source-centric vs. Semantics-centric View of Declarations</dt> + <dd><code>DeclContext</code> provides two views of the declarations + stored within a declaration context. The source-centric view + accurately represents the program source code as written, including + multiple declarations of entities where present (see the + section <a href="#Redeclarations">Redeclarations and + Overloads</a>), while the semantics-centric view represents the + program semantics. The two views are kept synchronized by semantic + analysis while the ASTs are being constructed.</dd> + + <dt>Storage of declarations within that context</dt> + <dd>Every declaration context can contain some number of + declarations. For example, a C++ class (represented + by <code>RecordDecl</code>) contains various member functions, + fields, nested types, and so on. All of these declarations will be + stored within the <code>DeclContext</code>, and one can iterate + over the declarations via + [<code>DeclContext::decls_begin()</code>, + <code>DeclContext::decls_end()</code>). This mechanism provides + the source-centric view of declarations in the context.</dd> + + <dt>Lookup of declarations within that context</dt> + <dd>The <code>DeclContext</code> structure provides efficient name + lookup for names within that declaration context. For example, + if <code>N</code> is a namespace we can look for the + name <code>N::f</code> + using <code>DeclContext::lookup</code>. The lookup itself is + based on a lazily-constructed array (for declaration contexts + with a small number of declarations) or hash table (for + declaration contexts with more declarations). The lookup + operation provides the semantics-centric view of the declarations + in the context.</dd> + + <dt>Ownership of declarations</dt> + <dd>The <code>DeclContext</code> owns all of the declarations that + were declared within its declaration context, and is responsible + for the management of their memory as well as their + (de-)serialization.</dd> +</dl> + +<p>All declarations are stored within a declaration context, and one + can query + information about the context in which each declaration lives. One + can retrieve the <code>DeclContext</code> that contains a + particular <code>Decl</code> + using <code>Decl::getDeclContext</code>. However, see the + section <a href="#LexicalAndSemanticContexts">Lexical and Semantic + Contexts</a> for more information about how to interpret this + context information.</p> + +<h4 id="Redeclarations">Redeclarations and Overloads</h4> +<p>Within a translation unit, it is common for an entity to be +declared several times. For example, we might declare a function "f" + and then later re-declare it as part of an inlined definition:</p> + +<pre> +void f(int x, int y, int z = 1); + +inline void f(int x, int y, int z) { /* ... */ } +</pre> + +<p>The representation of "f" differs in the source-centric and + semantics-centric views of a declaration context. In the + source-centric view, all redeclarations will be present, in the + order they occurred in the source code, making + this view suitable for clients that wish to see the structure of + the source code. In the semantics-centric view, only the most recent "f" + will be found by the lookup, since it effectively replaces the first + declaration of "f".</p> + +<p>In the semantics-centric view, overloading of functions is + represented explicitly. For example, given two declarations of a + function "g" that are overloaded, e.g.,</p> +<pre> +void g(); +void g(int); +</pre> +<p>the <code>DeclContext::lookup</code> operation will return + a <code>DeclContext::lookup_result</code> that contains a range of iterators + over declarations of "g". Clients that perform semantic analysis on a + program that is not concerned with the actual source code will + primarily use this semantics-centric view.</p> + +<h4 id="LexicalAndSemanticContexts">Lexical and Semantic Contexts</h4> +<p>Each declaration has two potentially different + declaration contexts: a <i>lexical</i> context, which corresponds to + the source-centric view of the declaration context, and + a <i>semantic</i> context, which corresponds to the + semantics-centric view. The lexical context is accessible + via <code>Decl::getLexicalDeclContext</code> while the + semantic context is accessible + via <code>Decl::getDeclContext</code>, both of which return + <code>DeclContext</code> pointers. For most declarations, the two + contexts are identical. For example:</p> + +<pre> +class X { +public: + void f(int x); +}; +</pre> + +<p>Here, the semantic and lexical contexts of <code>X::f</code> are + the <code>DeclContext</code> associated with the + class <code>X</code> (itself stored as a <code>RecordDecl</code> AST + node). However, we can now define <code>X::f</code> out-of-line:</p> + +<pre> +void X::f(int x = 17) { /* ... */ } +</pre> + +<p>This definition of has different lexical and semantic + contexts. The lexical context corresponds to the declaration + context in which the actual declaration occurred in the source + code, e.g., the translation unit containing <code>X</code>. Thus, + this declaration of <code>X::f</code> can be found by traversing + the declarations provided by + [<code>decls_begin()</code>, <code>decls_end()</code>) in the + translation unit.</p> + +<p>The semantic context of <code>X::f</code> corresponds to the + class <code>X</code>, since this member function is (semantically) a + member of <code>X</code>. Lookup of the name <code>f</code> into + the <code>DeclContext</code> associated with <code>X</code> will + then return the definition of <code>X::f</code> (including + information about the default argument).</p> + +<h4 id="TransparentContexts">Transparent Declaration Contexts</h4> +<p>In C and C++, there are several contexts in which names that are + logically declared inside another declaration will actually "leak" + out into the enclosing scope from the perspective of name + lookup. The most obvious instance of this behavior is in + enumeration types, e.g.,</p> +<pre> +enum Color { + Red, + Green, + Blue +}; +</pre> + +<p>Here, <code>Color</code> is an enumeration, which is a declaration + context that contains the + enumerators <code>Red</code>, <code>Green</code>, + and <code>Blue</code>. Thus, traversing the list of declarations + contained in the enumeration <code>Color</code> will + yield <code>Red</code>, <code>Green</code>, + and <code>Blue</code>. However, outside of the scope + of <code>Color</code> one can name the enumerator <code>Red</code> + without qualifying the name, e.g.,</p> + +<pre> +Color c = Red; +</pre> + +<p>There are other entities in C++ that provide similar behavior. For + example, linkage specifications that use curly braces:</p> + +<pre> +extern "C" { + void f(int); + void g(int); +} +// f and g are visible here +</pre> + +<p>For source-level accuracy, we treat the linkage specification and + enumeration type as a + declaration context in which its enclosed declarations ("Red", + "Green", and "Blue"; "f" and "g") + are declared. However, these declarations are visible outside of the + scope of the declaration context.</p> + +<p>These language features (and several others, described below) have + roughly the same set of + requirements: declarations are declared within a particular lexical + context, but the declarations are also found via name lookup in + scopes enclosing the declaration itself. This feature is implemented + via <i>transparent</i> declaration contexts + (see <code>DeclContext::isTransparentContext()</code>), whose + declarations are visible in the nearest enclosing non-transparent + declaration context. This means that the lexical context of the + declaration (e.g., an enumerator) will be the + transparent <code>DeclContext</code> itself, as will the semantic + context, but the declaration will be visible in every outer context + up to and including the first non-transparent declaration context (since + transparent declaration contexts can be nested).</p> + +<p>The transparent <code>DeclContexts</code> are:</p> +<ul> + <li>Enumerations (but not C++11 "scoped enumerations"): + <pre> +enum Color { + Red, + Green, + Blue +}; +// Red, Green, and Blue are in scope + </pre></li> + <li>C++ linkage specifications: + <pre> +extern "C" { + void f(int); + void g(int); +} +// f and g are in scope + </pre></li> + <li>Anonymous unions and structs: + <pre> +struct LookupTable { + bool IsVector; + union { + std::vector<Item> *Vector; + std::set<Item> *Set; + }; +}; + +LookupTable LT; +LT.Vector = 0; // Okay: finds Vector inside the unnamed union + </pre> + </li> + <li>C++11 inline namespaces: +<pre> +namespace mylib { + inline namespace debug { + class X; + } +} +mylib::X *xp; // okay: mylib::X refers to mylib::debug::X +</pre> +</li> +</ul> + + +<h4 id="MultiDeclContext">Multiply-Defined Declaration Contexts</h4> +<p>C++ namespaces have the interesting--and, so far, unique--property that +the namespace can be defined multiple times, and the declarations +provided by each namespace definition are effectively merged (from +the semantic point of view). For example, the following two code +snippets are semantically indistinguishable:</p> +<pre> +// Snippet #1: +namespace N { + void f(); +} +namespace N { + void f(int); +} + +// Snippet #2: +namespace N { + void f(); + void f(int); +} +</pre> + +<p>In Clang's representation, the source-centric view of declaration + contexts will actually have two separate <code>NamespaceDecl</code> + nodes in Snippet #1, each of which is a declaration context that + contains a single declaration of "f". However, the semantics-centric + view provided by name lookup into the namespace <code>N</code> for + "f" will return a <code>DeclContext::lookup_result</code> that contains + a range of iterators over declarations of "f".</p> + +<p><code>DeclContext</code> manages multiply-defined declaration + contexts internally. The + function <code>DeclContext::getPrimaryContext</code> retrieves the + "primary" context for a given <code>DeclContext</code> instance, + which is the <code>DeclContext</code> responsible for maintaining + the lookup table used for the semantics-centric view. Given the + primary context, one can follow the chain + of <code>DeclContext</code> nodes that define additional + declarations via <code>DeclContext::getNextContext</code>. Note that + these functions are used internally within the lookup and insertion + methods of the <code>DeclContext</code>, so the vast majority of + clients can ignore them.</p> + +<!-- ======================================================================= --> +<h3 id="CFG">The <tt>CFG</tt> class</h3> +<!-- ======================================================================= --> + +<p>The <tt>CFG</tt> class is designed to represent a source-level +control-flow graph for a single statement (<tt>Stmt*</tt>). Typically +instances of <tt>CFG</tt> are constructed for function bodies (usually +an instance of <tt>CompoundStmt</tt>), but can also be instantiated to +represent the control-flow of any class that subclasses <tt>Stmt</tt>, +which includes simple expressions. Control-flow graphs are especially +useful for performing +<a href="http://en.wikipedia.org/wiki/Data_flow_analysis#Sensitivities">flow- +or path-sensitive</a> program analyses on a given function.</p> + +<!-- ============ --> +<h4>Basic Blocks</h4> +<!-- ============ --> + +<p>Concretely, an instance of <tt>CFG</tt> is a collection of basic +blocks. Each basic block is an instance of <tt>CFGBlock</tt>, which +simply contains an ordered sequence of <tt>Stmt*</tt> (each referring +to statements in the AST). The ordering of statements within a block +indicates unconditional flow of control from one statement to the +next. <a href="#ConditionalControlFlow">Conditional control-flow</a> +is represented using edges between basic blocks. The statements +within a given <tt>CFGBlock</tt> can be traversed using +the <tt>CFGBlock::*iterator</tt> interface.</p> + +<p> +A <tt>CFG</tt> object owns the instances of <tt>CFGBlock</tt> within +the control-flow graph it represents. Each <tt>CFGBlock</tt> within a +CFG is also uniquely numbered (accessible +via <tt>CFGBlock::getBlockID()</tt>). Currently the number is +based on the ordering the blocks were created, but no assumptions +should be made on how <tt>CFGBlock</tt>s are numbered other than their +numbers are unique and that they are numbered from 0..N-1 (where N is +the number of basic blocks in the CFG).</p> + +<!-- ===================== --> +<h4>Entry and Exit Blocks</h4> +<!-- ===================== --> + +Each instance of <tt>CFG</tt> contains two special blocks: +an <i>entry</i> block (accessible via <tt>CFG::getEntry()</tt>), which +has no incoming edges, and an <i>exit</i> block (accessible +via <tt>CFG::getExit()</tt>), which has no outgoing edges. Neither +block contains any statements, and they serve the role of providing a +clear entrance and exit for a body of code such as a function body. +The presence of these empty blocks greatly simplifies the +implementation of many analyses built on top of CFGs. + +<!-- ===================================================== --> +<h4 id ="ConditionalControlFlow">Conditional Control-Flow</h4> +<!-- ===================================================== --> + +<p>Conditional control-flow (such as those induced by if-statements +and loops) is represented as edges between <tt>CFGBlock</tt>s. +Because different C language constructs can induce control-flow, +each <tt>CFGBlock</tt> also records an extra <tt>Stmt*</tt> that +represents the <i>terminator</i> of the block. A terminator is simply +the statement that caused the control-flow, and is used to identify +the nature of the conditional control-flow between blocks. For +example, in the case of an if-statement, the terminator refers to +the <tt>IfStmt</tt> object in the AST that represented the given +branch.</p> + +<p>To illustrate, consider the following code example:</p> + +<code> +int foo(int x) {<br> + x = x + 1;<br> +<br> + if (x > 2) x++;<br> + else {<br> + x += 2;<br> + x *= 2;<br> + }<br> +<br> + return x;<br> +} +</code> + +<p>After invoking the parser+semantic analyzer on this code fragment, +the AST of the body of <tt>foo</tt> is referenced by a +single <tt>Stmt*</tt>. We can then construct an instance +of <tt>CFG</tt> representing the control-flow graph of this function +body by single call to a static class method:</p> + +<code> + Stmt* FooBody = ...<br> + CFG* FooCFG = <b>CFG::buildCFG</b>(FooBody); +</code> + +<p>It is the responsibility of the caller of <tt>CFG::buildCFG</tt> +to <tt>delete</tt> the returned <tt>CFG*</tt> when the CFG is no +longer needed.</p> + +<p>Along with providing an interface to iterate over +its <tt>CFGBlock</tt>s, the <tt>CFG</tt> class also provides methods +that are useful for debugging and visualizing CFGs. For example, the +method +<tt>CFG::dump()</tt> dumps a pretty-printed version of the CFG to +standard error. This is especially useful when one is using a +debugger such as gdb. For example, here is the output +of <tt>FooCFG->dump()</tt>:</p> + +<code> + [ B5 (ENTRY) ]<br> + Predecessors (0):<br> + Successors (1): B4<br> +<br> + [ B4 ]<br> + 1: x = x + 1<br> + 2: (x > 2)<br> + <b>T: if [B4.2]</b><br> + Predecessors (1): B5<br> + Successors (2): B3 B2<br> +<br> + [ B3 ]<br> + 1: x++<br> + Predecessors (1): B4<br> + Successors (1): B1<br> +<br> + [ B2 ]<br> + 1: x += 2<br> + 2: x *= 2<br> + Predecessors (1): B4<br> + Successors (1): B1<br> +<br> + [ B1 ]<br> + 1: return x;<br> + Predecessors (2): B2 B3<br> + Successors (1): B0<br> +<br> + [ B0 (EXIT) ]<br> + Predecessors (1): B1<br> + Successors (0): +</code> + +<p>For each block, the pretty-printed output displays for each block +the number of <i>predecessor</i> blocks (blocks that have outgoing +control-flow to the given block) and <i>successor</i> blocks (blocks +that have control-flow that have incoming control-flow from the given +block). We can also clearly see the special entry and exit blocks at +the beginning and end of the pretty-printed output. For the entry +block (block B5), the number of predecessor blocks is 0, while for the +exit block (block B0) the number of successor blocks is 0.</p> + +<p>The most interesting block here is B4, whose outgoing control-flow +represents the branching caused by the sole if-statement +in <tt>foo</tt>. Of particular interest is the second statement in +the block, <b><tt>(x > 2)</tt></b>, and the terminator, printed +as <b><tt>if [B4.2]</tt></b>. The second statement represents the +evaluation of the condition of the if-statement, which occurs before +the actual branching of control-flow. Within the <tt>CFGBlock</tt> +for B4, the <tt>Stmt*</tt> for the second statement refers to the +actual expression in the AST for <b><tt>(x > 2)</tt></b>. Thus +pointers to subclasses of <tt>Expr</tt> can appear in the list of +statements in a block, and not just subclasses of <tt>Stmt</tt> that +refer to proper C statements.</p> + +<p>The terminator of block B4 is a pointer to the <tt>IfStmt</tt> +object in the AST. The pretty-printer outputs <b><tt>if +[B4.2]</tt></b> because the condition expression of the if-statement +has an actual place in the basic block, and thus the terminator is +essentially +<i>referring</i> to the expression that is the second statement of +block B4 (i.e., B4.2). In this manner, conditions for control-flow +(which also includes conditions for loops and switch statements) are +hoisted into the actual basic block.</p> + +<!-- ===================== --> +<!-- <h4>Implicit Control-Flow</h4> --> +<!-- ===================== --> + +<!-- +<p>A key design principle of the <tt>CFG</tt> class was to not require +any transformations to the AST in order to represent control-flow. +Thus the <tt>CFG</tt> does not perform any "lowering" of the +statements in an AST: loops are not transformed into guarded gotos, +short-circuit operations are not converted to a set of if-statements, +and so on.</p> +--> + + +<!-- ======================================================================= --> +<h3 id="Constants">Constant Folding in the Clang AST</h3> +<!-- ======================================================================= --> + +<p>There are several places where constants and constant folding matter a lot to +the Clang front-end. First, in general, we prefer the AST to retain the source +code as close to how the user wrote it as possible. This means that if they +wrote "5+4", we want to keep the addition and two constants in the AST, we don't +want to fold to "9". This means that constant folding in various ways turns +into a tree walk that needs to handle the various cases.</p> + +<p>However, there are places in both C and C++ that require constants to be +folded. For example, the C standard defines what an "integer constant +expression" (i-c-e) is with very precise and specific requirements. The +language then requires i-c-e's in a lot of places (for example, the size of a +bitfield, the value for a case statement, etc). For these, we have to be able +to constant fold the constants, to do semantic checks (e.g. verify bitfield size +is non-negative and that case statements aren't duplicated). We aim for Clang +to be very pedantic about this, diagnosing cases when the code does not use an +i-c-e where one is required, but accepting the code unless running with +<tt>-pedantic-errors</tt>.</p> + +<p>Things get a little bit more tricky when it comes to compatibility with +real-world source code. Specifically, GCC has historically accepted a huge +superset of expressions as i-c-e's, and a lot of real world code depends on this +unfortuate accident of history (including, e.g., the glibc system headers). GCC +accepts anything its "fold" optimizer is capable of reducing to an integer +constant, which means that the definition of what it accepts changes as its +optimizer does. One example is that GCC accepts things like "case X-X:" even +when X is a variable, because it can fold this to 0.</p> + +<p>Another issue are how constants interact with the extensions we support, such +as __builtin_constant_p, __builtin_inf, __extension__ and many others. C99 +obviously does not specify the semantics of any of these extensions, and the +definition of i-c-e does not include them. However, these extensions are often +used in real code, and we have to have a way to reason about them.</p> + +<p>Finally, this is not just a problem for semantic analysis. The code +generator and other clients have to be able to fold constants (e.g. to +initialize global variables) and has to handle a superset of what C99 allows. +Further, these clients can benefit from extended information. For example, we +know that "foo()||1" always evaluates to true, but we can't replace the +expression with true because it has side effects.</p> + +<!-- ======================= --> +<h4>Implementation Approach</h4> +<!-- ======================= --> + +<p>After trying several different approaches, we've finally converged on a +design (Note, at the time of this writing, not all of this has been implemented, +consider this a design goal!). Our basic approach is to define a single +recursive method evaluation method (<tt>Expr::Evaluate</tt>), which is +implemented in <tt>AST/ExprConstant.cpp</tt>. Given an expression with 'scalar' +type (integer, fp, complex, or pointer) this method returns the following +information:</p> + +<ul> +<li>Whether the expression is an integer constant expression, a general + constant that was folded but has no side effects, a general constant that + was folded but that does have side effects, or an uncomputable/unfoldable + value. +</li> +<li>If the expression was computable in any way, this method returns the APValue + for the result of the expression.</li> +<li>If the expression is not evaluatable at all, this method returns + information on one of the problems with the expression. This includes a + SourceLocation for where the problem is, and a diagnostic ID that explains + the problem. The diagnostic should be have ERROR type.</li> +<li>If the expression is not an integer constant expression, this method returns + information on one of the problems with the expression. This includes a + SourceLocation for where the problem is, and a diagnostic ID that explains + the problem. The diagnostic should be have EXTENSION type.</li> +</ul> + +<p>This information gives various clients the flexibility that they want, and we +will eventually have some helper methods for various extensions. For example, +Sema should have a <tt>Sema::VerifyIntegerConstantExpression</tt> method, which +calls Evaluate on the expression. If the expression is not foldable, the error +is emitted, and it would return true. If the expression is not an i-c-e, the +EXTENSION diagnostic is emitted. Finally it would return false to indicate that +the AST is ok.</p> + +<p>Other clients can use the information in other ways, for example, codegen can +just use expressions that are foldable in any way.</p> + +<!-- ========== --> +<h4>Extensions</h4> +<!-- ========== --> + +<p>This section describes how some of the various extensions Clang supports +interacts with constant evaluation:</p> + +<ul> +<li><b><tt>__extension__</tt></b>: The expression form of this extension causes + any evaluatable subexpression to be accepted as an integer constant + expression.</li> +<li><b><tt>__builtin_constant_p</tt></b>: This returns true (as a integer + constant expression) if the operand evaluates to either a numeric value + (that is, not a pointer cast to integral type) of integral, enumeration, + floating or complex type, or if it evaluates to the address of the first + character of a string literal (possibly cast to some other type). As a + special case, if <tt>__builtin_constant_p</tt> is the (potentially + parenthesized) condition of a conditional operator expression ("?:"), only + the true side of the conditional operator is considered, and it is evaluated + with full constant folding.</li> +<li><b><tt>__builtin_choose_expr</tt></b>: The condition is required to be an + integer constant expression, but we accept any constant as an "extension of + an extension". This only evaluates one operand depending on which way the + condition evaluates.</li> +<li><b><tt>__builtin_classify_type</tt></b>: This always returns an integer + constant expression.</li> +<li><b><tt>__builtin_inf,nan,..</tt></b>: These are treated just like a + floating-point literal.</li> +<li><b><tt>__builtin_abs,copysign,..</tt></b>: These are constant folded as + general constant expressions.</li> +<li><b><tt>__builtin_strlen</tt></b> and <b><tt>strlen</tt></b>: These are + constant folded as integer constant expressions if the argument is a string + literal.</li> +</ul> + + +<!-- ======================================================================= --> +<h2 id="Howtos">How to change Clang</h2> +<!-- ======================================================================= --> + +<!-- ======================================================================= --> +<h3 id="AddingAttributes">How to add an attribute</h3> +<!-- ======================================================================= --> + +<p>To add an attribute, you'll have to add it to the list of attributes, add it +to the parsing phase, and look for it in the AST scan. +<a href="http://llvm.org/viewvc/llvm-project?view=rev&revision=124217">r124217</a> +has a good example of adding a warning attribute.</p> + +<p>(Beware that this hasn't been reviewed/fixed by the people who designed the +attributes system yet.)</p> + +<h4><a +href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?view=markup">include/clang/Basic/Attr.td</a></h4> + +<p>Each attribute gets a <tt>def</tt> inheriting from <tt>Attr</tt> or one of +its subclasses. <tt>InheritableAttr</tt> means that the attribute also applies +to subsequent declarations of the same name.</p> + +<p><tt>Spellings</tt> lists the strings that can appear in +<tt>__attribute__((here))</tt> or <tt>[[here]]</tt>. All such strings +will be synonymous. If you want to allow the <tt>[[]]</tt> C++11 +syntax, you have to define a list of <tt>Namespaces</tt>, which will +let users write <tt>[[namespace:spelling]]</tt>. Using the empty +string for a namespace will allow users to write just the spelling +with no "<tt>:</tt>".</p> + +<p><tt>Subjects</tt> restricts what kinds of AST node to which this attribute +can appertain (roughly, attach).</p> + +<p><tt>Args</tt> names the arguments the attribute takes, in order. If +<tt>Args</tt> is <tt>[StringArgument<"Arg1">, IntArgument<"Arg2">]</tt> +then <tt>__attribute__((myattribute("Hello", 3)))</tt> will be a valid use.</p> + +<h4>Boilerplate</h4> + +<p>Add an element to the <tt>AttributeList::Kind</tt> enum in <a +href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?view=markup">include/clang/Sema/AttributeList.h</a> +named <tt>AT_lower_with_underscores</tt>. That is, a CamelCased +<tt>AttributeName</tt> in <tt>Attr.td</tt> name should become +<tt>AT_attribute_name</tt>.</p> + +<p>Add a case to the <tt>StringSwitch</tt> in <tt>AttributeList::getKind()</tt> +in <a +href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AttributeList.cpp?view=markup">lib/Sema/AttributeList.cpp</a> +for each spelling of your attribute. Less common attributes should come toward +the end of that list.</p> + +<p>Write a new <tt>HandleYourAttr()</tt> function in <a +href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?view=markup">lib/Sema/SemaDeclAttr.cpp</a>, +and add a case to the switch in <tt>ProcessNonInheritableDeclAttr()</tt> or +<tt>ProcessInheritableDeclAttr()</tt> forwarding to it.</p> + +<p>If your attribute causes extra warnings to fire, define a <tt>DiagGroup</tt> +in <a +href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?view=markup">include/clang/Basic/DiagnosticGroups.td</a> +named after the attribute's <tt>Spelling</tt> with "_"s replaced by "-"s. If +you're only defining one diagnostic, you can skip <tt>DiagnosticGroups.td</tt> +and use <tt>InGroup<DiagGroup<"your-attribute">></tt> directly in <a +href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?view=markup">DiagnosticSemaKinds.td</a></p> + +<h4>The meat of your attribute</h4> + +<p>Find an appropriate place in Clang to do whatever your attribute needs to do. +Check for the attribute's presence using <tt>Decl::getAttr<YourAttr>()</tt>.</p> + +<p>Update the <a href="LanguageExtensions.html">Clang Language Extensions</a> +document to describe your new attribute.</p> + +<!-- ======================================================================= --> +<h3 id="AddingExprStmt">How to add an expression or statement</h3> +<!-- ======================================================================= --> + +<p>Expressions and statements are one of the most fundamental constructs within a +compiler, because they interact with many different parts of the AST, +semantic analysis, and IR generation. Therefore, adding a new +expression or statement kind into Clang requires some care. The following list +details the various places in Clang where an expression or statement needs to be +introduced, along with patterns to follow to ensure that the new +expression or statement works well across all of the C languages. We +focus on expressions, but statements are similar.</p> + +<ol> + <li>Introduce parsing actions into the parser. Recursive-descent + parsing is mostly self-explanatory, but there are a few things that + are worth keeping in mind: + <ul> + <li>Keep as much source location information as possible! You'll + want it later to produce great diagnostics and support Clang's + various features that map between source code and the AST.</li> + <li>Write tests for all of the "bad" parsing cases, to make sure + your recovery is good. If you have matched delimiters (e.g., + parentheses, square brackets, etc.), use + <tt>Parser::BalancedDelimiterTracker</tt> to give nice diagnostics when + things go wrong.</li> + </ul> + </li> + + <li>Introduce semantic analysis actions into <tt>Sema</tt>. Semantic + analysis should always involve two functions: an <tt>ActOnXXX</tt> + function that will be called directly from the parser, and a + <tt>BuildXXX</tt> function that performs the actual semantic + analysis and will (eventually!) build the AST node. It's fairly + common for the <tt>ActOnCXX</tt> function to do very little (often + just some minor translation from the parser's representation to + <tt>Sema</tt>'s representation of the same thing), but the separation + is still important: C++ template instantiation, for example, + should always call the <tt>BuildXXX</tt> variant. Several notes on + semantic analysis before we get into construction of the AST: + <ul> + <li>Your expression probably involves some types and some + subexpressions. Make sure to fully check that those types, and the + types of those subexpressions, meet your expectations. Add + implicit conversions where necessary to make sure that all of the + types line up exactly the way you want them. Write extensive tests + to check that you're getting good diagnostics for mistakes and + that you can use various forms of subexpressions with your + expression.</li> + <li>When type-checking a type or subexpression, make sure to first + check whether the type is "dependent" + (<tt>Type::isDependentType()</tt>) or whether a subexpression is + type-dependent (<tt>Expr::isTypeDependent()</tt>). If any of these + return true, then you're inside a template and you can't do much + type-checking now. That's normal, and your AST node (when you get + there) will have to deal with this case. At this point, you can + write tests that use your expression within templates, but don't + try to instantiate the templates.</li> + <li>For each subexpression, be sure to call + <tt>Sema::CheckPlaceholderExpr()</tt> to deal with "weird" + expressions that don't behave well as subexpressions. Then, + determine whether you need to perform + lvalue-to-rvalue conversions + (<tt>Sema::DefaultLvalueConversion</tt>e) or + the usual unary conversions + (<tt>Sema::UsualUnaryConversions</tt>), for places where the + subexpression is producing a value you intend to use.</li> + <li>Your <tt>BuildXXX</tt> function will probably just return + <tt>ExprError()</tt> at this point, since you don't have an AST. + That's perfectly fine, and shouldn't impact your testing.</li> + </ul> + </li> + + <li>Introduce an AST node for your new expression. This starts with + declaring the node in <tt>include/Basic/StmtNodes.td</tt> and + creating a new class for your expression in the appropriate + <tt>include/AST/Expr*.h</tt> header. It's best to look at the class + for a similar expression to get ideas, and there are some specific + things to watch for: + <ul> + <li>If you need to allocate memory, use the <tt>ASTContext</tt> + allocator to allocate memory. Never use raw <tt>malloc</tt> or + <tt>new</tt>, and never hold any resources in an AST node, because + the destructor of an AST node is never called.</li> + + <li>Make sure that <tt>getSourceRange()</tt> covers the exact + source range of your expression. This is needed for diagnostics + and for IDE support.</li> + + <li>Make sure that <tt>children()</tt> visits all of the + subexpressions. This is important for a number of features (e.g., IDE + support, C++ variadic templates). If you have sub-types, you'll + also need to visit those sub-types in the + <tt>RecursiveASTVisitor</tt>.</li> + + <li>Add printing support (<tt>StmtPrinter.cpp</tt>) and dumping + support (<tt>StmtDumper.cpp</tt>) for your expression.</li> + + <li>Add profiling support (<tt>StmtProfile.cpp</tt>) for your AST + node, noting the distinguishing (non-source location) + characteristics of an instance of your expression. Omitting this + step will lead to hard-to-diagnose failures regarding matching of + template declarations.</li> + </ul> + </li> + + <li>Teach semantic analysis to build your AST node! At this point, + you can wire up your <tt>Sema::BuildXXX</tt> function to actually + create your AST. A few things to check at this point: + <ul> + <li>If your expression can construct a new C++ class or return a + new Objective-C object, be sure to update and then call + <tt>Sema::MaybeBindToTemporary</tt> for your just-created AST node + to be sure that the object gets properly destructed. An easy way + to test this is to return a C++ class with a private destructor: + semantic analysis should flag an error here with the attempt to + call the destructor.</li> + <li>Inspect the generated AST by printing it using <tt>clang -cc1 + -ast-print</tt>, to make sure you're capturing all of the + important information about how the AST was written.</li> + <li>Inspect the generated AST under <tt>clang -cc1 -ast-dump</tt> + to verify that all of the types in the generated AST line up the + way you want them. Remember that clients of the AST should never + have to "think" to understand what's going on. For example, all + implicit conversions should show up explicitly in the AST.</li> + <li>Write tests that use your expression as a subexpression of + other, well-known expressions. Can you call a function using your + expression as an argument? Can you use the ternary operator?</li> + </ul> + </li> + + <li>Teach code generation to create IR to your AST node. This step + is the first (and only) that requires knowledge of LLVM IR. There + are several things to keep in mind: + <ul> + <li>Code generation is separated into scalar/aggregate/complex and + lvalue/rvalue paths, depending on what kind of result your + expression produces. On occasion, this requires some careful + factoring of code to avoid duplication.</li> + + <li><tt>CodeGenFunction</tt> contains functions + <tt>ConvertType</tt> and <tt>ConvertTypeForMem</tt> that convert + Clang's types (<tt>clang::Type*</tt> or <tt>clang::QualType</tt>) + to LLVM types. + Use the former for values, and the later for memory locations: + test with the C++ "bool" type to check this. If you find + that you are having to use LLVM bitcasts to make + the subexpressions of your expression have the type that your + expression expects, STOP! Go fix semantic analysis and the AST so + that you don't need these bitcasts.</li> + + <li>The <tt>CodeGenFunction</tt> class has a number of helper + functions to make certain operations easy, such as generating code + to produce an lvalue or an rvalue, or to initialize a memory + location with a given value. Prefer to use these functions rather + than directly writing loads and stores, because these functions + take care of some of the tricky details for you (e.g., for + exceptions).</li> + + <li>If your expression requires some special behavior in the event + of an exception, look at the <tt>push*Cleanup</tt> functions in + <tt>CodeGenFunction</tt> to introduce a cleanup. You shouldn't + have to deal with exception-handling directly.</li> + + <li>Testing is extremely important in IR generation. Use <tt>clang + -cc1 -emit-llvm</tt> and <a + href="http://llvm.org/cmds/FileCheck.html">FileCheck</a> to verify + that you're generating the right IR.</li> + </ul> + </li> + + <li>Teach template instantiation how to cope with your AST + node, which requires some fairly simple code: + <ul> + <li>Make sure that your expression's constructor properly + computes the flags for type dependence (i.e., the type your + expression produces can change from one instantiation to the + next), value dependence (i.e., the constant value your expression + produces can change from one instantiation to the next), + instantiation dependence (i.e., a template parameter occurs + anywhere in your expression), and whether your expression contains + a parameter pack (for variadic templates). Often, computing these + flags just means combining the results from the various types and + subexpressions.</li> + + <li>Add <tt>TransformXXX</tt> and <tt>RebuildXXX</tt> functions to + the + <tt>TreeTransform</tt> class template in <tt>Sema</tt>. + <tt>TransformXXX</tt> should (recursively) transform all of the + subexpressions and types + within your expression, using <tt>getDerived().TransformYYY</tt>. + If all of the subexpressions and types transform without error, it + will then call the <tt>RebuildXXX</tt> function, which will in + turn call <tt>getSema().BuildXXX</tt> to perform semantic analysis + and build your expression.</li> + + <li>To test template instantiation, take those tests you wrote to + make sure that you were type checking with type-dependent + expressions and dependent types (from step #2) and instantiate + those templates with various types, some of which type-check and + some that don't, and test the error messages in each case.</li> + </ul> + </li> + + <li>There are some "extras" that make other features work better. + It's worth handling these extras to give your expression complete + integration into Clang: + <ul> + <li>Add code completion support for your expression in + <tt>SemaCodeComplete.cpp</tt>.</li> + + <li>If your expression has types in it, or has any "interesting" + features other than subexpressions, extend libclang's + <tt>CursorVisitor</tt> to provide proper visitation for your + expression, enabling various IDE features such as syntax + highlighting, cross-referencing, and so on. The + <tt>c-index-test</tt> helper program can be used to test these + features.</li> + </ul> + </li> +</ol> + +</div> +</body> +</html> diff --git a/clang/docs/LanguageExtensions.html b/clang/docs/LanguageExtensions.html new file mode 100644 index 0000000..68f0afc --- /dev/null +++ b/clang/docs/LanguageExtensions.html @@ -0,0 +1,1810 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ --> +<html> +<head> + <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> + <title>Clang Language Extensions</title> + <link type="text/css" rel="stylesheet" href="../menu.css"> + <link type="text/css" rel="stylesheet" href="../content.css"> + <style type="text/css"> + td { + vertical-align: top; + } + th { background-color: #ffddaa; } + </style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>Clang Language Extensions</h1> + +<ul> +<li><a href="#intro">Introduction</a></li> +<li><a href="#feature_check">Feature Checking Macros</a></li> +<li><a href="#has_include">Include File Checking Macros</a></li> +<li><a href="#builtinmacros">Builtin Macros</a></li> +<li><a href="#vectors">Vectors and Extended Vectors</a></li> +<li><a href="#deprecated">Messages on <tt>deprecated</tt> and <tt>unavailable</tt> attributes</a></li> +<li><a href="#attributes-on-enumerators">Attributes on enumerators</a></li> +<li><a href="#user_specified_system_framework">'User-Specified' System Frameworks</a></li> +<li><a href="#availability">Availability attribute</a></li> +<li><a href="#checking_language_features">Checks for Standard Language Features</a> + <ul> + <li><a href="#cxx98">C++98</a> + <ul> + <li><a href="#cxx_exceptions">C++ exceptions</a></li> + <li><a href="#cxx_rtti">C++ RTTI</a></li> + </ul></li> + <li><a href="#cxx11">C++11</a> + <ul> + <li><a href="#cxx_access_control_sfinae">C++11 SFINAE includes access control</a></li> + <li><a href="#cxx_alias_templates">C++11 alias templates</a></li> + <li><a href="#cxx_alignas">C++11 alignment specifiers</a></li> + <li><a href="#cxx_attributes">C++11 attributes</a></li> + <li><a href="#cxx_constexpr">C++11 generalized constant expressions</a></li> + <li><a href="#cxx_decltype">C++11 <tt>decltype()</tt></a></li> + <li><a href="#cxx_default_function_template_args">C++11 default template arguments in function templates</a></li> + <li><a href="#cxx_defaulted_functions">C++11 defaulted functions</a></li> + <li><a href="#cxx_delegating_constructor">C++11 delegating constructors</a></li> + <li><a href="#cxx_deleted_functions">C++11 deleted functions</a></li> + <li><a href="#cxx_explicit_conversions">C++11 explicit conversion functions</a></li> + <li><a href="#cxx_generalized_initializers">C++11 generalized initializers</a></li> + <li><a href="#cxx_implicit_moves">C++11 implicit move constructors/assignment operators</a></li> + <li><a href="#cxx_inheriting_constructors">C++11 inheriting constructors</a></li> + <li><a href="#cxx_inline_namespaces">C++11 inline namespaces</a></li> + <li><a href="#cxx_lambdas">C++11 lambdas</a></li> + <li><a href="#cxx_local_type_template_args">C++11 local and unnamed types as template arguments</a></li> + <li><a href="#cxx_noexcept">C++11 noexcept specification</a></li> + <li><a href="#cxx_nonstatic_member_init">C++11 in-class non-static data member initialization</a></li> + <li><a href="#cxx_nullptr">C++11 nullptr</a></li> + <li><a href="#cxx_override_control">C++11 override control</a></li> + <li><a href="#cxx_range_for">C++11 range-based for loop</a></li> + <li><a href="#cxx_raw_string_literals">C++11 raw string literals</a></li> + <li><a href="#cxx_rvalue_references">C++11 rvalue references</a></li> + <li><a href="#cxx_reference_qualified_functions">C++11 reference-qualified functions</a></li> + <li><a href="#cxx_static_assert">C++11 <tt>static_assert()</tt></a></li> + <li><a href="#cxx_auto_type">C++11 type inference</a></li> + <li><a href="#cxx_strong_enums">C++11 strongly-typed enumerations</a></li> + <li><a href="#cxx_trailing_return">C++11 trailing return type</a></li> + <li><a href="#cxx_unicode_literals">C++11 Unicode string literals</a></li> + <li><a href="#cxx_unrestricted_unions">C++11 unrestricted unions</a></li> + <li><a href="#cxx_user_literals">C++11 user-defined literals</a></li> + <li><a href="#cxx_variadic_templates">C++11 variadic templates</a></li> + </ul></li> + <li><a href="#c11">C11</a> + <ul> + <li><a href="#c_alignas">C11 alignment specifiers</a></li> + <li><a href="#c_atomic">C11 atomic operations</a></li> + <li><a href="#c_generic_selections">C11 generic selections</a></li> + <li><a href="#c_static_assert">C11 <tt>_Static_assert()</tt></a></li> + </ul></li> +</ul></li> +<li><a href="#checking_type_traits">Checks for Type Traits</a></li> +<li><a href="#blocks">Blocks</a></li> +<li><a href="#objc_features">Objective-C Features</a> + <ul> + <li><a href="#objc_instancetype">Related result types</a></li> + <li><a href="#objc_arc">Automatic reference counting</a></li> + <li><a href="#objc_fixed_enum">Enumerations with a fixed underlying type</a></li> + <li><a href="#objc_lambdas">Interoperability with C++11 lambdas</a></li> + <li><a href="#object-literals-subscripting">Object Literals and Subscripting</a></li> + </ul> +</li> +<li><a href="#overloading-in-c">Function Overloading in C</a></li> +<li><a href="#complex-list-init">Initializer lists for complex numbers in C</a></li> +<li><a href="#builtins">Builtin Functions</a> + <ul> + <li><a href="#__builtin_shufflevector">__builtin_shufflevector</a></li> + <li><a href="#__builtin_unreachable">__builtin_unreachable</a></li> + <li><a href="#__sync_swap">__sync_swap</a></li> + </ul> +</li> +<li><a href="#targetspecific">Target-Specific Extensions</a> + <ul> + <li><a href="#x86-specific">X86/X86-64 Language Extensions</a></li> + </ul> +</li> +<li><a href="#analyzerspecific">Static Analysis-Specific Extensions</a></li> +<li><a href="#dynamicanalyzerspecific">Dynamic Analysis-Specific Extensions</a> + <ul> + <li><a href="#address_sanitizer">AddressSanitizer</a></li> + </ul> +</li> +<li><a href="#threadsafety">Thread Safety Annotation Checking</a> + <ul> + <li><a href="#ts_noanal"><tt>no_thread_safety_analysis</tt></a></li> + <li><a href="#ts_lockable"><tt>lockable</tt></a></li> + <li><a href="#ts_scopedlockable"><tt>scoped_lockable</tt></a></li> + <li><a href="#ts_guardedvar"><tt>guarded_var</tt></a></li> + <li><a href="#ts_ptguardedvar"><tt>pt_guarded_var</tt></a></li> + <li><a href="#ts_guardedby"><tt>guarded_by(l)</tt></a></li> + <li><a href="#ts_ptguardedby"><tt>pt_guarded_by(l)</tt></a></li> + <li><a href="#ts_acquiredbefore"><tt>acquired_before(...)</tt></a></li> + <li><a href="#ts_acquiredafter"><tt>acquired_after(...)</tt></a></li> + <li><a href="#ts_elf"><tt>exclusive_lock_function(...)</tt></a></li> + <li><a href="#ts_slf"><tt>shared_lock_function(...)</tt></a></li> + <li><a href="#ts_etf"><tt>exclusive_trylock_function(...)</tt></a></li> + <li><a href="#ts_stf"><tt>shared_trylock_function(...)</tt></a></li> + <li><a href="#ts_uf"><tt>unlock_function(...)</tt></a></li> + <li><a href="#ts_lr"><tt>lock_returned(l)</tt></a></li> + <li><a href="#ts_le"><tt>locks_excluded(...)</tt></a></li> + <li><a href="#ts_elr"><tt>exclusive_locks_required(...)</tt></a></li> + <li><a href="#ts_slr"><tt>shared_locks_required(...)</tt></a></li> + </ul> +</li> +</ul> + +<!-- ======================================================================= --> +<h2 id="intro">Introduction</h2> +<!-- ======================================================================= --> + +<p>This document describes the language extensions provided by Clang. In +addition to the language extensions listed here, Clang aims to support a broad +range of GCC extensions. Please see the <a +href="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html">GCC manual</a> for +more information on these extensions.</p> + +<!-- ======================================================================= --> +<h2 id="feature_check">Feature Checking Macros</h2> +<!-- ======================================================================= --> + +<p>Language extensions can be very useful, but only if you know you can depend +on them. In order to allow fine-grain features checks, we support three builtin +function-like macros. This allows you to directly test for a feature in your +code without having to resort to something like autoconf or fragile "compiler +version checks".</p> + +<!-- ======================================================================= --> +<h3><a name="__has_builtin">__has_builtin</a></h3> +<!-- ======================================================================= --> + +<p>This function-like macro takes a single identifier argument that is the name +of a builtin function. It evaluates to 1 if the builtin is supported or 0 if +not. It can be used like this:</p> + +<blockquote> +<pre> +#ifndef __has_builtin // Optional of course. + #define __has_builtin(x) 0 // Compatibility with non-clang compilers. +#endif + +... +#if __has_builtin(__builtin_trap) + __builtin_trap(); +#else + abort(); +#endif +... +</pre> +</blockquote> + + +<!-- ======================================================================= --> +<h3><a name="__has_feature_extension"> __has_feature and __has_extension</a></h3> +<!-- ======================================================================= --> + +<p>These function-like macros take a single identifier argument that is the +name of a feature. <code>__has_feature</code> evaluates to 1 if the feature +is both supported by Clang and standardized in the current language standard +or 0 if not (but see <a href="#has_feature_back_compat">below</a>), while +<code>__has_extension</code> evaluates to 1 if the feature is supported by +Clang in the current language (either as a language extension or a standard +language feature) or 0 if not. They can be used like this:</p> + +<blockquote> +<pre> +#ifndef __has_feature // Optional of course. + #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif +#ifndef __has_extension + #define __has_extension __has_feature // Compatibility with pre-3.0 compilers. +#endif + +... +#if __has_feature(cxx_rvalue_references) +// This code will only be compiled with the -std=c++11 and -std=gnu++11 +// options, because rvalue references are only standardized in C++11. +#endif + +#if __has_extension(cxx_rvalue_references) +// This code will be compiled with the -std=c++11, -std=gnu++11, -std=c++98 +// and -std=gnu++98 options, because rvalue references are supported as a +// language extension in C++98. +#endif +</pre> +</blockquote> + +<p id="has_feature_back_compat">For backwards compatibility reasons, +<code>__has_feature</code> can also be used to test for support for +non-standardized features, i.e. features not prefixed <code>c_</code>, +<code>cxx_</code> or <code>objc_</code>.</p> + +<p id="has_feature_for_non_language_features"> +Another use of <code>__has_feature</code> is to check for compiler features +not related to the language standard, such as e.g. +<a href="AddressSanitizer.html">AddressSanitizer</a>. + +<p>If the <code>-pedantic-errors</code> option is given, +<code>__has_extension</code> is equivalent to <code>__has_feature</code>.</p> + +<p>The feature tag is described along with the language feature below.</p> + +<p>The feature name or extension name can also be specified with a preceding and +following <code>__</code> (double underscore) to avoid interference from a macro +with the same name. For instance, <code>__cxx_rvalue_references__</code> can be +used instead of <code>cxx_rvalue_references</code>.</p> + +<!-- ======================================================================= --> +<h3><a name="__has_attribute">__has_attribute</a></h3> +<!-- ======================================================================= --> + +<p>This function-like macro takes a single identifier argument that is the name +of an attribute. It evaluates to 1 if the attribute is supported or 0 if not. It +can be used like this:</p> + +<blockquote> +<pre> +#ifndef __has_attribute // Optional of course. + #define __has_attribute(x) 0 // Compatibility with non-clang compilers. +#endif + +... +#if __has_attribute(always_inline) +#define ALWAYS_INLINE __attribute__((always_inline)) +#else +#define ALWAYS_INLINE +#endif +... +</pre> +</blockquote> + +<p>The attribute name can also be specified with a preceding and +following <code>__</code> (double underscore) to avoid interference from a macro +with the same name. For instance, <code>__always_inline__</code> can be used +instead of <code>always_inline</code>.</p> + +<!-- ======================================================================= --> +<h2 id="has_include">Include File Checking Macros</h2> +<!-- ======================================================================= --> + +<p>Not all developments systems have the same include files. +The <a href="#__has_include">__has_include</a> and +<a href="#__has_include_next">__has_include_next</a> macros allow you to +check for the existence of an include file before doing +a possibly failing #include directive.</p> + +<!-- ======================================================================= --> +<h3><a name="__has_include">__has_include</a></h3> +<!-- ======================================================================= --> + +<p>This function-like macro takes a single file name string argument that +is the name of an include file. It evaluates to 1 if the file can +be found using the include paths, or 0 otherwise:</p> + +<blockquote> +<pre> +// Note the two possible file name string formats. +#if __has_include("myinclude.h") && __has_include(<stdint.h>) +# include "myinclude.h" +#endif + +// To avoid problem with non-clang compilers not having this macro. +#if defined(__has_include) && __has_include("myinclude.h") +# include "myinclude.h" +#endif +</pre> +</blockquote> + +<p>To test for this feature, use #if defined(__has_include).</p> + +<!-- ======================================================================= --> +<h3><a name="__has_include_next">__has_include_next</a></h3> +<!-- ======================================================================= --> + +<p>This function-like macro takes a single file name string argument that +is the name of an include file. It is like __has_include except that it +looks for the second instance of the given file found in the include +paths. It evaluates to 1 if the second instance of the file can +be found using the include paths, or 0 otherwise:</p> + +<blockquote> +<pre> +// Note the two possible file name string formats. +#if __has_include_next("myinclude.h") && __has_include_next(<stdint.h>) +# include_next "myinclude.h" +#endif + +// To avoid problem with non-clang compilers not having this macro. +#if defined(__has_include_next) && __has_include_next("myinclude.h") +# include_next "myinclude.h" +#endif +</pre> +</blockquote> + +<p>Note that __has_include_next, like the GNU extension +#include_next directive, is intended for use in headers only, +and will issue a warning if used in the top-level compilation +file. A warning will also be issued if an absolute path +is used in the file argument.</p> + + +<!-- ======================================================================= --> +<h3><a name="__has_warning">__has_warning</a></h3> +<!-- ======================================================================= --> + +<p>This function-like macro takes a string literal that represents a command + line option for a warning and returns true if that is a valid warning + option.</p> + +<blockquote> +<pre> +#if __has_warning("-Wformat") +... +#endif +</pre> +</blockquote> + +<!-- ======================================================================= --> +<h2 id="builtinmacros">Builtin Macros</h2> +<!-- ======================================================================= --> + +<dl> + <dt><code>__BASE_FILE__</code></dt> + <dd>Defined to a string that contains the name of the main input + file passed to Clang.</dd> + + <dt><code>__COUNTER__</code></dt> + <dd>Defined to an integer value that starts at zero and is + incremented each time the <code>__COUNTER__</code> macro is + expanded.</dd> + + <dt><code>__INCLUDE_LEVEL__</code></dt> + <dd>Defined to an integral value that is the include depth of the + file currently being translated. For the main file, this value is + zero.</dd> + + <dt><code>__TIMESTAMP__</code></dt> + <dd>Defined to the date and time of the last modification of the + current source file.</dd> + + <dt><code>__clang__</code></dt> + <dd>Defined when compiling with Clang</dd> + + <dt><code>__clang_major__</code></dt> + <dd>Defined to the major marketing version number of Clang (e.g., the + 2 in 2.0.1). Note that marketing version numbers should not be used to + check for language features, as different vendors use different numbering + schemes. Instead, use the <a href="#feature_check">feature checking + macros</a>.</dd> + + <dt><code>__clang_minor__</code></dt> + <dd>Defined to the minor version number of Clang (e.g., the 0 in + 2.0.1). Note that marketing version numbers should not be used to + check for language features, as different vendors use different numbering + schemes. Instead, use the <a href="#feature_check">feature checking + macros</a>.</dd> + + <dt><code>__clang_patchlevel__</code></dt> + <dd>Defined to the marketing patch level of Clang (e.g., the 1 in 2.0.1).</dd> + + <dt><code>__clang_version__</code></dt> + <dd>Defined to a string that captures the Clang marketing version, including + the Subversion tag or revision number, e.g., "1.5 (trunk 102332)".</dd> +</dl> + +<!-- ======================================================================= --> +<h2 id="vectors">Vectors and Extended Vectors</h2> +<!-- ======================================================================= --> + +<p>Supports the GCC, OpenCL, AltiVec and NEON vector extensions.</p> + +<p>OpenCL vector types are created using <tt>ext_vector_type</tt> attribute. It +support for <tt>V.xyzw</tt> syntax and other tidbits as seen in OpenCL. An +example is:</p> + +<blockquote> +<pre> +typedef float float4 <b>__attribute__((ext_vector_type(4)))</b>; +typedef float float2 <b>__attribute__((ext_vector_type(2)))</b>; + +float4 foo(float2 a, float2 b) { + float4 c; + c.xz = a; + c.yw = b; + return c; +} +</pre> +</blockquote> + +<p>Query for this feature with +<tt>__has_extension(attribute_ext_vector_type)</tt>.</p> + +<p>Giving <tt>-faltivec</tt> option to clang enables support for AltiVec vector +syntax and functions. For example:</p> + +<blockquote> +<pre> +vector float foo(vector int a) { + vector int b; + b = vec_add(a, a) + a; + return (vector float)b; +} +</pre> +</blockquote> + +<p>NEON vector types are created using <tt>neon_vector_type</tt> and +<tt>neon_polyvector_type</tt> attributes. For example:</p> + +<blockquote> +<pre> +typedef <b>__attribute__((neon_vector_type(8)))</b> int8_t int8x8_t; +typedef <b>__attribute__((neon_polyvector_type(16)))</b> poly8_t poly8x16_t; + +int8x8_t foo(int8x8_t a) { + int8x8_t v; + v = a; + return v; +} +</pre> +</blockquote> + +<!-- ======================================================================= --> +<h3><a name="vector_literals">Vector Literals</a></h3> +<!-- ======================================================================= --> + +<p>Vector literals can be used to create vectors from a set of scalars, or +vectors. Either parentheses or braces form can be used. In the parentheses form +the number of literal values specified must be one, i.e. referring to a scalar +value, or must match the size of the vector type being created. If a single +scalar literal value is specified, the scalar literal value will be replicated +to all the components of the vector type. In the brackets form any number of +literals can be specified. For example:</p> + +<blockquote> +<pre> +typedef int v4si __attribute__((__vector_size__(16))); +typedef float float4 __attribute__((ext_vector_type(4))); +typedef float float2 __attribute__((ext_vector_type(2))); + +v4si vsi = (v4si){1, 2, 3, 4}; +float4 vf = (float4)(1.0f, 2.0f, 3.0f, 4.0f); +vector int vi1 = (vector int)(1); // vi1 will be (1, 1, 1, 1). +vector int vi2 = (vector int){1}; // vi2 will be (1, 0, 0, 0). +vector int vi3 = (vector int)(1, 2); // error +vector int vi4 = (vector int){1, 2}; // vi4 will be (1, 2, 0, 0). +vector int vi5 = (vector int)(1, 2, 3, 4); +float4 vf = (float4)((float2)(1.0f, 2.0f), (float2)(3.0f, 4.0f)); +</pre> +</blockquote> + +<!-- ======================================================================= --> +<h3><a name="vector_operations">Vector Operations</a></h3> +<!-- ======================================================================= --> + +<p>The table below shows the support for each operation by vector extension. +A dash indicates that an operation is not accepted according to a corresponding +specification.</p> + +<table width="500" border="1" cellspacing="0"> + <tr> + <th>Operator</th> + <th>OpenCL</th> + <th>AltiVec</th> + <th>GCC</th> + <th>NEON</th> + </tr> + <tr> + <td>[]</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + </tr> + <tr> + <td>unary operators +, -</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + </tr> + <tr> + <td>++, --</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + <td align="center">-</td> + </tr> + <tr> + <td>+, -, *, /, %</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + </tr> + <tr> + <td>bitwise operators &, |, ^, ~</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + </tr> + <tr> + <td>>>, <<</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + </tr> + <tr> + <td>!, &&,||</td> + <td align="center">no</td> + <td align="center">-</td> + <td align="center">-</td> + <td align="center">-</td> + </tr> + <tr> + <td>==,!=, >, <, >=, <=</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">-</td> + <td align="center">-</td> + </tr> + <tr> + <td>=</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + </tr> + <tr> + <td>:?</td> + <td align="center">yes</td> + <td align="center">-</td> + <td align="center">-</td> + <td align="center">-</td> + </tr> + <tr> + <td>sizeof</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + <td align="center">yes</td> + </tr> +</table> + +<p>See also <a href="#__builtin_shufflevector">__builtin_shufflevector</a>.</p> + +<!-- ======================================================================= --> +<h2 id="deprecated">Messages on <tt>deprecated</tt> and <tt>unavailable</tt> Attributes</h2> +<!-- ======================================================================= --> + +<p>An optional string message can be added to the <tt>deprecated</tt> +and <tt>unavailable</tt> attributes. For example:</p> + +<blockquote> +<pre>void explode(void) __attribute__((deprecated("extremely unsafe, use 'combust' instead!!!")));</pre> +</blockquote> + +<p>If the deprecated or unavailable declaration is used, the message +will be incorporated into the appropriate diagnostic:</p> + +<blockquote> +<pre>harmless.c:4:3: warning: 'explode' is deprecated: extremely unsafe, use 'combust' instead!!! + [-Wdeprecated-declarations] + explode(); + ^</pre> +</blockquote> + +<p>Query for this feature +with <tt>__has_extension(attribute_deprecated_with_message)</tt> +and <tt>__has_extension(attribute_unavailable_with_message)</tt>.</p> + +<!-- ======================================================================= --> +<h2 id="attributes-on-enumerators">Attributes on Enumerators</h2> +<!-- ======================================================================= --> + +<p>Clang allows attributes to be written on individual enumerators. +This allows enumerators to be deprecated, made unavailable, etc. The +attribute must appear after the enumerator name and before any +initializer, like so:</p> + +<blockquote> +<pre>enum OperationMode { + OM_Invalid, + OM_Normal, + OM_Terrified __attribute__((deprecated)), + OM_AbortOnError __attribute__((deprecated)) = 4 +};</pre> +</blockquote> + +<p>Attributes on the <tt>enum</tt> declaration do not apply to +individual enumerators.</p> + +<p>Query for this feature with <tt>__has_extension(enumerator_attributes)</tt>.</p> + +<!-- ======================================================================= --> +<h2 id="user_specified_system_framework">'User-Specified' System Frameworks</h2> +<!-- ======================================================================= --> + +<p>Clang provides a mechanism by which frameworks can be built in such a way +that they will always be treated as being 'system frameworks', even if they are +not present in a system framework directory. This can be useful to system +framework developers who want to be able to test building other applications +with development builds of their framework, including the manner in which the +compiler changes warning behavior for system headers.</p> + +<p>Framework developers can opt-in to this mechanism by creating a +'.system_framework' file at the top-level of their framework. That is, the +framework should have contents like:</p> + +<pre> + .../TestFramework.framework + .../TestFramework.framework/.system_framework + .../TestFramework.framework/Headers + .../TestFramework.framework/Headers/TestFramework.h + ... +</pre> + +<p>Clang will treat the presence of this file as an indicator that the framework +should be treated as a system framework, regardless of how it was found in the +framework search path. For consistency, we recommend that such files never be +included in installed versions of the framework.</p> + +<!-- ======================================================================= --> +<h2 id="availability">Availability attribute</h2 +<!-- ======================================================================= --> + +<p>Clang introduces the <code>availability</code> attribute, which can +be placed on declarations to describe the lifecycle of that +declaration relative to operating system versions. Consider the function declaration for a hypothetical function <code>f</code>:</p> + +<pre> +void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7))); +</pre> + +<p>The availability attribute states that <code>f</code> was introduced in Mac OS X 10.4, deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information is used by Clang to determine when it is safe to use <code>f</code>: for example, if Clang is instructed to compile code for Mac OS X 10.5, a call to <code>f()</code> succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call succeeds but Clang emits a warning specifying that the function is deprecated. Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call fails because <code>f()</code> is no longer available.</p> + +<p>The availablility attribute is a comma-separated list starting with the platform name and then including clauses specifying important milestones in the declaration's lifetime (in any order) along with additional information. Those clauses can be:</p> + +<dl> + <dt>introduced=<i>version</i></dt> + <dd>The first version in which this declaration was introduced.</dd> + + <dt>deprecated=<i>version</i></dt> + <dd>The first version in which this declaration was deprecated, meaning that users should migrate away from this API.</dd> + + <dt>obsoleted=<i>version</i></dt> + <dd>The first version in which this declaration was obsoleted, meaning that it was removed completely and can no longer be used.</dd> + + <dt>unavailable</dt> + <dd>This declaration is never available on this platform.</dd> + + <dt>message=<i>string-literal</i></dt> + <dd>Additional message text that Clang will provide when emitting a warning or error about use of a deprecated or obsoleted declaration. Useful to direct users to replacement APIs.</dd> +</dl> + +<p>Multiple availability attributes can be placed on a declaration, which may correspond to different platforms. Only the availability attribute with the platform corresponding to the target platform will be used; any others will be ignored. If no availability attribute specifies availability for the current target platform, the availability attributes are ignored. Supported platforms are:</p> + +<dl> + <dt>ios</dt> + <dd>Apple's iOS operating system. The minimum deployment target is specified by the <code>-mios-version-min=<i>version</i></code> or <code>-miphoneos-version-min=<i>version</i></code> command-line arguments.</dd> + + <dt>macosx</dt> + <dd>Apple's Mac OS X operating system. The minimum deployment target is specified by the <code>-mmacosx-version-min=<i>version</i></code> command-line argument.</dd> +</dl> + +<p>A declaration can be used even when deploying back to a platform +version prior to when the declaration was introduced. When this +happens, the declaration is <a + href="https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html">weakly +linked</a>, as if the <code>weak_import</code> attribute were added to the declaration. A weakly-linked declaration may or may not be present a run-time, and a program can determine whether the declaration is present by checking whether the address of that declaration is non-NULL.</p> + +<!-- ======================================================================= --> +<h2 id="checking_language_features">Checks for Standard Language Features</h2> +<!-- ======================================================================= --> + +<p>The <tt>__has_feature</tt> macro can be used to query if certain standard +language features are enabled. The <tt>__has_extension</tt> macro can be used +to query if language features are available as an extension when compiling for +a standard which does not provide them. The features which can be tested are +listed here.</p> + +<h3 id="cxx98">C++98</h3> + +<p>The features listed below are part of the C++98 standard. These features are +enabled by default when compiling C++ code.</p> + +<h4 id="cxx_exceptions">C++ exceptions</h4> + +<p>Use <tt>__has_feature(cxx_exceptions)</tt> to determine if C++ exceptions have been enabled. For +example, compiling code with <tt>-fno-exceptions</tt> disables C++ exceptions.</p> + +<h4 id="cxx_rtti">C++ RTTI</h4> + +<p>Use <tt>__has_feature(cxx_rtti)</tt> to determine if C++ RTTI has been enabled. For example, +compiling code with <tt>-fno-rtti</tt> disables the use of RTTI.</p> + +<h3 id="cxx11">C++11</h3> + +<p>The features listed below are part of the C++11 standard. As a result, all +these features are enabled with the <tt>-std=c++11</tt> or <tt>-std=gnu++11</tt> +option when compiling C++ code.</p> + +<h4 id="cxx_access_control_sfinae">C++11 SFINAE includes access control</h4> + +<p>Use <tt>__has_feature(cxx_access_control_sfinae)</tt> or <tt>__has_extension(cxx_access_control_sfinae)</tt> to determine whether access-control errors (e.g., calling a private constructor) are considered to be template argument deduction errors (aka SFINAE errors), per <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1170">C++ DR1170</a>.</p> + +<h4 id="cxx_alias_templates">C++11 alias templates</h4> + +<p>Use <tt>__has_feature(cxx_alias_templates)</tt> or +<tt>__has_extension(cxx_alias_templates)</tt> to determine if support for +C++11's alias declarations and alias templates is enabled.</p> + +<h4 id="cxx_alignas">C++11 alignment specifiers</h4> + +<p>Use <tt>__has_feature(cxx_alignas)</tt> or +<tt>__has_extension(cxx_alignas)</tt> to determine if support for alignment +specifiers using <tt>alignas</tt> is enabled.</p> + +<h4 id="cxx_attributes">C++11 attributes</h4> + +<p>Use <tt>__has_feature(cxx_attributes)</tt> or +<tt>__has_extension(cxx_attributes)</tt> to determine if support for attribute +parsing with C++11's square bracket notation is enabled.</p> + +<h4 id="cxx_constexpr">C++11 generalized constant expressions</h4> + +<p>Use <tt>__has_feature(cxx_constexpr)</tt> to determine if support +for generalized constant expressions (e.g., <tt>constexpr</tt>) is +enabled.</p> + +<h4 id="cxx_decltype">C++11 <tt>decltype()</tt></h4> + +<p>Use <tt>__has_feature(cxx_decltype)</tt> or +<tt>__has_extension(cxx_decltype)</tt> to determine if support for the +<tt>decltype()</tt> specifier is enabled. C++11's <tt>decltype</tt> +does not require type-completeness of a function call expression. +Use <tt>__has_feature(cxx_decltype_incomplete_return_types)</tt> +or <tt>__has_extension(cxx_decltype_incomplete_return_types)</tt> +to determine if support for this feature is enabled.</p> + +<h4 id="cxx_default_function_template_args">C++11 default template arguments in function templates</h4> + +<p>Use <tt>__has_feature(cxx_default_function_template_args)</tt> or +<tt>__has_extension(cxx_default_function_template_args)</tt> to determine +if support for default template arguments in function templates is enabled.</p> + +<h4 id="cxx_defaulted_functions">C++11 <tt>default</tt>ed functions</h4> + +<p>Use <tt>__has_feature(cxx_defaulted_functions)</tt> or +<tt>__has_extension(cxx_defaulted_functions)</tt> to determine if support for +defaulted function definitions (with <tt>= default</tt>) is enabled.</p> + +<h4 id="cxx_delegating_constructors">C++11 delegating constructors</h4> + +<p>Use <tt>__has_feature(cxx_delegating_constructors)</tt> to determine if +support for delegating constructors is enabled.</p> + +<h4 id="cxx_deleted_functions">C++11 <tt>delete</tt>d functions</h4> + +<p>Use <tt>__has_feature(cxx_deleted_functions)</tt> or +<tt>__has_extension(cxx_deleted_functions)</tt> to determine if support for +deleted function definitions (with <tt>= delete</tt>) is enabled.</p> + +<h4 id="cxx_explicit_conversions">C++11 explicit conversion functions</h4> +<p>Use <tt>__has_feature(cxx_explicit_conversions)</tt> to determine if support for <tt>explicit</tt> conversion functions is enabled.</p> + +<h4 id="cxx_generalized_initializers">C++11 generalized initializers</h4> + +<p>Use <tt>__has_feature(cxx_generalized_initializers)</tt> to determine if +support for generalized initializers (using braced lists and +<tt>std::initializer_list</tt>) is enabled.</p> + +<h4 id="cxx_implicit_moves">C++11 implicit move constructors/assignment operators</h4> + +<p>Use <tt>__has_feature(cxx_implicit_moves)</tt> to determine if Clang will +implicitly generate move constructors and move assignment operators where needed.</p> + +<h4 id="cxx_inheriting_constructors">C++11 inheriting constructors</h4> + +<p>Use <tt>__has_feature(cxx_inheriting_constructors)</tt> to determine if support for inheriting constructors is enabled. Clang does not currently implement this feature.</p> + +<h4 id="cxx_inline_namespaces">C++11 inline namespaces</h4> + +<p>Use <tt>__has_feature(cxx_inline_namespaces)</tt> or +<tt>__has_extension(cxx_inline_namespaces)</tt> to determine if support for +inline namespaces is enabled.</p> + +<h4 id="cxx_lambdas">C++11 lambdas</h4> + +<p>Use <tt>__has_feature(cxx_lambdas)</tt> or +<tt>__has_extension(cxx_lambdas)</tt> to determine if support for lambdas +is enabled. </p> + +<h4 id="cxx_local_type_template_args">C++11 local and unnamed types as template arguments</h4> + +<p>Use <tt>__has_feature(cxx_local_type_template_args)</tt> or +<tt>__has_extension(cxx_local_type_template_args)</tt> to determine if +support for local and unnamed types as template arguments is enabled.</p> + +<h4 id="cxx_noexcept">C++11 noexcept</h4> + +<p>Use <tt>__has_feature(cxx_noexcept)</tt> or +<tt>__has_extension(cxx_noexcept)</tt> to determine if support for noexcept +exception specifications is enabled.</p> + +<h4 id="cxx_nonstatic_member_init">C++11 in-class non-static data member initialization</h4> + +<p>Use <tt>__has_feature(cxx_nonstatic_member_init)</tt> to determine whether in-class initialization of non-static data members is enabled.</p> + +<h4 id="cxx_nullptr">C++11 <tt>nullptr</tt></h4> + +<p>Use <tt>__has_feature(cxx_nullptr)</tt> or +<tt>__has_extension(cxx_nullptr)</tt> to determine if support for +<tt>nullptr</tt> is enabled.</p> + +<h4 id="cxx_override_control">C++11 <tt>override control</tt></h4> + +<p>Use <tt>__has_feature(cxx_override_control)</tt> or +<tt>__has_extension(cxx_override_control)</tt> to determine if support for +the override control keywords is enabled.</p> + +<h4 id="cxx_reference_qualified_functions">C++11 reference-qualified functions</h4> +<p>Use <tt>__has_feature(cxx_reference_qualified_functions)</tt> or +<tt>__has_extension(cxx_reference_qualified_functions)</tt> to determine +if support for reference-qualified functions (e.g., member functions with +<code>&</code> or <code>&&</code> applied to <code>*this</code>) +is enabled.</p> + +<h4 id="cxx_range_for">C++11 range-based <tt>for</tt> loop</h4> + +<p>Use <tt>__has_feature(cxx_range_for)</tt> or +<tt>__has_extension(cxx_range_for)</tt> to determine if support for the +range-based for loop is enabled. </p> + +<h4 id="cxx_raw_string_literals">C++11 raw string literals</h4> +<p>Use <tt>__has_feature(cxx_raw_string_literals)</tt> to determine if support +for raw string literals (e.g., <tt>R"x(foo\bar)x"</tt>) is enabled.</p> + +<h4 id="cxx_rvalue_references">C++11 rvalue references</h4> + +<p>Use <tt>__has_feature(cxx_rvalue_references)</tt> or +<tt>__has_extension(cxx_rvalue_references)</tt> to determine if support for +rvalue references is enabled. </p> + +<h4 id="cxx_static_assert">C++11 <tt>static_assert()</tt></h4> + +<p>Use <tt>__has_feature(cxx_static_assert)</tt> or +<tt>__has_extension(cxx_static_assert)</tt> to determine if support for +compile-time assertions using <tt>static_assert</tt> is enabled.</p> + +<h4 id="cxx_auto_type">C++11 type inference</h4> + +<p>Use <tt>__has_feature(cxx_auto_type)</tt> or +<tt>__has_extension(cxx_auto_type)</tt> to determine C++11 type inference is +supported using the <tt>auto</tt> specifier. If this is disabled, <tt>auto</tt> +will instead be a storage class specifier, as in C or C++98.</p> + +<h4 id="cxx_strong_enums">C++11 strongly typed enumerations</h4> + +<p>Use <tt>__has_feature(cxx_strong_enums)</tt> or +<tt>__has_extension(cxx_strong_enums)</tt> to determine if support for +strongly typed, scoped enumerations is enabled.</p> + +<h4 id="cxx_trailing_return">C++11 trailing return type</h4> + +<p>Use <tt>__has_feature(cxx_trailing_return)</tt> or +<tt>__has_extension(cxx_trailing_return)</tt> to determine if support for the +alternate function declaration syntax with trailing return type is enabled.</p> + +<h4 id="cxx_unicode_literals">C++11 Unicode string literals</h4> +<p>Use <tt>__has_feature(cxx_unicode_literals)</tt> to determine if +support for Unicode string literals is enabled.</p> + +<h4 id="cxx_unrestricted_unions">C++11 unrestricted unions</h4> + +<p>Use <tt>__has_feature(cxx_unrestricted_unions)</tt> to determine if support for unrestricted unions is enabled.</p> + +<h4 id="cxx_user_literals">C++11 user-defined literals</h4> + +<p>Use <tt>__has_feature(cxx_user_literals)</tt> to determine if support for user-defined literals is enabled.</p> + +<h4 id="cxx_variadic_templates">C++11 variadic templates</h4> + +<p>Use <tt>__has_feature(cxx_variadic_templates)</tt> or +<tt>__has_extension(cxx_variadic_templates)</tt> to determine if support +for variadic templates is enabled.</p> + +<h3 id="c11">C11</h3> + +<p>The features listed below are part of the C11 standard. As a result, all +these features are enabled with the <tt>-std=c11</tt> or <tt>-std=gnu11</tt> +option when compiling C code. Additionally, because these features are all +backward-compatible, they are available as extensions in all language modes.</p> + +<h4 id="c_alignas">C11 alignment specifiers</h4> + +<p>Use <tt>__has_feature(c_alignas)</tt> or <tt>__has_extension(c_alignas)</tt> +to determine if support for alignment specifiers using <tt>_Alignas</tt> +is enabled.</p> + +<h4 id="c_atomic">C11 atomic operations</h4> + +<p>Use <tt>__has_feature(c_atomic)</tt> or <tt>__has_extension(c_atomic)</tt> +to determine if support for atomic types using <tt>_Atomic</tt> is enabled. +Clang also provides <a href="#__c11_atomic">a set of builtins</a> which can be +used to implement the <tt><stdatomic.h></tt> operations on _Atomic +types.</p> + +<h4 id="c_generic_selections">C11 generic selections</h4> + +<p>Use <tt>__has_feature(c_generic_selections)</tt> or +<tt>__has_extension(c_generic_selections)</tt> to determine if support for +generic selections is enabled.</p> + +<p>As an extension, the C11 generic selection expression is available in all +languages supported by Clang. The syntax is the same as that given in the +C11 standard.</p> + +<p>In C, type compatibility is decided according to the rules given in the +appropriate standard, but in C++, which lacks the type compatibility rules +used in C, types are considered compatible only if they are equivalent.</p> + +<h4 id="c_static_assert">C11 <tt>_Static_assert()</tt></h4> + +<p>Use <tt>__has_feature(c_static_assert)</tt> or +<tt>__has_extension(c_static_assert)</tt> to determine if support for +compile-time assertions using <tt>_Static_assert</tt> is enabled.</p> + +<!-- ======================================================================= --> +<h2 id="checking_type_traits">Checks for Type Traits</h2> +<!-- ======================================================================= --> + +<p>Clang supports the <a href="http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html">GNU C++ type traits</a> and a subset of the <a href="http://msdn.microsoft.com/en-us/library/ms177194(v=VS.100).aspx">Microsoft Visual C++ Type traits</a>. For each supported type trait <code>__X</code>, <code>__has_extension(X)</code> indicates the presence of the type trait. For example: +<blockquote> +<pre> +#if __has_extension(is_convertible_to) +template<typename From, typename To> +struct is_convertible_to { + static const bool value = __is_convertible_to(From, To); +}; +#else +// Emulate type trait +#endif +</pre> +</blockquote> + +<p>The following type traits are supported by Clang:</p> +<ul> + <li><code>__has_nothrow_assign</code> (GNU, Microsoft)</li> + <li><code>__has_nothrow_copy</code> (GNU, Microsoft)</li> + <li><code>__has_nothrow_constructor</code> (GNU, Microsoft)</li> + <li><code>__has_trivial_assign</code> (GNU, Microsoft)</li> + <li><code>__has_trivial_copy</code> (GNU, Microsoft)</li> + <li><code>__has_trivial_constructor</code> (GNU, Microsoft)</li> + <li><code>__has_trivial_destructor</code> (GNU, Microsoft)</li> + <li><code>__has_virtual_destructor</code> (GNU, Microsoft)</li> + <li><code>__is_abstract</code> (GNU, Microsoft)</li> + <li><code>__is_base_of</code> (GNU, Microsoft)</li> + <li><code>__is_class</code> (GNU, Microsoft)</li> + <li><code>__is_convertible_to</code> (Microsoft)</li> + <li><code>__is_empty</code> (GNU, Microsoft)</li> + <li><code>__is_enum</code> (GNU, Microsoft)</li> + <li><code>__is_pod</code> (GNU, Microsoft)</li> + <li><code>__is_polymorphic</code> (GNU, Microsoft)</li> + <li><code>__is_union</code> (GNU, Microsoft)</li> + <li><code>__is_literal(type)</code>: Determines whether the given type is a literal type</li> + <li><code>__is_final</code>: Determines whether the given type is declared with a <code>final</code> class-virt-specifier.</li> + <li><code>__underlying_type(type)</code>: Retrieves the underlying type for a given <code>enum</code> type. This trait is required to implement the C++11 standard library.</li> + <li><code>__is_trivially_assignable(totype, fromtype)</code>: Determines whether a value of type <tt>totype</tt> can be assigned to from a value of type <tt>fromtype</tt> such that no non-trivial functions are called as part of that assignment. This trait is required to implement the C++11 standard library.</li> + <li><code>__is_trivially_constructible(type, argtypes...)</code>: Determines whether a value of type <tt>type</tt> can be direct-initialized with arguments of types <tt>argtypes...</tt> such that no non-trivial functions are called as part of that initialization. This trait is required to implement the C++11 standard library.</li> +</ul> + +<!-- ======================================================================= --> +<h2 id="blocks">Blocks</h2> +<!-- ======================================================================= --> + +<p>The syntax and high level language feature description is in <a +href="BlockLanguageSpec.txt">BlockLanguageSpec.txt</a>. Implementation and ABI +details for the clang implementation are in <a +href="Block-ABI-Apple.txt">Block-ABI-Apple.txt</a>.</p> + + +<p>Query for this feature with __has_extension(blocks).</p> + +<!-- ======================================================================= --> +<h2 id="objc_features">Objective-C Features</h2> +<!-- ======================================================================= --> + +<h3 id="objc_instancetype">Related result types</h3> + +<p>According to Cocoa conventions, Objective-C methods with certain names ("init", "alloc", etc.) always return objects that are an instance of the receiving class's type. Such methods are said to have a "related result type", meaning that a message send to one of these methods will have the same static type as an instance of the receiver class. For example, given the following classes:</p> + +<blockquote> +<pre> +@interface NSObject ++ (id)alloc; +- (id)init; +@end + +@interface NSArray : NSObject +@end +</pre> +</blockquote> + +<p>and this common initialization pattern</p> + +<blockquote> +<pre> +NSArray *array = [[NSArray alloc] init]; +</pre> +</blockquote> + +<p>the type of the expression <code>[NSArray alloc]</code> is +<code>NSArray*</code> because <code>alloc</code> implicitly has a +related result type. Similarly, the type of the expression +<code>[[NSArray alloc] init]</code> is <code>NSArray*</code>, since +<code>init</code> has a related result type and its receiver is known +to have the type <code>NSArray *</code>. If neither <code>alloc</code> nor <code>init</code> had a related result type, the expressions would have had type <code>id</code>, as declared in the method signature.</p> + +<p>A method with a related result type can be declared by using the +type <tt>instancetype</tt> as its result type. <tt>instancetype</tt> +is a contextual keyword that is only permitted in the result type of +an Objective-C method, e.g.</p> + +<pre> +@interface A ++ (<b>instancetype</b>)constructAnA; +@end +</pre> + +<p>The related result type can also be inferred for some methods. +To determine whether a method has an inferred related result type, the first +word in the camel-case selector (e.g., "init" in "initWithObjects") is +considered, and the method will have a related result type if its return +type is compatible with the type of its class and if</p> + +<ul> + + <li>the first word is "alloc" or "new", and the method is a class + method, or</li> + + <li>the first word is "autorelease", "init", "retain", or "self", + and the method is an instance method.</li> + +</ul> + +<p>If a method with a related result type is overridden by a subclass +method, the subclass method must also return a type that is compatible +with the subclass type. For example:</p> + +<blockquote> +<pre> +@interface NSString : NSObject +- (NSUnrelated *)init; // incorrect usage: NSUnrelated is not NSString or a superclass of NSString +@end +</pre> +</blockquote> + +<p>Related result types only affect the type of a message send or +property access via the given method. In all other respects, a method +with a related result type is treated the same way as method that +returns <tt>id</tt>.</p> + +<p>Use <tt>__has_feature(objc_instancetype)</tt> to determine whether +the <tt>instancetype</tt> contextual keyword is available.</p> + +<!-- ======================================================================= --> +<h2 id="objc_arc">Automatic reference counting </h2> +<!-- ======================================================================= --> + +<p>Clang provides support for <a href="AutomaticReferenceCounting.html">automated reference counting</a> in Objective-C, which eliminates the need for manual retain/release/autorelease message sends. There are two feature macros associated with automatic reference counting: <code>__has_feature(objc_arc)</code> indicates the availability of automated reference counting in general, while <code>__has_feature(objc_arc_weak)</code> indicates that automated reference counting also includes support for <code>__weak</code> pointers to Objective-C objects.</p> + +<!-- ======================================================================= --> +<h2 id="objc_fixed_enum">Enumerations with a fixed underlying type</h2> +<!-- ======================================================================= --> + +<p>Clang provides support for C++11 enumerations with a fixed +underlying type within Objective-C. For example, one can write an +enumeration type as:</p> + +<pre> +typedef enum : unsigned char { Red, Green, Blue } Color; +</pre> + +<p>This specifies that the underlying type, which is used to store the +enumeration value, is <tt>unsigned char</tt>.</p> + +<p>Use <tt>__has_feature(objc_fixed_enum)</tt> to determine whether +support for fixed underlying types is available in Objective-C.</p> + +<!-- ======================================================================= --> +<h2 id="objc_lambdas">Interoperability with C++11 lambdas</h2> +<!-- ======================================================================= --> + +<p>Clang provides interoperability between C++11 lambdas and +blocks-based APIs, by permitting a lambda to be implicitly converted +to a block pointer with the corresponding signature. For example, +consider an API such as <code>NSArray</code>'s array-sorting +method:</p> + +<pre> - (NSArray *)sortedArrayUsingComparator:(NSComparator)cmptr; </pre> + +<p><code>NSComparator</code> is simply a typedef for the block pointer +<code>NSComparisonResult (^)(id, id)</code>, and parameters of this +type are generally provided with block literals as arguments. However, +one can also use a C++11 lambda so long as it provides the same +signature (in this case, accepting two parameters of type +<code>id</code> and returning an <code>NSComparisonResult</code>):</p> + +<pre> + NSArray *array = @[@"string 1", @"string 21", @"string 12", @"String 11", + @"String 02"]; + const NSStringCompareOptions comparisonOptions + = NSCaseInsensitiveSearch | NSNumericSearch | + NSWidthInsensitiveSearch | NSForcedOrderingSearch; + NSLocale *currentLocale = [NSLocale currentLocale]; + NSArray *sorted + = [array sortedArrayUsingComparator:<b>[=](id s1, id s2) -> NSComparisonResult { + NSRange string1Range = NSMakeRange(0, [s1 length]); + return [s1 compare:s2 options:comparisonOptions + range:string1Range locale:currentLocale]; + }</b>]; + NSLog(@"sorted: %@", sorted); +</pre> + +<p>This code relies on an implicit conversion from the type of the +lambda expression (an unnamed, local class type called the <i>closure +type</i>) to the corresponding block pointer type. The conversion +itself is expressed by a conversion operator in that closure type +that produces a block pointer with the same signature as the lambda +itself, e.g.,</p> + +<pre> + operator NSComparisonResult (^)(id, id)() const; +</pre> + +<p>This conversion function returns a new block that simply forwards +the two parameters to the lambda object (which it captures by copy), +then returns the result. The returned block is first copied (with +<tt>Block_copy</tt>) and then autoreleased. As an optimization, if a +lambda expression is immediately converted to a block pointer (as in +the first example, above), then the block is not copied and +autoreleased: rather, it is given the same lifetime as a block literal +written at that point in the program, which avoids the overhead of +copying a block to the heap in the common case.</p> + +<p>The conversion from a lambda to a block pointer is only available +in Objective-C++, and not in C++ with blocks, due to its use of +Objective-C memory management (autorelease).</p> + +<!-- ======================================================================= --> +<h2 id="object-literals-subscripting">Object Literals and Subscripting</h2> +<!-- ======================================================================= --> + +<p>Clang provides support for <a href="ObjectiveCLiterals.html">Object Literals and Subscripting</a> in Objective-C, which simplifies common Objective-C programming patterns, makes programs more concise, and improves the safety of container creation. There are several feature macros associated with object literals and subscripting: <code>__has_feature(objc_array_literals)</code> tests the availability of array literals; <code>__has_feature(objc_dictionary_literals)</code> tests the availability of dictionary literals; <code>__has_feature(objc_subscripting)</code> tests the availability of object subscripting.</p> + +<!-- ======================================================================= --> +<h2 id="overloading-in-c">Function Overloading in C</h2> +<!-- ======================================================================= --> + +<p>Clang provides support for C++ function overloading in C. Function +overloading in C is introduced using the <tt>overloadable</tt> attribute. For +example, one might provide several overloaded versions of a <tt>tgsin</tt> +function that invokes the appropriate standard function computing the sine of a +value with <tt>float</tt>, <tt>double</tt>, or <tt>long double</tt> +precision:</p> + +<blockquote> +<pre> +#include <math.h> +float <b>__attribute__((overloadable))</b> tgsin(float x) { return sinf(x); } +double <b>__attribute__((overloadable))</b> tgsin(double x) { return sin(x); } +long double <b>__attribute__((overloadable))</b> tgsin(long double x) { return sinl(x); } +</pre> +</blockquote> + +<p>Given these declarations, one can call <tt>tgsin</tt> with a +<tt>float</tt> value to receive a <tt>float</tt> result, with a +<tt>double</tt> to receive a <tt>double</tt> result, etc. Function +overloading in C follows the rules of C++ function overloading to pick +the best overload given the call arguments, with a few C-specific +semantics:</p> +<ul> + <li>Conversion from <tt>float</tt> or <tt>double</tt> to <tt>long + double</tt> is ranked as a floating-point promotion (per C99) rather + than as a floating-point conversion (as in C++).</li> + + <li>A conversion from a pointer of type <tt>T*</tt> to a pointer of type + <tt>U*</tt> is considered a pointer conversion (with conversion + rank) if <tt>T</tt> and <tt>U</tt> are compatible types.</li> + + <li>A conversion from type <tt>T</tt> to a value of type <tt>U</tt> + is permitted if <tt>T</tt> and <tt>U</tt> are compatible types. This + conversion is given "conversion" rank.</li> +</ul> + +<p>The declaration of <tt>overloadable</tt> functions is restricted to +function declarations and definitions. Most importantly, if any +function with a given name is given the <tt>overloadable</tt> +attribute, then all function declarations and definitions with that +name (and in that scope) must have the <tt>overloadable</tt> +attribute. This rule even applies to redeclarations of functions whose original +declaration had the <tt>overloadable</tt> attribute, e.g.,</p> + +<blockquote> +<pre> +int f(int) __attribute__((overloadable)); +float f(float); <i>// error: declaration of "f" must have the "overloadable" attribute</i> + +int g(int) __attribute__((overloadable)); +int g(int) { } <i>// error: redeclaration of "g" must also have the "overloadable" attribute</i> +</pre> +</blockquote> + +<p>Functions marked <tt>overloadable</tt> must have +prototypes. Therefore, the following code is ill-formed:</p> + +<blockquote> +<pre> +int h() __attribute__((overloadable)); <i>// error: h does not have a prototype</i> +</pre> +</blockquote> + +<p>However, <tt>overloadable</tt> functions are allowed to use a +ellipsis even if there are no named parameters (as is permitted in C++). This feature is particularly useful when combined with the <tt>unavailable</tt> attribute:</p> + +<blockquote> +<pre> +void honeypot(...) __attribute__((overloadable, unavailable)); <i>// calling me is an error</i> +</pre> +</blockquote> + +<p>Functions declared with the <tt>overloadable</tt> attribute have +their names mangled according to the same rules as C++ function +names. For example, the three <tt>tgsin</tt> functions in our +motivating example get the mangled names <tt>_Z5tgsinf</tt>, +<tt>_Z5tgsind</tt>, and <tt>_Z5tgsine</tt>, respectively. There are two +caveats to this use of name mangling:</p> + +<ul> + + <li>Future versions of Clang may change the name mangling of + functions overloaded in C, so you should not depend on an specific + mangling. To be completely safe, we strongly urge the use of + <tt>static inline</tt> with <tt>overloadable</tt> functions.</li> + + <li>The <tt>overloadable</tt> attribute has almost no meaning when + used in C++, because names will already be mangled and functions are + already overloadable. However, when an <tt>overloadable</tt> + function occurs within an <tt>extern "C"</tt> linkage specification, + it's name <i>will</i> be mangled in the same way as it would in + C.</li> +</ul> + +<p>Query for this feature with __has_extension(attribute_overloadable).</p> + +<!-- ======================================================================= --> +<h2 id="complex-list-init">Initializer lists for complex numbers in C</h2> +<!-- ======================================================================= --> + +<p>clang supports an extension which allows the following in C:</p> + +<blockquote> +<pre> +#include <math.h> +#include <complex.h> +complex float x = { 1.0f, INFINITY }; // Init to (1, Inf) +</pre> +</blockquote> + +<p>This construct is useful because there is no way to separately +initialize the real and imaginary parts of a complex variable in +standard C, given that clang does not support <code>_Imaginary</code>. +(clang also supports the <code>__real__</code> and <code>__imag__</code> +extensions from gcc, which help in some cases, but are not usable in +static initializers.) + +<p>Note that this extension does not allow eliding the braces; the +meaning of the following two lines is different:</p> + +<blockquote> +<pre> +complex float x[] = { { 1.0f, 1.0f } }; // [0] = (1, 1) +complex float x[] = { 1.0f, 1.0f }; // [0] = (1, 0), [1] = (1, 0) +</pre> +</blockquote> + +<p>This extension also works in C++ mode, as far as that goes, but does not + apply to the C++ <code>std::complex</code>. (In C++11, list + initialization allows the same syntax to be used with + <code>std::complex</code> with the same meaning.) + +<!-- ======================================================================= --> +<h2 id="builtins">Builtin Functions</h2> +<!-- ======================================================================= --> + +<p>Clang supports a number of builtin library functions with the same syntax as +GCC, including things like <tt>__builtin_nan</tt>, +<tt>__builtin_constant_p</tt>, <tt>__builtin_choose_expr</tt>, +<tt>__builtin_types_compatible_p</tt>, <tt>__sync_fetch_and_add</tt>, etc. In +addition to the GCC builtins, Clang supports a number of builtins that GCC does +not, which are listed here.</p> + +<p>Please note that Clang does not and will not support all of the GCC builtins +for vector operations. Instead of using builtins, you should use the functions +defined in target-specific header files like <tt><xmmintrin.h></tt>, which +define portable wrappers for these. Many of the Clang versions of these +functions are implemented directly in terms of <a href="#vectors">extended +vector support</a> instead of builtins, in order to reduce the number of +builtins that we need to implement.</p> + +<!-- ======================================================================= --> +<h3><a name="__builtin_shufflevector">__builtin_shufflevector</a></h3> +<!-- ======================================================================= --> + +<p><tt>__builtin_shufflevector</tt> is used to express generic vector +permutation/shuffle/swizzle operations. This builtin is also very important for +the implementation of various target-specific header files like +<tt><xmmintrin.h></tt>. +</p> + +<p><b>Syntax:</b></p> + +<pre> +__builtin_shufflevector(vec1, vec2, index1, index2, ...) +</pre> + +<p><b>Examples:</b></p> + +<pre> + // Identity operation - return 4-element vector V1. + __builtin_shufflevector(V1, V1, 0, 1, 2, 3) + + // "Splat" element 0 of V1 into a 4-element result. + __builtin_shufflevector(V1, V1, 0, 0, 0, 0) + + // Reverse 4-element vector V1. + __builtin_shufflevector(V1, V1, 3, 2, 1, 0) + + // Concatenate every other element of 4-element vectors V1 and V2. + __builtin_shufflevector(V1, V2, 0, 2, 4, 6) + + // Concatenate every other element of 8-element vectors V1 and V2. + __builtin_shufflevector(V1, V2, 0, 2, 4, 6, 8, 10, 12, 14) +</pre> + +<p><b>Description:</b></p> + +<p>The first two arguments to __builtin_shufflevector are vectors that have the +same element type. The remaining arguments are a list of integers that specify +the elements indices of the first two vectors that should be extracted and +returned in a new vector. These element indices are numbered sequentially +starting with the first vector, continuing into the second vector. Thus, if +vec1 is a 4-element vector, index 5 would refer to the second element of vec2. +</p> + +<p>The result of __builtin_shufflevector is a vector +with the same element type as vec1/vec2 but that has an element count equal to +the number of indices specified. +</p> + +<p>Query for this feature with __has_builtin(__builtin_shufflevector).</p> + +<!-- ======================================================================= --> +<h3><a name="__builtin_unreachable">__builtin_unreachable</a></h3> +<!-- ======================================================================= --> + +<p><tt>__builtin_unreachable</tt> is used to indicate that a specific point in +the program cannot be reached, even if the compiler might otherwise think it +can. This is useful to improve optimization and eliminates certain warnings. +For example, without the <tt>__builtin_unreachable</tt> in the example below, +the compiler assumes that the inline asm can fall through and prints a "function +declared 'noreturn' should not return" warning. +</p> + +<p><b>Syntax:</b></p> + +<pre> +__builtin_unreachable() +</pre> + +<p><b>Example of Use:</b></p> + +<pre> +void myabort(void) __attribute__((noreturn)); +void myabort(void) { + asm("int3"); + __builtin_unreachable(); +} +</pre> + +<p><b>Description:</b></p> + +<p>The __builtin_unreachable() builtin has completely undefined behavior. Since +it has undefined behavior, it is a statement that it is never reached and the +optimizer can take advantage of this to produce better code. This builtin takes +no arguments and produces a void result. +</p> + +<p>Query for this feature with __has_builtin(__builtin_unreachable).</p> + +<!-- ======================================================================= --> +<h3><a name="__sync_swap">__sync_swap</a></h3> +<!-- ======================================================================= --> + +<p><tt>__sync_swap</tt> is used to atomically swap integers or pointers in +memory. +</p> + +<p><b>Syntax:</b></p> + +<pre> +<i>type</i> __sync_swap(<i>type</i> *ptr, <i>type</i> value, ...) +</pre> + +<p><b>Example of Use:</b></p> + +<pre> +int old_value = __sync_swap(&value, new_value); +</pre> + +<p><b>Description:</b></p> + +<p>The __sync_swap() builtin extends the existing __sync_*() family of atomic +intrinsics to allow code to atomically swap the current value with the new +value. More importantly, it helps developers write more efficient and correct +code by avoiding expensive loops around __sync_bool_compare_and_swap() or +relying on the platform specific implementation details of +__sync_lock_test_and_set(). The __sync_swap() builtin is a full barrier. +</p> + +<!-- ======================================================================= --> +<h3><a name="__c11_atomic">__c11_atomic builtins</a></h3> +<!-- ======================================================================= --> + +<p>Clang provides a set of builtins which are intended to be used to implement +C11's <tt><stdatomic.h></tt> header. These builtins provide the semantics +of the <tt>_explicit</tt> form of the corresponding C11 operation, and are named +with a <tt>__c11_</tt> prefix. The supported operations are:</p> + +<ul> + <li><tt>__c11_atomic_init</tt></li> + <li><tt>__c11_atomic_thread_fence</tt></li> + <li><tt>__c11_atomic_signal_fence</tt></li> + <li><tt>__c11_atomic_is_lock_free</tt></li> + <li><tt>__c11_atomic_store</tt></li> + <li><tt>__c11_atomic_load</tt></li> + <li><tt>__c11_atomic_exchange</tt></li> + <li><tt>__c11_atomic_compare_exchange_strong</tt></li> + <li><tt>__c11_atomic_compare_exchange_weak</tt></li> + <li><tt>__c11_atomic_fetch_add</tt></li> + <li><tt>__c11_atomic_fetch_sub</tt></li> + <li><tt>__c11_atomic_fetch_and</tt></li> + <li><tt>__c11_atomic_fetch_or</tt></li> + <li><tt>__c11_atomic_fetch_xor</tt></li> +</ul> + + +<!-- ======================================================================= --> +<h2 id="targetspecific">Target-Specific Extensions</h2> +<!-- ======================================================================= --> + +<p>Clang supports some language features conditionally on some targets.</p> + +<!-- ======================================================================= --> +<h3 id="x86-specific">X86/X86-64 Language Extensions</h3> +<!-- ======================================================================= --> + +<p>The X86 backend has these language extensions:</p> + +<!-- ======================================================================= --> +<h4 id="x86-gs-segment">Memory references off the GS segment</h4> +<!-- ======================================================================= --> + +<p>Annotating a pointer with address space #256 causes it to be code generated +relative to the X86 GS segment register, and address space #257 causes it to be +relative to the X86 FS segment. Note that this is a very very low-level +feature that should only be used if you know what you're doing (for example in +an OS kernel).</p> + +<p>Here is an example:</p> + +<pre> +#define GS_RELATIVE __attribute__((address_space(256))) +int foo(int GS_RELATIVE *P) { + return *P; +} +</pre> + +<p>Which compiles to (on X86-32):</p> + +<pre> +_foo: + movl 4(%esp), %eax + movl %gs:(%eax), %eax + ret +</pre> + +<!-- ======================================================================= --> +<h2 id="analyzerspecific">Static Analysis-Specific Extensions</h2> +<!-- ======================================================================= --> + +<p>Clang supports additional attributes that are useful for documenting program +invariants and rules for static analysis tools. The extensions documented here +are used by the <a +href="http://clang.llvm.org/StaticAnalysis.html">path-sensitive static analyzer +engine</a> that is part of Clang's Analysis library.</p> + +<h3 id="attr_analyzer_noreturn">The <tt>analyzer_noreturn</tt> attribute</h3> + +<p>Clang's static analysis engine understands the standard <tt>noreturn</tt> +attribute. This attribute, which is typically affixed to a function prototype, +indicates that a call to a given function never returns. Function prototypes for +common functions like <tt>exit</tt> are typically annotated with this attribute, +as well as a variety of common assertion handlers. Users can educate the static +analyzer about their own custom assertion handles (thus cutting down on false +positives due to false paths) by marking their own "panic" functions +with this attribute.</p> + +<p>While useful, <tt>noreturn</tt> is not applicable in all cases. Sometimes +there are special functions that for all intents and purposes should be +considered panic functions (i.e., they are only called when an internal program +error occurs) but may actually return so that the program can fail gracefully. +The <tt>analyzer_noreturn</tt> attribute allows one to annotate such functions +as being interpreted as "no return" functions by the analyzer (thus +pruning bogus paths) but will not affect compilation (as in the case of +<tt>noreturn</tt>).</p> + +<p><b>Usage</b>: The <tt>analyzer_noreturn</tt> attribute can be placed in the +same places where the <tt>noreturn</tt> attribute can be placed. It is commonly +placed at the end of function prototypes:</p> + +<pre> + void foo() <b>__attribute__((analyzer_noreturn))</b>; +</pre> + +<p>Query for this feature with +<tt>__has_attribute(analyzer_noreturn)</tt>.</p> + +<h3 id="attr_method_family">The <tt>objc_method_family</tt> attribute</h3> + +<p>Many methods in Objective-C have conventional meanings determined +by their selectors. For the purposes of static analysis, it is +sometimes useful to be able to mark a method as having a particular +conventional meaning despite not having the right selector, or as not +having the conventional meaning that its selector would suggest. +For these use cases, we provide an attribute to specifically describe +the <q>method family</q> that a method belongs to.</p> + +<p><b>Usage</b>: <tt>__attribute__((objc_method_family(X)))</tt>, +where <tt>X</tt> is one of <tt>none</tt>, <tt>alloc</tt>, <tt>copy</tt>, +<tt>init</tt>, <tt>mutableCopy</tt>, or <tt>new</tt>. This attribute +can only be placed at the end of a method declaration:</p> + +<pre> + - (NSString*) initMyStringValue <b>__attribute__((objc_method_family(none)))</b>; +</pre> + +<p>Users who do not wish to change the conventional meaning of a +method, and who merely want to document its non-standard retain and +release semantics, should use the +<a href="#attr_retain_release">retaining behavior attributes</a> +described below.</p> + +<p>Query for this feature with +<tt>__has_attribute(objc_method_family)</tt>.</p> + +<h3 id="attr_retain_release">Objective-C retaining behavior attributes</h3> + +<p>In Objective-C, functions and methods are generally assumed to take +and return objects with +0 retain counts, with some exceptions for +special methods like <tt>+alloc</tt> and <tt>init</tt>. However, +there are exceptions, and so Clang provides attributes to allow these +exceptions to be documented, which helps the analyzer find leaks (and +ignore non-leaks). Some exceptions may be better described using +the <a href="#attr_method_family"><tt>objc_method_family</tt></a> +attribute instead.</p> + +<p><b>Usage</b>: The <tt>ns_returns_retained</tt>, <tt>ns_returns_not_retained</tt>, +<tt>ns_returns_autoreleased</tt>, <tt>cf_returns_retained</tt>, +and <tt>cf_returns_not_retained</tt> attributes can be placed on +methods and functions that return Objective-C or CoreFoundation +objects. They are commonly placed at the end of a function prototype +or method declaration:</p> + +<pre> + id foo() <b>__attribute__((ns_returns_retained))</b>; + + - (NSString*) bar: (int) x <b>__attribute__((ns_returns_retained))</b>; +</pre> + +<p>The <tt>*_returns_retained</tt> attributes specify that the +returned object has a +1 retain count. +The <tt>*_returns_not_retained</tt> attributes specify that the return +object has a +0 retain count, even if the normal convention for its +selector would be +1. <tt>ns_returns_autoreleased</tt> specifies that the +returned object is +0, but is guaranteed to live at least as long as the +next flush of an autorelease pool.</p> + +<p><b>Usage</b>: The <tt>ns_consumed</tt> and <tt>cf_consumed</tt> +attributes can be placed on an parameter declaration; they specify +that the argument is expected to have a +1 retain count, which will be +balanced in some way by the function or method. +The <tt>ns_consumes_self</tt> attribute can only be placed on an +Objective-C method; it specifies that the method expects +its <tt>self</tt> parameter to have a +1 retain count, which it will +balance in some way.</p> + +<pre> + void <b>foo(__attribute__((ns_consumed))</b> NSString *string); + + - (void) bar <b>__attribute__((ns_consumes_self))</b>; + - (void) baz: (id) <b>__attribute__((ns_consumed))</b> x; +</pre> + +<p>Query for these features with <tt>__has_attribute(ns_consumed)</tt>, +<tt>__has_attribute(ns_returns_retained)</tt>, etc.</p> + +<!-- ======================================================================= --> +<h2 id="dynamicanalyzerspecific">Dynamic Analysis-Specific Extensions</h2> +<!-- ======================================================================= --> +<h3 id="address_sanitizer">AddressSanitizer</h3> +<p> Use <code>__has_feature(address_sanitizer)</code> +to check if the code is being built with <a + href="AddressSanitizer.html">AddressSanitizer</a>. +</p> +<p>Use <tt>__attribute__((no_address_safety_analysis))</tt> on a function +declaration to specify that address safety instrumentation (e.g. +AddressSanitizer) should not be applied to that function. +</p> + +<!-- ======================================================================= --> +<h2 id="threadsafety">Thread-Safety Annotation Checking</h2> +<!-- ======================================================================= --> + +<p>Clang supports additional attributes for checking basic locking policies in +multithreaded programs. +Clang currently parses the following list of attributes, although +<b>the implementation for these annotations is currently in development.</b> +For more details, see the +<a href="http://gcc.gnu.org/wiki/ThreadSafetyAnnotation">GCC implementation</a>. +</p> + +<h4 id="ts_noanal">no_thread_safety_analysis</h4> + +<p>Use <tt>__attribute__((no_thread_safety_analysis))</tt> on a function +declaration to specify that the thread safety analysis should not be run on that +function. This attribute provides an escape hatch (e.g. for situations when it +is difficult to annotate the locking policy). </p> + +<h4 id="ts_lockable">lockable</h4> + +<p>Use <tt>__attribute__((lockable))</tt> on a class definition to specify +that it has a lockable type (e.g. a Mutex class). This annotation is primarily +used to check consistency.</p> + +<h4 id="ts_scopedlockable">scoped_lockable</h4> + +<p>Use <tt>__attribute__((scoped_lockable))</tt> on a class definition to +specify that it has a "scoped" lockable type. Objects of this type will acquire +the lock upon construction and release it upon going out of scope. + This annotation is primarily used to check +consistency.</p> + +<h4 id="ts_guardedvar">guarded_var</h4> + +<p>Use <tt>__attribute__((guarded_var))</tt> on a variable declaration to +specify that the variable must be accessed while holding some lock.</p> + +<h4 id="ts_ptguardedvar">pt_guarded_var</h4> + +<p>Use <tt>__attribute__((pt_guarded_var))</tt> on a pointer declaration to +specify that the pointer must be dereferenced while holding some lock.</p> + +<h4 id="ts_guardedby">guarded_by(l)</h4> + +<p>Use <tt>__attribute__((guarded_by(l)))</tt> on a variable declaration to +specify that the variable must be accessed while holding lock <tt>l</tt>.</p> + +<h4 id="ts_ptguardedby">pt_guarded_by(l)</h4> + +<p>Use <tt>__attribute__((pt_guarded_by(l)))</tt> on a pointer declaration to +specify that the pointer must be dereferenced while holding lock <tt>l</tt>.</p> + +<h4 id="ts_acquiredbefore">acquired_before(...)</h4> + +<p>Use <tt>__attribute__((acquired_before(...)))</tt> on a declaration +of a lockable variable to specify that the lock must be acquired before all +attribute arguments. Arguments must be lockable type, and there must be at +least one argument.</p> + +<h4 id="ts_acquiredafter">acquired_after(...)</h4> + +<p>Use <tt>__attribute__((acquired_after(...)))</tt> on a declaration +of a lockable variable to specify that the lock must be acquired after all +attribute arguments. Arguments must be lockable type, and there must be at +least one argument.</p> + +<h4 id="ts_elf">exclusive_lock_function(...)</h4> + +<p>Use <tt>__attribute__((exclusive_lock_function(...)))</tt> on a function +declaration to specify that the function acquires all listed locks +exclusively. This attribute takes zero or more arguments: either of lockable +type or integers indexing into function parameters of lockable type. If no +arguments are given, the acquired lock is implicitly <tt>this</tt> of the +enclosing object.</p> + +<h4 id="ts_slf">shared_lock_function(...)</h4> + +<p>Use <tt>__attribute__((shared_lock_function(...)))</tt> on a function +declaration to specify that the function acquires all listed locks, although + the locks may be shared (e.g. read locks). This attribute takes zero or more +arguments: either of lockable type or integers indexing into function +parameters of lockable type. If no arguments are given, the acquired lock is +implicitly <tt>this</tt> of the enclosing object.</p> + +<h4 id="ts_etf">exclusive_trylock_function(...)</h4> + +<p>Use <tt>__attribute__((exclusive_lock_function(...)))</tt> on a function +declaration to specify that the function will try (without blocking) to acquire +all listed locks exclusively. This attribute takes one or more arguments. The +first argument is an integer or boolean value specifying the return value of a +successful lock acquisition. The remaining arugments are either of lockable type +or integers indexing into function parameters of lockable type. If only one +argument is given, the acquired lock is implicitly <tt>this</tt> of the +enclosing object.</p> + +<h4 id="ts_stf">shared_trylock_function(...)</h4> + +<p>Use <tt>__attribute__((shared_lock_function(...)))</tt> on a function +declaration to specify that the function will try (without blocking) to acquire +all listed locks, although the locks may be shared (e.g. read locks). This +attribute takes one or more arguments. The first argument is an integer or +boolean value specifying the return value of a successful lock acquisition. The +remaining arugments are either of lockable type or integers indexing into +function parameters of lockable type. If only one argument is given, the +acquired lock is implicitly <tt>this</tt> of the enclosing object.</p> + +<h4 id="ts_uf">unlock_function(...)</h4> + +<p>Use <tt>__attribute__((unlock_function(...)))</tt> on a function +declaration to specify that the function release all listed locks. This +attribute takes zero or more arguments: either of lockable type or integers +indexing into function parameters of lockable type. If no arguments are given, +the acquired lock is implicitly <tt>this</tt> of the enclosing object.</p> + +<h4 id="ts_lr">lock_returned(l)</h4> + +<p>Use <tt>__attribute__((lock_returned(l)))</tt> on a function +declaration to specify that the function returns lock <tt>l</tt> (<tt>l</tt> +must be of lockable type). This annotation is used to aid in resolving lock +expressions.</p> + +<h4 id="ts_le">locks_excluded(...)</h4> + +<p>Use <tt>__attribute__((locks_excluded(...)))</tt> on a function declaration +to specify that the function must not be called with the listed locks. Arguments +must be lockable type, and there must be at least one argument.</p> + +<h4 id="ts_elr">exclusive_locks_required(...)</h4> + +<p>Use <tt>__attribute__((exclusive_locks_required(...)))</tt> on a function +declaration to specify that the function must be called while holding the listed +exclusive locks. Arguments must be lockable type, and there must be at +least one argument.</p> + +<h4 id="ts_slr">shared_locks_required(...)</h4> + +<p>Use <tt>__attribute__((shared_locks_required(...)))</tt> on a function +declaration to specify that the function must be called while holding the listed +shared locks. Arguments must be lockable type, and there must be at +least one argument.</p> + +</div> +</body> +</html> diff --git a/clang/docs/Makefile b/clang/docs/Makefile new file mode 100644 index 0000000..2608046 --- /dev/null +++ b/clang/docs/Makefile @@ -0,0 +1,97 @@ +##===- docs/Makefile ---------------------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +CLANG_LEVEL := .. +DIRS := tools + +ifdef BUILD_FOR_WEBSITE +PROJ_OBJ_DIR = . +DOXYGEN = doxygen + +$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in + cat $< | sed \ + -e 's/@abs_srcdir@/./g' \ + -e 's/@DOT@/dot/g' \ + -e 's/@PACKAGE_VERSION@/mainline/' \ + -e 's/@abs_builddir@/./g' > $@ +endif + +include $(CLANG_LEVEL)/Makefile + +HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \ + $(wildcard $(PROJ_SRC_DIR)/*.css) +#IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*) +DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \ + doxygen.intro +EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img + +.PHONY: install-html install-doxygen doxygen generated + +install_targets := +ifndef ONLY_MAN_DOCS +install_targets += install-html +endif +ifeq ($(ENABLE_DOXYGEN),1) +install_targets += install-doxygen +endif +install-local:: $(install_targets) + +# Live documentation is generated for the web site using this target: +# 'make generated BUILD_FOR_WEBSITE=1' +generated:: doxygen + +install-html: $(PROJ_OBJ_DIR)/html.tar.gz + $(Echo) Installing HTML documentation + $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html + $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img + $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html +# $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img + $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir) + +$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) + $(Echo) Packaging HTML documentation + $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar + $(Verb) cd $(PROJ_SRC_DIR) && \ + $(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html + $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/html.tar + +install-doxygen: doxygen + $(Echo) Installing doxygen documentation + $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen + $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir) + $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \ + $(FIND) . -type f -exec \ + $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \; + +doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz + +regendoc: + $(Echo) Building doxygen documentation + $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \ + $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \ + fi + $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg + +$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg + $(Echo) Packaging doxygen documentation + $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar + $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen + $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/doxygen.tar + $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/ + +userloc: $(LLVM_SRC_ROOT)/docs/userloc.html + +$(LLVM_SRC_ROOT)/docs/userloc.html: + $(Echo) Making User LOC Table + $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \ + -html lib include tools runtime utils examples autoconf test > docs/userloc.html + +uninstall-local:: + $(Echo) Uninstalling Documentation + $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir) diff --git a/clang/docs/ObjectiveCLiterals.html b/clang/docs/ObjectiveCLiterals.html new file mode 100644 index 0000000..63b523c --- /dev/null +++ b/clang/docs/ObjectiveCLiterals.html @@ -0,0 +1,314 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ --> +<html> +<head> + <META http-equiv="Content-Type" content="text/html; charset=UTF8"> + <title>Clang Language Extensions</title> + <link type="text/css" rel="stylesheet" href="../menu.css"> + <link type="text/css" rel="stylesheet" href="../content.css"> + <style type="text/css"> + td { + vertical-align: top; + } + th { background-color: #ffddaa; } + </style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>Objective-C Literals</h1> + +<h2>Introduction</h2> + +Three new features were introduced into clang at the same time: <i>NSNumber Literals</i> provide a syntax for creating <code>NSNumber</code> from scalar literal expressions; <i>Collection Literals</i> provide a short-hand for creating arrays and dictionaries; <i>Object Subscripting</i> provides a way to use subscripting with Objective-C objects. Users of Apple compiler releases can use these features starting with the Apple LLVM Compiler 4.0. Users of open-source LLVM.org compiler releases can use these features starting with clang v3.1.<p> + +These language additions simplify common Objective-C programming patterns, make programs more concise, and improve the safety of container creation.<p> + +This document describes how the features are implemented in clang, and how to use them in your own programs.<p> + +<h2>NSNumber Literals</h2> + +The framework class <code>NSNumber</code> is used to wrap scalar values inside objects: signed and unsigned integers (<code>char</code>, <code>short</code>, <code>int</code>, <code>long</code>, <code>long long</code>), floating point numbers (<code>float</code>, <code>double</code>), and boolean values (<code>BOOL</code>, C++ <code>bool</code>). Scalar values wrapped in objects are also known as <i>boxed</i> values.<p> + +In Objective-C, any character, numeric or boolean literal prefixed with the <code>'@'</code> character will evaluate to a pointer to an <code>NSNumber</code> object initialized with that value. C's type suffixes may be used to control the size of numeric literals. + +<h3>Examples</h3> + +The following program illustrates the rules for <code>NSNumber</code> literals:<p> + +<pre> +void main(int argc, const char *argv[]) { + // character literals. + NSNumber *theLetterZ = @'Z'; // equivalent to [NSNumber numberWithChar:'Z'] + + // integral literals. + NSNumber *fortyTwo = @42; // equivalent to [NSNumber numberWithInt:42] + NSNumber *fortyTwoUnsigned = @42U; // equivalent to [NSNumber numberWithUnsignedInt:42U] + NSNumber *fortyTwoLong = @42L; // equivalent to [NSNumber numberWithLong:42L] + NSNumber *fortyTwoLongLong = @42LL; // equivalent to [NSNumber numberWithLongLong:42LL] + + // floating point literals. + NSNumber *piFloat = @3.141592654F; // equivalent to [NSNumber numberWithFloat:3.141592654F] + NSNumber *piDouble = @3.1415926535; // equivalent to [NSNumber numberWithDouble:3.1415926535] + + // BOOL literals. + NSNumber *yesNumber = @YES; // equivalent to [NSNumber numberWithBool:YES] + NSNumber *noNumber = @NO; // equivalent to [NSNumber numberWithBool:NO] + +#ifdef __cplusplus + NSNumber *trueNumber = @true; // equivalent to [NSNumber numberWithBool:(BOOL)true] + NSNumber *falseNumber = @false; // equivalent to [NSNumber numberWithBool:(BOOL)false] +#endif +} +</pre> + +<h3>Discussion</h3> + +NSNumber literals only support literal scalar values after the '@'. Consequently, @INT_MAX works, but @INT_MIN does not, because they are defined like this:<p> + +<pre> +#define INT_MAX 2147483647 /* max value for an int */ +#define INT_MIN (-2147483647-1) /* min value for an int */ +</pre> + +The definition of INT_MIN is not a simple literal, but a parenthesized expression. This is by design, but may be improved in subsequent compiler releases.<p> + +Because <code>NSNumber</code> does not currently support wrapping <code>long double</code> values, the use of a <code>long double NSNumber</code> literal (e.g. <code>@123.23L</code>) will be rejected by the compiler.<p> + +Previously, the <code>BOOL</code> type was simply a typedef for <code>signed char</code>, and <code>YES</code> and <code>NO</code> were macros that expand to <code>(BOOL)1</code> and <code>(BOOL)0</code> respectively. To support <code>@YES</code> and <code>@NO</code> expressions, these macros are now defined using new language keywords in <code><objc/objc.h></code>:<p> + +<pre> +#if __has_feature(objc_bool) +#define YES __objc_yes +#define NO __objc_no +#else +#define YES ((BOOL)1) +#define NO ((BOOL)0) +#endif +</pre> + +The compiler implicitly converts <code>__objc_yes</code> and <code>__objc_no</code> to <code>(BOOL)1</code> and <code>(BOOL)0</code>. The keywords are used to disambiguate <code>BOOL</code> and integer literals.<p> + +Objective-C++ also supports <code>@true</code> and <code>@false</code> expressions, which are equivalent to <code>@YES</code> and <code>@NO</code>. + + +<h2>Container Literals</h2> + +Objective-C now supports a new expression syntax for creating immutable array and dictionary container objects. + +<h3>Examples</h3> + +Immutable array expression:<p> + + <pre> +NSArray *array = @[ @"Hello", NSApp, [NSNumber numberWithInt:42] ]; +</pre> + +This creates an <code>NSArray</code> with 3 elements. The comma-separated sub-expressions of an array literal can be any Objective-C object pointer typed expression.<p> + +Immutable dictionary expression:<p> + +<pre> +NSDictionary *dictionary = @{ + @"name" : NSUserName(), + @"date" : [NSDate date], + @"processInfo" : [NSProcessInfo processInfo] +}; +</pre> + +This creates an <code>NSDictionary</code> with 3 key/value pairs. Value sub-expressions of a dictionary literal must be Objective-C object pointer typed, as in array literals. Key sub-expressions must be of an Objective-C object pointer type that implements the <code><NSCopying></code> protocol.<p> + +<h3>Discussion</h3> + +Neither keys nor values can have the value <code>nil</code> in containers. If the compiler can prove that a key or value is <code>nil</code> at compile time, then a warning will be emitted. Otherwise, a runtime error will occur.<p> + +Using array and dictionary literals is safer than the variadic creation forms commonly in use today. Array literal expressions expand to calls to <code>+[NSArray arrayWithObjects:count:]</code>, which validates that all objects are non-<code>nil</code>. The variadic form, <code>+[NSArray arrayWithObjects:]</code> uses <code>nil</code> as an argument list terminator, which can lead to malformed array objects. Dictionary literals are similarly created with <code>+[NSDictionary dictionaryWithObjects:forKeys:count:]</code> which validates all objects and keys, unlike <code>+[NSDictionary dictionaryWithObjectsAndKeys:]</code> which also uses a <code>nil</code> parameter as an argument list terminator.<p> + +<h2>Object Subscripting</h2> + +Objective-C object pointer values can now be used with C's subscripting operator.<p> + +<h3>Examples</h3> + +The following code demonstrates the use of object subscripting syntax with <code>NSMutableArray</code> and <code>NSMutableDictionary</code> objects:<p> + +<pre> +NSMutableArray *array = ...; +NSUInteger idx = ...; +id newObject = ...; +id oldObject = array[idx]; +array[idx] = newObject; // replace oldObject with newObject + +NSMutableDictionary *dictionary = ...; +NSString *key = ...; +oldObject = dictionary[key]; +dictionary[key] = newObject; // replace oldObject with newObject +</pre> + +The next section explains how subscripting expressions map to accessor methods.<p> + +<h3>Subscripting Methods</h3> + +Objective-C supports two kinds of subscript expressions: <i>array-style</i> subscript expressions use integer typed subscripts; <i>dictionary-style</i> subscript expressions use Objective-C object pointer typed subscripts. Each type of subscript expression is mapped to a message send using a predefined selector. The advantage of this design is flexibility: class designers are free to introduce subscripting by declaring methods or by adopting protocols. Moreover, because the method names are selected by the type of the subscript, an object can be subscripted using both array and dictionary styles. + +<h4>Array-Style Subscripting</h4> + +When the subscript operand has an integral type, the expression is rewritten to use one of two different selectors, depending on whether the element is being read or written. When an expression reads an element using an integral index, as in the following example:<p> + +<pre> +NSUInteger idx = ...; +id value = object[idx]; +</pre> + +it is translated into a call to <code>objectAtIndexedSubscript:</code><p> + +<pre> +id value = [object objectAtIndexedSubscript:idx]; +</pre> + +When an expression writes an element using an integral index:<p> + +<pre> +object[idx] = newValue; +</pre> + +it is translated to a call to <code>setObject:atIndexedSubscript:</code><p> + +<pre> +[object setObject:newValue atIndexedSubscript:idx]; +</pre> + +These message sends are then type-checked and performed just like explicit message sends. The method used for objectAtIndexedSubscript: must be declared with an argument of integral type and a return value of some Objective-C object pointer type. The method used for setObject:atIndexedSubscript: must be declared with its first argument having some Objective-C pointer type and its second argument having integral type.<p> + +The meaning of indexes is left up to the declaring class. The compiler will coerce the index to the appropriate argument type of the method it uses for type-checking. For an instance of <code>NSArray</code>, reading an element using an index outside the range <code>[0, array.count)</code> will raise an exception. For an instance of <code>NSMutableArray</code>, assigning to an element using an index within this range will replace that element, but assigning to an element using an index outside this range will raise an exception; no syntax is provided for inserting, appending, or removing elements for mutable arrays.<p> + +A class need not declare both methods in order to take advantage of this language feature. For example, the class <code>NSArray</code> declares only <code>objectAtIndexedSubscript:</code>, so that assignments to elements will fail to type-check; moreover, its subclass <code>NSMutableArray</code> declares <code>setObject:atIndexedSubscript:</code>. + +<h4>Dictionary-Style Subscripting</h4> + +When the subscript operand has an Objective-C object pointer type, the expression is rewritten to use one of two different selectors, depending on whether the element is being read from or written to. When an expression reads an element using an Objective-C object pointer subscript operand, as in the following example:<p> + +<pre> +id key = ...; +id value = object[key]; +</pre> + +it is translated into a call to the <code>objectForKeyedSubscript:</code> method:<p> + +<pre> +id value = [object objectForKeyedSubscript:key]; +</pre> + +When an expression writes an element using an Objective-C object pointer subscript:<p> + +<pre> +object[key] = newValue; +</pre> + +it is translated to a call to <code>setObject:forKeyedSubscript:</code> + +<pre> +[object setObject:newValue forKeyedSubscript:key]; +</pre> + +The behavior of <code>setObject:forKeyedSubscript:</code> is class-specific; but in general it should replace an existing value if one is already associated with a key, otherwise it should add a new value for the key. No syntax is provided for removing elements from mutable dictionaries.<p> + +<h3>Discussion</h3> + +An Objective-C subscript expression occurs when the base operand of the C subscript operator has an Objective-C object pointer type. Since this potentially collides with pointer arithmetic on the value, these expressions are only supported under the modern Objective-C runtime, which categorically forbids such arithmetic.<p> + +Currently, only subscripts of integral or Objective-C object pointer type are supported. In C++, a class type can be used if it has a single conversion function to an integral or Objective-C pointer type, in which case that conversion is applied and analysis continues as appropriate. Otherwise, the expression is ill-formed.<p> + +An Objective-C object subscript expression is always an l-value. If the expression appears on the left-hand side of a simple assignment operator (=), the element is written as described below. If the expression appears on the left-hand side of a compound assignment operator (e.g. +=), the program is ill-formed, because the result of reading an element is always an Objective-C object pointer and no binary operators are legal on such pointers. If the expression appears in any other position, the element is read as described below. It is an error to take the address of a subscript expression, or (in C++) to bind a reference to it.<p> + +Programs can use object subscripting with Objective-C object pointers of type <code>id</code>. Normal dynamic message send rules apply; the compiler must see <i>some</i> declaration of the subscripting methods, and will pick the declaration seen first.<p> + +<h2>Grammar Additions</h2> + +To support the new syntax described above, the Objective-C <code>@</code>-expression grammar has the following new productions:<p> + +<pre> +objc-at-expression : '@' (string-literal | encode-literal | selector-literal | protocol-literal | object-literal) + ; + +object-literal : ('+' | '-')? numeric-constant + | character-constant + | boolean-constant + | array-literal + | dictionary-literal + ; + +boolean-constant : '__objc_yes' | '__objc_no' | 'true' | 'false' /* boolean keywords. */ + ; + +array-literal : '[' assignment-expression-list ']' + ; + +assignment-expression-list : assignment-expression (',' assignment-expression-list)? + | /* empty */ + ; + +dictionary-literal : '{' key-value-list '}' + ; + +key-value-list : key-value-pair (',' key-value-list)? + | /* empty */ + ; + +key-value-pair : assignment-expression ':' assignment-expression + ; +</pre> + +Note: <code>@true</code> and <code>@false</code> are only supported in Objective-C++.<p> + +<h2>Availability Checks</h2> + +Programs test for the new features by using clang's __has_feature checks. Here are examples of their use:<p> + +<pre> +#if __has_feature(objc_array_literals) + // new way. + NSArray *elements = @[ @"H", @"He", @"O", @"C" ]; +#else + // old way (equivalent). + id objects[] = { @"H", @"He", @"O", @"C" }; + NSArray *elements = [NSArray arrayWithObjects:objects count:4]; +#endif + +#if __has_feature(objc_dictionary_literals) + // new way. + NSDictionary *masses = @{ @"H" : @1.0078, @"He" : @4.0026, @"O" : @15.9990, @"C" : @12.0096 }; +#else + // old way (equivalent). + id keys[] = { @"H", @"He", @"O", @"C" }; + id values[] = { [NSNumber numberWithDouble:1.0078], [NSNumber numberWithDouble:4.0026], + [NSNumber numberWithDouble:15.9990], [NSNumber numberWithDouble:12.0096] }; + NSDictionary *masses = [NSDictionary dictionaryWithObjects:objects forKeys:keys count:4]; +#endif + +#if __has_feature(objc_subscripting) + NSUInteger i, count = elements.count; + for (i = 0; i < count; ++i) { + NSString *element = elements[i]; + NSNumber *mass = masses[element]; + NSLog(@"the mass of %@ is %@", element, mass); + } +#else + NSUInteger i, count = [elements count]; + for (i = 0; i < count; ++i) { + NSString *element = [elements objectAtIndex:i]; + NSNumber *mass = [masses objectForKey:element]; + NSLog(@"the mass of %@ is %@", element, mass); + } +#endif +</pre> + +Code can use also <code>__has_feature(objc_bool)</code> to check for the availability of numeric literals support. This checks for the new <code>__objc_yes / __objc_no</code> keywords, which enable the use of <code>@YES / @NO</code> literals.<p> + +</div> +</body> +</html> diff --git a/clang/docs/PCHInternals.html b/clang/docs/PCHInternals.html new file mode 100644 index 0000000..28ce1ce --- /dev/null +++ b/clang/docs/PCHInternals.html @@ -0,0 +1,532 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <title>Precompiled Headers (PCH)</title> + <link type="text/css" rel="stylesheet" href="../menu.css"> + <link type="text/css" rel="stylesheet" href="../content.css"> + <style type="text/css"> + td { + vertical-align: top; + } + </style> +</head> + +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>Precompiled Headers</h1> + + <p>This document describes the design and implementation of Clang's + precompiled headers (PCH). If you are interested in the end-user + view, please see the <a + href="UsersManual.html#precompiledheaders">User's Manual</a>.</p> + + <p><b>Table of Contents</b></p> + <ul> + <li><a href="#usage">Using Precompiled Headers with + <tt>clang</tt></a></li> + <li><a href="#philosophy">Design Philosophy</a></li> + <li><a href="#contents">Precompiled Header Contents</a> + <ul> + <li><a href="#metadata">Metadata Block</a></li> + <li><a href="#sourcemgr">Source Manager Block</a></li> + <li><a href="#preprocessor">Preprocessor Block</a></li> + <li><a href="#types">Types Block</a></li> + <li><a href="#decls">Declarations Block</a></li> + <li><a href="#stmt">Statements and Expressions</a></li> + <li><a href="#idtable">Identifier Table Block</a></li> + <li><a href="#method-pool">Method Pool Block</a></li> + </ul> + </li> + <li><a href="#tendrils">Precompiled Header Integration + Points</a></li> +</ul> + +<h2 id="usage">Using Precompiled Headers with <tt>clang</tt></h2> + +<p>The Clang compiler frontend, <tt>clang -cc1</tt>, supports two command line +options for generating and using PCH files.<p> + +<p>To generate PCH files using <tt>clang -cc1</tt>, use the option +<b><tt>-emit-pch</tt></b>: + +<pre> $ clang -cc1 test.h -emit-pch -o test.h.pch </pre> + +<p>This option is transparently used by <tt>clang</tt> when generating +PCH files. The resulting PCH file contains the serialized form of the +compiler's internal representation after it has completed parsing and +semantic analysis. The PCH file can then be used as a prefix header +with the <b><tt>-include-pch</tt></b> option:</p> + +<pre> + $ clang -cc1 -include-pch test.h.pch test.c -o test.s +</pre> + +<h2 id="philosophy">Design Philosophy</h2> + +<p>Precompiled headers are meant to improve overall compile times for + projects, so the design of precompiled headers is entirely driven by + performance concerns. The use case for precompiled headers is + relatively simple: when there is a common set of headers that is + included in nearly every source file in the project, we + <i>precompile</i> that bundle of headers into a single precompiled + header (PCH file). Then, when compiling the source files in the + project, we load the PCH file first (as a prefix header), which acts + as a stand-in for that bundle of headers.</p> + +<p>A precompiled header implementation improves performance when:</p> +<ul> + <li>Loading the PCH file is significantly faster than re-parsing the + bundle of headers stored within the PCH file. Thus, a precompiled + header design attempts to minimize the cost of reading the PCH + file. Ideally, this cost should not vary with the size of the + precompiled header file.</li> + + <li>The cost of generating the PCH file initially is not so large + that it counters the per-source-file performance improvement due to + eliminating the need to parse the bundled headers in the first + place. This is particularly important on multi-core systems, because + PCH file generation serializes the build when all compilations + require the PCH file to be up-to-date.</li> +</ul> + +<p>Clang's precompiled headers are designed with a compact on-disk +representation, which minimizes both PCH creation time and the time +required to initially load the PCH file. The PCH file itself contains +a serialized representation of Clang's abstract syntax trees and +supporting data structures, stored using the same compressed bitstream +as <a href="http://llvm.org/docs/BitCodeFormat.html">LLVM's bitcode +file format</a>.</p> + +<p>Clang's precompiled headers are loaded "lazily" from disk. When a +PCH file is initially loaded, Clang reads only a small amount of data +from the PCH file to establish where certain important data structures +are stored. The amount of data read in this initial load is +independent of the size of the PCH file, such that a larger PCH file +does not lead to longer PCH load times. The actual header data in the +PCH file--macros, functions, variables, types, etc.--is loaded only +when it is referenced from the user's code, at which point only that +entity (and those entities it depends on) are deserialized from the +PCH file. With this approach, the cost of using a precompiled header +for a translation unit is proportional to the amount of code actually +used from the header, rather than being proportional to the size of +the header itself.</p> + +<p>When given the <code>-print-stats</code> option, Clang produces +statistics describing how much of the precompiled header was actually +loaded from disk. For a simple "Hello, World!" program that includes +the Apple <code>Cocoa.h</code> header (which is built as a precompiled +header), this option illustrates how little of the actual precompiled +header is required:</p> + +<pre> +*** PCH Statistics: + 933 stat cache hits + 4 stat cache misses + 895/39981 source location entries read (2.238563%) + 19/15315 types read (0.124061%) + 20/82685 declarations read (0.024188%) + 154/58070 identifiers read (0.265197%) + 0/7260 selectors read (0.000000%) + 0/30842 statements read (0.000000%) + 4/8400 macros read (0.047619%) + 1/4995 lexical declcontexts read (0.020020%) + 0/4413 visible declcontexts read (0.000000%) + 0/7230 method pool entries read (0.000000%) + 0 method pool misses +</pre> + +<p>For this small program, only a tiny fraction of the source +locations, types, declarations, identifiers, and macros were actually +deserialized from the precompiled header. These statistics can be +useful to determine whether the precompiled header implementation can +be improved by making more of the implementation lazy.</p> + +<p>Precompiled headers can be chained. When you create a PCH while +including an existing PCH, Clang can create the new PCH by referencing +the original file and only writing the new data to the new file. For +example, you could create a PCH out of all the headers that are very +commonly used throughout your project, and then create a PCH for every +single source file in the project that includes the code that is +specific to that file, so that recompiling the file itself is very fast, +without duplicating the data from the common headers for every file.</p> + +<h2 id="contents">Precompiled Header Contents</h2> + +<img src="PCHLayout.png" style="float:right" alt="Precompiled header layout"> + +<p>Clang's precompiled headers are organized into several different +blocks, each of which contains the serialized representation of a part +of Clang's internal representation. Each of the blocks corresponds to +either a block or a record within <a + href="http://llvm.org/docs/BitCodeFormat.html">LLVM's bitstream +format</a>. The contents of each of these logical blocks are described +below.</p> + +<p>For a given precompiled header, the <a +href="http://llvm.org/cmds/llvm-bcanalyzer.html"><code>llvm-bcanalyzer</code></a> +utility can be used to examine the actual structure of the bitstream +for the precompiled header. This information can be used both to help +understand the structure of the precompiled header and to isolate +areas where precompiled headers can still be optimized, e.g., through +the introduction of abbreviations.</p> + +<h3 id="metadata">Metadata Block</h3> + +<p>The metadata block contains several records that provide +information about how the precompiled header was built. This metadata +is primarily used to validate the use of a precompiled header. For +example, a precompiled header built for a 32-bit x86 target cannot be used +when compiling for a 64-bit x86 target. The metadata block contains +information about:</p> + +<dl> + <dt>Language options</dt> + <dd>Describes the particular language dialect used to compile the +PCH file, including major options (e.g., Objective-C support) and more +minor options (e.g., support for "//" comments). The contents of this +record correspond to the <code>LangOptions</code> class.</dd> + + <dt>Target architecture</dt> + <dd>The target triple that describes the architecture, platform, and +ABI for which the PCH file was generated, e.g., +<code>i386-apple-darwin9</code>.</dd> + + <dt>PCH version</dt> + <dd>The major and minor version numbers of the precompiled header +format. Changes in the minor version number should not affect backward +compatibility, while changes in the major version number imply that a +newer compiler cannot read an older precompiled header (and +vice-versa).</dd> + + <dt>Original file name</dt> + <dd>The full path of the header that was used to generate the +precompiled header.</dd> + + <dt>Predefines buffer</dt> + <dd>Although not explicitly stored as part of the metadata, the +predefines buffer is used in the validation of the precompiled header. +The predefines buffer itself contains code generated by the compiler +to initialize the preprocessor state according to the current target, +platform, and command-line options. For example, the predefines buffer +will contain "<code>#define __STDC__ 1</code>" when we are compiling C +without Microsoft extensions. The predefines buffer itself is stored +within the <a href="#sourcemgr">source manager block</a>, but its +contents are verified along with the rest of the metadata.</dd> + +</dl> + +<p>A chained PCH file (that is, one that references another PCH) has +a slightly different metadata block, which contains the following +information:</p> + +<dl> + <dt>Referenced file</dt> + <dd>The name of the referenced PCH file. It is looked up like a file +specified using -include-pch.</dd> + + <dt>PCH version</dt> + <dd>This is the same as in normal PCH files.</dd> + + <dt>Original file name</dt> + <dd>The full path of the header that was used to generate this +precompiled header.</dd> + +</dl> + +<p>The language options, target architecture and predefines buffer data +is taken from the end of the chain, since they have to match anyway.</p> + +<h3 id="sourcemgr">Source Manager Block</h3> + +<p>The source manager block contains the serialized representation of +Clang's <a + href="InternalsManual.html#SourceLocation">SourceManager</a> class, +which handles the mapping from source locations (as represented in +Clang's abstract syntax tree) into actual column/line positions within +a source file or macro instantiation. The precompiled header's +representation of the source manager also includes information about +all of the headers that were (transitively) included when building the +precompiled header.</p> + +<p>The bulk of the source manager block is dedicated to information +about the various files, buffers, and macro instantiations into which +a source location can refer. Each of these is referenced by a numeric +"file ID", which is a unique number (allocated starting at 1) stored +in the source location. Clang serializes the information for each kind +of file ID, along with an index that maps file IDs to the position +within the PCH file where the information about that file ID is +stored. The data associated with a file ID is loaded only when +required by the front end, e.g., to emit a diagnostic that includes a +macro instantiation history inside the header itself.</p> + +<p>The source manager block also contains information about all of the +headers that were included when building the precompiled header. This +includes information about the controlling macro for the header (e.g., +when the preprocessor identified that the contents of the header +dependent on a macro like <code>LLVM_CLANG_SOURCEMANAGER_H</code>) +along with a cached version of the results of the <code>stat()</code> +system calls performed when building the precompiled header. The +latter is particularly useful in reducing system time when searching +for include files.</p> + +<h3 id="preprocessor">Preprocessor Block</h3> + +<p>The preprocessor block contains the serialized representation of +the preprocessor. Specifically, it contains all of the macros that +have been defined by the end of the header used to build the +precompiled header, along with the token sequences that comprise each +macro. The macro definitions are only read from the PCH file when the +name of the macro first occurs in the program. This lazy loading of +macro definitions is triggered by lookups into the <a + href="#idtable">identifier table</a>.</p> + +<h3 id="types">Types Block</h3> + +<p>The types block contains the serialized representation of all of +the types referenced in the translation unit. Each Clang type node +(<code>PointerType</code>, <code>FunctionProtoType</code>, etc.) has a +corresponding record type in the PCH file. When types are deserialized +from the precompiled header, the data within the record is used to +reconstruct the appropriate type node using the AST context.</p> + +<p>Each type has a unique type ID, which is an integer that uniquely +identifies that type. Type ID 0 represents the NULL type, type IDs +less than <code>NUM_PREDEF_TYPE_IDS</code> represent predefined types +(<code>void</code>, <code>float</code>, etc.), while other +"user-defined" type IDs are assigned consecutively from +<code>NUM_PREDEF_TYPE_IDS</code> upward as the types are encountered. +The PCH file has an associated mapping from the user-defined types +block to the location within the types block where the serialized +representation of that type resides, enabling lazy deserialization of +types. When a type is referenced from within the PCH file, that +reference is encoded using the type ID shifted left by 3 bits. The +lower three bits are used to represent the <code>const</code>, +<code>volatile</code>, and <code>restrict</code> qualifiers, as in +Clang's <a + href="http://clang.llvm.org/docs/InternalsManual.html#Type">QualType</a> +class.</p> + +<h3 id="decls">Declarations Block</h3> + +<p>The declarations block contains the serialized representation of +all of the declarations referenced in the translation unit. Each Clang +declaration node (<code>VarDecl</code>, <code>FunctionDecl</code>, +etc.) has a corresponding record type in the PCH file. When +declarations are deserialized from the precompiled header, the data +within the record is used to build and populate a new instance of the +corresponding <code>Decl</code> node. As with types, each declaration +node has a numeric ID that is used to refer to that declaration within +the PCH file. In addition, a lookup table provides a mapping from that +numeric ID to the offset within the precompiled header where that +declaration is described.</p> + +<p>Declarations in Clang's abstract syntax trees are stored +hierarchically. At the top of the hierarchy is the translation unit +(<code>TranslationUnitDecl</code>), which contains all of the +declarations in the translation unit. These declarations (such as +functions or struct types) may also contain other declarations inside +them, and so on. Within Clang, each declaration is stored within a <a +href="http://clang.llvm.org/docs/InternalsManual.html#DeclContext">declaration +context</a>, as represented by the <code>DeclContext</code> class. +Declaration contexts provide the mechanism to perform name lookup +within a given declaration (e.g., find the member named <code>x</code> +in a structure) and iterate over the declarations stored within a +context (e.g., iterate over all of the fields of a structure for +structure layout).</p> + +<p>In Clang's precompiled header format, deserializing a declaration +that is a <code>DeclContext</code> is a separate operation from +deserializing all of the declarations stored within that declaration +context. Therefore, Clang will deserialize the translation unit +declaration without deserializing the declarations within that +translation unit. When required, the declarations stored within a +declaration context will be deserialized. There are two representations +of the declarations within a declaration context, which correspond to +the name-lookup and iteration behavior described above:</p> + +<ul> + <li>When the front end performs name lookup to find a name + <code>x</code> within a given declaration context (for example, + during semantic analysis of the expression <code>p->x</code>, + where <code>p</code>'s type is defined in the precompiled header), + Clang deserializes a hash table mapping from the names within that + declaration context to the declaration IDs that represent each + visible declaration with that name. The entire hash table is + deserialized at this point (into the <code>llvm::DenseMap</code> + stored within each <code>DeclContext</code> object), but the actual + declarations are not yet deserialized. In a second step, those + declarations with the name <code>x</code> will be deserialized and + will be used as the result of name lookup.</li> + + <li>When the front end performs iteration over all of the + declarations within a declaration context, all of those declarations + are immediately de-serialized. For large declaration contexts (e.g., + the translation unit), this operation is expensive; however, large + declaration contexts are not traversed in normal compilation, since + such a traversal is unnecessary. However, it is common for the code + generator and semantic analysis to traverse declaration contexts for + structs, classes, unions, and enumerations, although those contexts + contain relatively few declarations in the common case.</li> +</ul> + +<h3 id="stmt">Statements and Expressions</h3> + +<p>Statements and expressions are stored in the precompiled header in +both the <a href="#types">types</a> and the <a + href="#decls">declarations</a> blocks, because every statement or +expression will be associated with either a type or declaration. The +actual statement and expression records are stored immediately +following the declaration or type that owns the statement or +expression. For example, the statement representing the body of a +function will be stored directly following the declaration of the +function.</p> + +<p>As with types and declarations, each statement and expression kind +in Clang's abstract syntax tree (<code>ForStmt</code>, +<code>CallExpr</code>, etc.) has a corresponding record type in the +precompiled header, which contains the serialized representation of +that statement or expression. Each substatement or subexpression +within an expression is stored as a separate record (which keeps most +records to a fixed size). Within the precompiled header, the +subexpressions of an expression are stored, in reverse order, prior to the expression +that owns those expression, using a form of <a +href="http://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse +Polish Notation</a>. For example, an expression <code>3 - 4 + 5</code> +would be represented as follows:</p> + +<table border="1"> + <tr><td><code>IntegerLiteral(5)</code></td></tr> + <tr><td><code>IntegerLiteral(4)</code></td></tr> + <tr><td><code>IntegerLiteral(3)</code></td></tr> + <tr><td><code>BinaryOperator(-)</code></td></tr> + <tr><td><code>BinaryOperator(+)</code></td></tr> + <tr><td>STOP</td></tr> +</table> + +<p>When reading this representation, Clang evaluates each expression +record it encounters, builds the appropriate abstract syntax tree node, +and then pushes that expression on to a stack. When a record contains <i>N</i> +subexpressions--<code>BinaryOperator</code> has two of them--those +expressions are popped from the top of the stack. The special STOP +code indicates that we have reached the end of a serialized expression +or statement; other expression or statement records may follow, but +they are part of a different expression.</p> + +<h3 id="idtable">Identifier Table Block</h3> + +<p>The identifier table block contains an on-disk hash table that maps +each identifier mentioned within the precompiled header to the +serialized representation of the identifier's information (e.g, the +<code>IdentifierInfo</code> structure). The serialized representation +contains:</p> + +<ul> + <li>The actual identifier string.</li> + <li>Flags that describe whether this identifier is the name of a + built-in, a poisoned identifier, an extension token, or a + macro.</li> + <li>If the identifier names a macro, the offset of the macro + definition within the <a href="#preprocessor">preprocessor + block</a>.</li> + <li>If the identifier names one or more declarations visible from + translation unit scope, the <a href="#decls">declaration IDs</a> of these + declarations.</li> +</ul> + +<p>When a precompiled header is loaded, the precompiled header +mechanism introduces itself into the identifier table as an external +lookup source. Thus, when the user program refers to an identifier +that has not yet been seen, Clang will perform a lookup into the +identifier table. If an identifier is found, its contents (macro +definitions, flags, top-level declarations, etc.) will be deserialized, at which point the corresponding <code>IdentifierInfo</code> structure will have the same contents it would have after parsing the headers in the precompiled header.</p> + +<p>Within the PCH file, the identifiers used to name declarations are represented with an integral value. A separate table provides a mapping from this integral value (the identifier ID) to the location within the on-disk +hash table where that identifier is stored. This mapping is used when +deserializing the name of a declaration, the identifier of a token, or +any other construct in the PCH file that refers to a name.</p> + +<h3 id="method-pool">Method Pool Block</h3> + +<p>The method pool block is represented as an on-disk hash table that +serves two purposes: it provides a mapping from the names of +Objective-C selectors to the set of Objective-C instance and class +methods that have that particular selector (which is required for +semantic analysis in Objective-C) and also stores all of the selectors +used by entities within the precompiled header. The design of the +method pool is similar to that of the <a href="#idtable">identifier +table</a>: the first time a particular selector is formed during the +compilation of the program, Clang will search in the on-disk hash +table of selectors; if found, Clang will read the Objective-C methods +associated with that selector into the appropriate front-end data +structure (<code>Sema::InstanceMethodPool</code> and +<code>Sema::FactoryMethodPool</code> for instance and class methods, +respectively).</p> + +<p>As with identifiers, selectors are represented by numeric values +within the PCH file. A separate index maps these numeric selector +values to the offset of the selector within the on-disk hash table, +and will be used when de-serializing an Objective-C method declaration +(or other Objective-C construct) that refers to the selector.</p> + +<h2 id="tendrils">Precompiled Header Integration Points</h2> + +<p>The "lazy" deserialization behavior of precompiled headers requires +their integration into several completely different submodules of +Clang. For example, lazily deserializing the declarations during name +lookup requires that the name-lookup routines be able to query the +precompiled header to find entities within the PCH file.</p> + +<p>For each Clang data structure that requires direct interaction with +the precompiled header logic, there is an abstract class that provides +the interface between the two modules. The <code>PCHReader</code> +class, which handles the loading of a precompiled header, inherits +from all of these abstract classes to provide lazy deserialization of +Clang's data structures. <code>PCHReader</code> implements the +following abstract classes:</p> + +<dl> + <dt><code>StatSysCallCache</code></dt> + <dd>This abstract interface is associated with the + <code>FileManager</code> class, and is used whenever the file + manager is going to perform a <code>stat()</code> system call.</dd> + + <dt><code>ExternalSLocEntrySource</code></dt> + <dd>This abstract interface is associated with the + <code>SourceManager</code> class, and is used whenever the + <a href="#sourcemgr">source manager</a> needs to load the details + of a file, buffer, or macro instantiation.</dd> + + <dt><code>IdentifierInfoLookup</code></dt> + <dd>This abstract interface is associated with the + <code>IdentifierTable</code> class, and is used whenever the + program source refers to an identifier that has not yet been seen. + In this case, the precompiled header implementation searches for + this identifier within its <a href="#idtable">identifier table</a> + to load any top-level declarations or macros associated with that + identifier.</dd> + + <dt><code>ExternalASTSource</code></dt> + <dd>This abstract interface is associated with the + <code>ASTContext</code> class, and is used whenever the abstract + syntax tree nodes need to loaded from the precompiled header. It + provides the ability to de-serialize declarations and types + identified by their numeric values, read the bodies of functions + when required, and read the declarations stored within a + declaration context (either for iteration or for name lookup).</dd> + + <dt><code>ExternalSemaSource</code></dt> + <dd>This abstract interface is associated with the <code>Sema</code> + class, and is used whenever semantic analysis needs to read + information from the <a href="#methodpool">global method + pool</a>.</dd> +</dl> + +</div> + +</body> +</html> diff --git a/clang/docs/PCHLayout.graffle b/clang/docs/PCHLayout.graffle new file mode 100644 index 0000000..5c96bfb --- /dev/null +++ b/clang/docs/PCHLayout.graffle @@ -0,0 +1,1880 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>ActiveLayerIndex</key> + <integer>0</integer> + <key>ApplicationVersion</key> + <array> + <string>com.omnigroup.OmniGrafflePro</string> + <string>137.11.0.108132</string> + </array> + <key>AutoAdjust</key> + <true/> + <key>BackgroundGraphic</key> + <dict> + <key>Bounds</key> + <string>{{0, 0}, {576, 733}}</string> + <key>Class</key> + <string>SolidGraphic</string> + <key>ID</key> + <integer>2</integer> + <key>Style</key> + <dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + </dict> + <key>CanvasOrigin</key> + <string>{0, 0}</string> + <key>ColumnAlign</key> + <integer>1</integer> + <key>ColumnSpacing</key> + <real>36</real> + <key>CreationDate</key> + <string>2009-06-02 11:19:43 -0700</string> + <key>Creator</key> + <string>Douglas Gregor</string> + <key>DisplayScale</key> + <string>1 0/72 in = 1.0000 in</string> + <key>GraphDocumentVersion</key> + <integer>6</integer> + <key>GraphicsList</key> + <array> + <dict> + <key>Bounds</key> + <string>{{35, 301}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>13</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>0.175793</string> + <key>g</key> + <string>0.402929</string> + <key>r</key> + <string>1</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Method Pool}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{32, 58}, {110, 14}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>FitText</key> + <string>YES</string> + <key>Flow</key> + <string>Resize</string> + <key>ID</key> + <integer>12</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>shadow</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + <key>stroke</key> + <dict> + <key>Draws</key> + <string>NO</string> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Pad</key> + <integer>0</integer> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Precompiled Header}</string> + <key>VerticalPad</key> + <integer>0</integer> + </dict> + <key>Wrap</key> + <string>NO</string> + </dict> + <dict> + <key>Bounds</key> + <string>{{35, 190}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>11</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>1</string> + <key>g</key> + <string>0.796208</string> + <key>r</key> + <string>0.324589</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Types}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{35, 227}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>10</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>1</string> + <key>g</key> + <string>0.382716</string> + <key>r</key> + <string>0.524072</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Declarations}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{35, 264}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>8</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>0.99938</string> + <key>g</key> + <string>0.457913</string> + <key>r</key> + <string>1</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Identifier Table}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{35, 153}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>7</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>0.669993</string> + <key>g</key> + <string>1</string> + <key>r</key> + <string>0.254644</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Preprocessor}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{35, 116}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>6</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>0.258332</string> + <key>g</key> + <string>1</string> + <key>r</key> + <string>0.593784</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Source Manager}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{35, 79}, {104, 30}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>5</integer> + <key>Layer</key> + <integer>0</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>Color</key> + <dict> + <key>b</key> + <string>0.270873</string> + <key>g</key> + <string>1</string> + <key>r</key> + <string>0.979351</string> + </dict> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + <key>Text</key> + <dict> + <key>Text</key> + <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural + +\f0\fs24 \cf0 Metadata}</string> + </dict> + </dict> + <dict> + <key>Bounds</key> + <string>{{21, 47}, {132, 293}}</string> + <key>Class</key> + <string>ShapedGraphic</string> + <key>ID</key> + <integer>4</integer> + <key>Layer</key> + <integer>1</integer> + <key>Shape</key> + <string>Rectangle</string> + <key>Style</key> + <dict> + <key>fill</key> + <dict> + <key>FillType</key> + <integer>2</integer> + <key>GradientAngle</key> + <real>90</real> + </dict> + <key>stroke</key> + <dict> + <key>CornerRadius</key> + <real>9</real> + </dict> + </dict> + </dict> + </array> + <key>GridInfo</key> + <dict/> + <key>GuidesLocked</key> + <string>NO</string> + <key>GuidesVisible</key> + <string>YES</string> + <key>HPages</key> + <integer>1</integer> + <key>ImageCounter</key> + <integer>1</integer> + <key>KeepToScale</key> + <false/> + <key>Layers</key> + <array> + <dict> + <key>Lock</key> + <string>NO</string> + <key>Name</key> + <string>Sub-blocks</string> + <key>Print</key> + <string>YES</string> + <key>View</key> + <string>YES</string> + </dict> + <dict> + <key>Lock</key> + <string>NO</string> + <key>Name</key> + <string>PCH Block</string> + <key>Print</key> + <string>YES</string> + <key>View</key> + <string>YES</string> + </dict> + </array> + <key>LayoutInfo</key> + <dict> + <key>Animate</key> + <string>NO</string> + <key>circoMinDist</key> + <real>18</real> + <key>circoSeparation</key> + <real>0.0</real> + <key>layoutEngine</key> + <string>dot</string> + <key>neatoSeparation</key> + <real>0.0</real> + <key>twopiSeparation</key> + <real>0.0</real> + </dict> + <key>LinksVisible</key> + <string>NO</string> + <key>MagnetsVisible</key> + <string>NO</string> + <key>MasterSheets</key> + <array/> + <key>ModificationDate</key> + <string>2009-06-03 08:22:05 -0700</string> + <key>Modifier</key> + <string>Douglas Gregor</string> + <key>NotesVisible</key> + <string>NO</string> + <key>Orientation</key> + <integer>2</integer> + <key>OriginVisible</key> + <string>NO</string> + <key>PageBreaks</key> + <string>YES</string> + <key>PrintInfo</key> + <dict> + <key>NSBottomMargin</key> + <array> + <string>float</string> + <string>41</string> + </array> + <key>NSLeftMargin</key> + <array> + <string>float</string> + <string>18</string> + </array> + <key>NSPaperSize</key> + <array> + <string>size</string> + <string>{612, 792}</string> + </array> + <key>NSRightMargin</key> + <array> + <string>float</string> + <string>18</string> + </array> + <key>NSTopMargin</key> + <array> + <string>float</string> + <string>18</string> + </array> + </dict> + <key>PrintOnePage</key> + <false/> + <key>QuickLookPreview</key> + <data> + JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmls + dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGNWNtuGzcQfedX8LF5iMz77r7WadEU + CJDUBvqsyptagWQ5klOgP9tv6TnDy64syXYMhGeo5XAuZ4bc/a6/6O/a4C92SXfe6/2o + /9QP2iySkX96ra+uD1avDtrK32Gl35tFLL9OqChQUPBVX30e96vx8enHcqP3a2xhY5Bt + vI3aGu27Xq+2+urj1uoPOxhBM7zRqU96q20IRGoD1C+GziT5wUaP0eYJEbpOr6Da62Cc + xtNAfugWxg1hWuoHr6gRI57GJgQb7aI8l+ednRYCU91KF3A0KEybxcB/OmF76GliNa1o + prFJu6E+DWGl75uXimHG4oidHf63CD7tLgk4jaDE773VfaejH7CCAby5t/pwr3IAz+TR + 6t+RtW+n+by+EX1G31wzPVW5IQkUNCNOoSu5AJilAhIDHa3Ez2WBvkn4va2J8FEyhdiX + HPpgJLUccyIA5omAyESUhRmDeRU4qzzUyyMyXSMf0zwPzbCWB1jc0gCcs6CAtvoGzDsN + tUsSj+i0AxPNULjqMlcRrqMHYucYMZDZX3jA52R93IbzDwRskzVEJeXwfIuQ4LBskS5o + GGpBdecf8H1XjOzzA1d/jJvl0/qf8Xq32e3X2/Fpv16xWGu5I7rd4COqFexYuM70HUiB + 8g9BJZQz6pQVCwRy+FDqFKL1qI0A3rNwswD/MwLJ+TQecL3wR01LEQTRyGBgEzxC1aA6 + 6zmLCGRdqImhDkzKwEdF+Wg6RGrA79WcSRsMpVIM5EOBW/Suc9WAn7uheAwwcxgS3el9 + rQYKyIXMWkOC83drcoAmdy1oRXc5irsEM3cpwvK6MGMpHE6ii0WVB5EkCthXvG3GNG9h + ZXah+CrOCPevD2h1ByWJNWj2M+/RaBJMB+9+vgXlS4tw+j0Ly6akg74FJ39FIwBFbr/q + nz6NT8u75dPynbr9p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YMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg + wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM + GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB + AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMG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og0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBB + hWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0 + UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYA + oog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0UyBBhWYAoog0U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AAAAEQZmlGSQAAABAAAAEgZGFESwAAABwA + AAEwemhDTgAAAAwAAAFMZnJGUgAAABYAAAFYamFKUAAAAA4AAAFuZW5VUwAAABIAAAF8 + cGxQTAAAABIAAAGOcHRCUgAAABgAAAGgZXNFUwAAABIAAAG4emhUVwAAAA4AAAHKcnVS + VQAAACQAAAHYa29LUgAAAAwAAAH8ZGVERQAAABAAAAIIbmxOTAAAABYAAAIYaXRJVAAA + ABQAAAIuAEYAYQByAGcAZQAtAEwAQwBEAEwAQwBEACAAYQAgAEMAbwByAGUAcwBGAOQA + cgBnAC0ATABDAEQAVgDkAHIAaQAtAEwAQwBEAEwAQwBEAC0AZgBhAHIAdgBlAHMAawDm + AHIAbV9pgnIAIABMAEMARABMAEMARAAgAGMAbwB1AGwAZQB1AHIwqzDpMPwAIABMAEMA + RABDAG8AbABvAHIAIABMAEMARABLAG8AbABvAHIAIABMAEMARABMAEMARAAgAEMAbwBs + AG8AcgBpAGQAbwBMAEMARAAgAGMAbwBsAG8Acl9pgnJtsmZ2mG95OlZoBCYEMgQ1BEIE + PQQ+BDkAIAQWBBoALQQ0BDgEQQQ/BDsENQQ5zuy37AAgAEwAQwBEAEYAYQByAGIALQBM + AEMARABLAGwAZQB1AHIAZQBuAC0ATABDAEQATABDAEQAIABjAG8AbABvAHIAaQAAbW1v + ZAAAAAAAAAYQAACcgAAAAADDJekAAAAAAAAAAAAAAAAAAAAAAHRleHQAAAAAQ29weXJp + Z2h0IEFwcGxlLCBJbmMuLCAyMDA5AA== + </data> + <key>ReadOnly</key> + <string>NO</string> + <key>RowAlign</key> + <integer>1</integer> + <key>RowSpacing</key> + <real>36</real> + <key>SheetTitle</key> + <string>Canvas 1</string> + <key>SmartAlignmentGuidesActive</key> + <string>YES</string> + <key>SmartDistanceGuidesActive</key> + <string>YES</string> + <key>UniqueID</key> + <integer>1</integer> + <key>UseEntirePage</key> + <false/> + <key>VPages</key> + <integer>1</integer> + <key>WindowInfo</key> + <dict> + <key>CurrentSheet</key> + <integer>0</integer> + <key>ExpandedCanvases</key> + <array> + <dict> + <key>name</key> + <string>Canvas 1</string> + </dict> + </array> + <key>Frame</key> + <string>{{388, 0}, {710, 878}}</string> + <key>ListView</key> + <true/> + <key>OutlineWidth</key> + <integer>142</integer> + <key>RightSidebar</key> + <false/> + <key>ShowRuler</key> + <true/> + <key>Sidebar</key> + <true/> + <key>SidebarWidth</key> + <integer>120</integer> + <key>VisibleRegion</key> + <string>{{0, 0}, {561, 709}}</string> + <key>Zoom</key> + <real>1</real> + <key>ZoomValues</key> + <array> + <array> + <string>Canvas 1</string> + <real>1</real> + <real>1</real> + </array> + </array> + </dict> + <key>saveQuickLookFiles</key> + <string>YES</string> +</dict> +</plist> diff --git a/clang/docs/PCHLayout.png b/clang/docs/PCHLayout.png Binary files differnew file mode 100644 index 0000000..c304e04 --- /dev/null +++ b/clang/docs/PCHLayout.png diff --git a/clang/docs/PTHInternals.html b/clang/docs/PTHInternals.html new file mode 100644 index 0000000..b15f681 --- /dev/null +++ b/clang/docs/PTHInternals.html @@ -0,0 +1,179 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <title>Pretokenized Headers (PTH)</title> + <link type="text/css" rel="stylesheet" href="../menu.css"> + <link type="text/css" rel="stylesheet" href="../content.css"> + <style type="text/css"> + td { + vertical-align: top; + } + </style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>Pretokenized Headers (PTH)</h1> + +<p>This document first describes the low-level +interface for using PTH and then briefly elaborates on its design and +implementation. If you are interested in the end-user view, please see the +<a href="UsersManual.html#precompiledheaders">User's Manual</a>.</p> + + +<h2>Using Pretokenized Headers with <tt>clang</tt> (Low-level Interface)</h2> + +<p>The Clang compiler frontend, <tt>clang -cc1</tt>, supports three command line +options for generating and using PTH files.<p> + +<p>To generate PTH files using <tt>clang -cc1</tt>, use the option +<b><tt>-emit-pth</tt></b>: + +<pre> $ clang -cc1 test.h -emit-pth -o test.h.pth </pre> + +<p>This option is transparently used by <tt>clang</tt> when generating PTH +files. Similarly, PTH files can be used as prefix headers using the +<b><tt>-include-pth</tt></b> option:</p> + +<pre> + $ clang -cc1 -include-pth test.h.pth test.c -o test.s +</pre> + +<p>Alternatively, Clang's PTH files can be used as a raw "token-cache" +(or "content" cache) of the source included by the original header +file. This means that the contents of the PTH file are searched as substitutes +for <em>any</em> source files that are used by <tt>clang -cc1</tt> to process a +source file. This is done by specifying the <b><tt>-token-cache</tt></b> +option:</p> + +<pre> + $ cat test.h + #include <stdio.h> + $ clang -cc1 -emit-pth test.h -o test.h.pth + $ cat test.c + #include "test.h" + $ clang -cc1 test.c -o test -token-cache test.h.pth +</pre> + +<p>In this example the contents of <tt>stdio.h</tt> (and the files it includes) +will be retrieved from <tt>test.h.pth</tt>, as the PTH file is being used in +this case as a raw cache of the contents of <tt>test.h</tt>. This is a low-level +interface used to both implement the high-level PTH interface as well as to +provide alternative means to use PTH-style caching.</p> + +<h2>PTH Design and Implementation</h2> + +<p>Unlike GCC's precompiled headers, which cache the full ASTs and preprocessor +state of a header file, Clang's pretokenized header files mainly cache the raw +lexer <em>tokens</em> that are needed to segment the stream of characters in a +source file into keywords, identifiers, and operators. Consequently, PTH serves +to mainly directly speed up the lexing and preprocessing of a source file, while +parsing and type-checking must be completely redone every time a PTH file is +used.</p> + +<h3>Basic Design Tradeoffs</h3> + +<p>In the long term there are plans to provide an alternate PCH implementation +for Clang that also caches the work for parsing and type checking the contents +of header files. The current implementation of PCH in Clang as pretokenized +header files was motivated by the following factors:<p> + +<ul> + +<li><p><b>Language independence</b>: PTH files work with any language that +Clang's lexer can handle, including C, Objective-C, and (in the early stages) +C++. This means development on language features at the parsing level or above +(which is basically almost all interesting pieces) does not require PTH to be +modified.</p></li> + +<li><b>Simple design</b>: Relatively speaking, PTH has a simple design and +implementation, making it easy to test. Further, because the machinery for PTH +resides at the lower-levels of the Clang library stack it is fairly +straightforward to profile and optimize.</li> +</ul> + +<p>Further, compared to GCC's PCH implementation (which is the dominate +precompiled header file implementation that Clang can be directly compared +against) the PTH design in Clang yields several attractive features:</p> + +<ul> + +<li><p><b>Architecture independence</b>: In contrast to GCC's PCH files (and +those of several other compilers), Clang's PTH files are architecture +independent, requiring only a single PTH file when building an program for +multiple architectures.</p> + +<p>For example, on Mac OS X one may wish to +compile a "universal binary" that runs on PowerPC, 32-bit Intel +(i386), and 64-bit Intel architectures. In contrast, GCC requires a PCH file for +each architecture, as the definitions of types in the AST are +architecture-specific. Since a Clang PTH file essentially represents a lexical +cache of header files, a single PTH file can be safely used when compiling for +multiple architectures. This can also reduce compile times because only a single +PTH file needs to be generated during a build instead of several.</p></li> + +<li><p><b>Reduced memory pressure</b>: Similar to GCC, +Clang reads PTH files via the use of memory mapping (i.e., <tt>mmap</tt>). +Clang, however, memory maps PTH files as read-only, meaning that multiple +invocations of <tt>clang -cc1</tt> can share the same pages in memory from a +memory-mapped PTH file. In comparison, GCC also memory maps its PCH files but +also modifies those pages in memory, incurring the copy-on-write costs. The +read-only nature of PTH can greatly reduce memory pressure for builds involving +multiple cores, thus improving overall scalability.</p></li> + +<li><p><b>Fast generation</b>: PTH files can be generated in a small fraction +of the time needed to generate GCC's PCH files. Since PTH/PCH generation is a +serial operation that typically blocks progress during a build, faster +generation time leads to improved processor utilization with parallel builds on +multicore machines.</p></li> + +</ul> + +<p>Despite these strengths, PTH's simple design suffers some algorithmic +handicaps compared to other PCH strategies such as those used by GCC. While PTH +can greatly speed up the processing time of a header file, the amount of work +required to process a header file is still roughly linear in the size of the +header file. In contrast, the amount of work done by GCC to process a +precompiled header is (theoretically) constant (the ASTs for the header are +literally memory mapped into the compiler). This means that only the pieces of +the header file that are referenced by the source file including the header are +the only ones the compiler needs to process during actual compilation. While +GCC's particular implementation of PCH mitigates some of these algorithmic +strengths via the use of copy-on-write pages, the approach itself can +fundamentally dominate at an algorithmic level, especially when one considers +header files of arbitrary size.</p> + +<p>There are plans to potentially implement an complementary PCH implementation +for Clang based on the lazy deserialization of ASTs. This approach would +theoretically have the same constant-time algorithmic advantages just mentioned +but would also retain some of the strengths of PTH such as reduced memory +pressure (ideal for multi-core builds).</p> + +<h3>Internal PTH Optimizations</h3> + +<p>While the main optimization employed by PTH is to reduce lexing time of +header files by caching pre-lexed tokens, PTH also employs several other +optimizations to speed up the processing of header files:</p> + +<ul> + +<li><p><em><tt>stat</tt> caching</em>: PTH files cache information obtained via +calls to <tt>stat</tt> that <tt>clang -cc1</tt> uses to resolve which files are +included by <tt>#include</tt> directives. This greatly reduces the overhead +involved in context-switching to the kernel to resolve included files.</p></li> + +<li><p><em>Fasting skipping of <tt>#ifdef</tt>...<tt>#endif</tt> chains</em>: +PTH files record the basic structure of nested preprocessor blocks. When the +condition of the preprocessor block is false, all of its tokens are immediately +skipped instead of requiring them to be handled by Clang's +preprocessor.</p></li> + +</ul> + +</div> +</body> +</html> diff --git a/clang/docs/ReleaseNotes.html b/clang/docs/ReleaseNotes.html new file mode 100644 index 0000000..8367b8a --- /dev/null +++ b/clang/docs/ReleaseNotes.html @@ -0,0 +1,177 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>Clang 3.1 Release Notes</title> +<link type="text/css" rel="stylesheet" href="../menu.css"> +<link type="text/css" rel="stylesheet" href="../content.css"> +<style type="text/css"> +td { + vertical-align: top; +} +</style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>Clang 3.1 Release Notes</h1> + +<img style="float:right" src="http://llvm.org/img/DragonSmall.png" + width="136" height="136" alt="LLVM Dragon Logo"> + +<ul> + <li><a href="#intro">Introduction</a></li> + <li><a href="#whatsnew">What's New in Clang 3.1?</a> + <ul> + <li><a href="#cchanges">C Language Changes</a></li> + <li><a href="#cxxchanges">C++ Language Changes</a></li> + <li><a href="#objcchanges">Objective-C Language Changes</a></li> + <li><a href="#pythonchanges">Python Binding Changes</a></li> + </ul> + </li> + <li><a href="#additionalinfo">Additional Information</a></li> +</ul> + +<div class="doc_author"> + <p>Written by the <a href="http://llvm.org/">LLVM Team</a></p> +</div> + +<!-- ======================================================================= --> +<h2 id="intro">Introduction</h2> +<!-- ======================================================================= --> + +<p>This document contains the release notes for the Clang C/C++/Objective-C +frontend, part of the LLVM Compiler Infrastructure, release 3.1. Here we +describe the status of Clang in some detail, including major improvements from +the previous release and new feature work. For the general LLVM release notes, +see <a href="http://llvm.org/docs/ReleaseNotes.html">the LLVM + documentation</a>. All LLVM releases may be downloaded from the +<a href="http://llvm.org/releases/">LLVM releases web site</a>.</p> + +<p>For more information about Clang or LLVM, including information about the +latest release, please check out the main please see the +<a href="http://clang.llvm.org">Clang Web Site</a> or the +<a href="http://llvm.org">LLVM Web Site</a>. + +<p>Note that if you are reading this file from a Subversion checkout or the main +Clang web page, this document applies to the <i>next</i> release, not the +current one. To see the release notes for a specific release, please see the +<a href="http://llvm.org/releases/">releases page</a>.</p> + +<!-- ======================================================================= --> +<h2 id="whatsnew">What's New in Clang 3.1?</h2> +<!-- ======================================================================= --> + +<p>Some of the major new features and improvements to Clang are listed here. +Generic improvements to Clang as a whole or two its underlying infrastructure +are described first, followed by language-specific sections with improvements to +Clang's support for those languages.</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="cchanges">C Language Changes in Clang</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<h4 id="c11changes">C11 Feature Support</h4> + +<p>Clang 3.1 adds support for anonymous structs and anonymous unions, added in +the latest ISO C standard. Use <code>-std=c11</code> or <code>-std=gnu11</code> +to enable support for the new language standard. The new C11 features are +backwards-compatible and are available as an extension in all language +modes.</p> + +<p>All warning and language selection flags which previously accepted +<code>c1x</code> have been updated to accept <code>c11</code>. The old +<code>c1x</code> forms have been removed. + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="cxxchanges">C++ Language Changes in Clang</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<h4 id="cxx11changes">C++11 Feature Support</h4> +<p>Clang 3.1 supports +<a href="http://clang.llvm.org/cxx_status.html#cxx11">most of the language +features</a> added in the latest ISO C++ standard, +<a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372">C++ 2011</a>. +Use <code>-std=c++11</code> or <code>-std=gnu++11</code> to enable support for +these features. In addition to the features supported by Clang 3.0, the +following are now considered to be of production quality: +<ul> + <li>Generalized constant expressions</li> + <li>Lambda expressions</li> + <li>Generalized initializers</li> + <li>Unrestricted unions</li> + <li>User-defined literals</li> + <li>Forward-declared enumerations</li> + <li>Atomics (both libc++'s and libstdc++4.7's <tt><atomic></tt> are + supported)</li> +</ul> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="objcchanges">Objective-C Language Changes in Clang</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +Clang 3.1 introduces several new Objective-C language features and improvements. + +<h4 id="literals-subscripting">Objective-C literals and subscripting</h3> + +<p>Objective-C now provides additional literal expressions, including numeric, array, and dictionary literals. Additionally, array and dictionary elements can be accesses via the subscripting operator. For more information about the new literals, see the <a href="ObjectiveCLiterals.html">documentation for Objective-C literals and subscripting</a>. + +<h4 id="objcwformat">Format string checking for NSString literals</h4> + +<code>-Wformat</code> now checks <code>@"NSString literals"</code>. + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="pythonchanges">Python Binding Changes</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +The following methods have been added: +<ul> + <li>SourceLocation.from_position (static)</li> + <li>SourceLocation.__eq__ and SourceLocation.__ne__</li> + <li>SourceRange.__eq__ and SourceRange.__ne__</li> + <li>Diagnostic.category_number (property)</li> + <li>Diagnostic.category_name (property)</li> + <li>Diagnostic.option (property)</li> + <li>Diagnostic.disable_option (property)</li> + <li>CursorKind.is_translation_unit</li> + <li>CursorKind.is_preprocessing</li> + <li>CursorKind.is_unexposed</li> + <li>Cursor.from_location (static)</li> + <li>Cursor.underlying_typedef_type (property)</li> + <li>Cursor.enum_type (property)</li> + <li>Cursor.objc_type_encoding (property)</li> + <li>Cursor.hash</li> + <li>TypeKind.spelling</li> + <li>Type.argument_types</li> + <li>Type.element_type (property)</li> + <li>Type.element_count (property)</li> + <li>Type.is_function_variadic</li> + <li>Type.is_pod</li> + <li>Type.get_array_element_type</li> + <li>Type.get_array_size</li> + <li>Type.__eq__ and Type.__ne__</li> + <li>File.from_name (static)</li> + <li>File.__str__ and File.__repr__</li> +</ul> + +<!-- ======================================================================= --> +<h2 id="additionalinfo">Additional Information</h2> +<!-- ======================================================================= --> + +<p>A wide variety of additional information is available on the +<a href="http://clang.llvm.org/">Clang web page</a>. The web page contains +versions of the API documentation which are up-to-date with the Subversion +version of the source code. You can access versions of these documents specific +to this release by going into the "<tt>clang/doc/</tt>" directory in the Clang +tree.</p> + +<p>If you have any questions or comments about Clang, please feel free to +contact us via the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev"> +mailing list</a>.</p> + + +</div> +</body> +</html> diff --git a/clang/docs/UsersManual.html b/clang/docs/UsersManual.html new file mode 100644 index 0000000..b33ed61 --- /dev/null +++ b/clang/docs/UsersManual.html @@ -0,0 +1,1147 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>Clang Compiler User's Manual</title> +<link type="text/css" rel="stylesheet" href="../menu.css"> +<link type="text/css" rel="stylesheet" href="../content.css"> +<style type="text/css"> +td { + vertical-align: top; +} +</style> +</head> +<body> + +<!--#include virtual="../menu.html.incl"--> + +<div id="content"> + +<h1>Clang Compiler User's Manual</h1> + +<ul> +<li><a href="#intro">Introduction</a> + <ul> + <li><a href="#terminology">Terminology</a></li> + <li><a href="#basicusage">Basic Usage</a></li> + </ul> +</li> +<li><a href="#commandline">Command Line Options</a> + <ul> + <li><a href="#cl_diagnostics">Options to Control Error and Warning + Messages</a></li> + <li><a href="#cl_crash_diagnostics">Options to Control Clang Crash + Diagnostics</a></li> + </ul> +</li> +<li><a href="#general_features">Language and Target-Independent Features</a> + <ul> + <li><a href="#diagnostics">Controlling Errors and Warnings</a> + <ul> + <li><a href="#diagnostics_display">Controlling How Clang Displays Diagnostics</a></li> + <li><a href="#diagnostics_mappings">Diagnostic Mappings</a></li> + <li><a href="#diagnostics_categories">Diagnostic Categories</a></li> + <li><a href="#diagnostics_commandline">Controlling Diagnostics via Command Line Flags</a></li> + <li><a href="#diagnostics_pragmas">Controlling Diagnostics via Pragmas</a></li> + <li><a href="#diagnostics_enable_everything">Enabling All Warnings</a></li> + <li><a href="#analyzer_diagnositics">Controlling Static Analyzer Diagnostics</a></li> + </ul> + </li> + <li><a href="#precompiledheaders">Precompiled Headers</a></li> + <li><a href="#codegen">Controlling Code Generation</a></li> + </ul> +</li> +<li><a href="#c">C Language Features</a> + <ul> + <li><a href="#c_ext">Extensions supported by clang</a></li> + <li><a href="#c_modes">Differences between various standard modes</a></li> + <li><a href="#c_unimpl_gcc">GCC extensions not implemented yet</a></li> + <li><a href="#c_unsupp_gcc">Intentionally unsupported GCC extensions</a></li> + <li><a href="#c_ms">Microsoft extensions</a></li> + </ul> +</li> +<li><a href="#cxx">C++ Language Features</a> + <ul> + <li><a href="#cxx_implimits">Controlling implementation limits</a></li> + </ul> +</li> +<li><a href="#target_features">Target-Specific Features and Limitations</a> + <ul> + <li><a href="#target_arch">CPU Architectures Features and Limitations</a> + <ul> + <li><a href="#target_arch_x86">X86</a></li> + <li><a href="#target_arch_arm">ARM</a></li> + <li><a href="#target_arch_other">Other platforms</a></li> + </ul> + </li> + <li><a href="#target_os">Operating System Features and Limitations</a> + <ul> + <li><a href="#target_os_darwin">Darwin (Mac OS/X)</a></li> + <li>Linux, etc.</li> + <li><a href="#target_os_win32">Windows</a></li> + </ul> + </li> + </ul> +</li> +</ul> + + +<!-- ======================================================================= --> +<h2 id="intro">Introduction</h2> +<!-- ======================================================================= --> + +<p>The Clang Compiler is an open-source compiler for the C family of programming +languages, aiming to be the best in class implementation of these languages. +Clang builds on the LLVM optimizer and code generator, allowing it to provide +high-quality optimization and code generation support for many targets. For +more general information, please see the <a href="http://clang.llvm.org">Clang +Web Site</a> or the <a href="http://llvm.org">LLVM Web Site</a>.</p> + +<p>This document describes important notes about using Clang as a compiler for +an end-user, documenting the supported features, command line options, etc. If +you are interested in using Clang to build a tool that processes code, please +see <a href="InternalsManual.html">the Clang Internals Manual</a>. If you are +interested in the <a href="http://clang-analyzer.llvm.org">Clang +Static Analyzer</a>, please see its web page.</p> + +<p>Clang is designed to support the C family of programming languages, which +includes <a href="#c">C</a>, <a href="#objc">Objective-C</a>, <a +href="#cxx">C++</a>, and <a href="#objcxx">Objective-C++</a> as well as many +dialects of those. For language-specific information, please see the +corresponding language specific section:</p> + +<ul> +<li><a href="#c">C Language</a>: K&R C, ANSI C89, ISO C90, ISO C94 + (C89+AMD1), ISO C99 (+TC1, TC2, TC3). </li> +<li><a href="#objc">Objective-C Language</a>: ObjC 1, ObjC 2, ObjC 2.1, plus + variants depending on base language.</li> +<li><a href="#cxx">C++ Language</a></li> +<li><a href="#objcxx">Objective C++ Language</a></li> +</ul> + +<p>In addition to these base languages and their dialects, Clang supports a +broad variety of language extensions, which are documented in the corresponding +language section. These extensions are provided to be compatible with the GCC, +Microsoft, and other popular compilers as well as to improve functionality +through Clang-specific features. The Clang driver and language features are +intentionally designed to be as compatible with the GNU GCC compiler as +reasonably possible, easing migration from GCC to Clang. In most cases, code +"just works".</p> + +<p>In addition to language specific features, Clang has a variety of features +that depend on what CPU architecture or operating system is being compiled for. +Please see the <a href="#target_features">Target-Specific Features and +Limitations</a> section for more details.</p> + +<p>The rest of the introduction introduces some basic <a +href="#terminology">compiler terminology</a> that is used throughout this manual +and contains a basic <a href="#basicusage">introduction to using Clang</a> +as a command line compiler.</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="terminology">Terminology</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>Front end, parser, backend, preprocessor, undefined behavior, diagnostic, + optimizer</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="basicusage">Basic Usage</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>Intro to how to use a C compiler for newbies.</p> +<p> +compile + link + +compile then link + +debug info + +enabling optimizations + +picking a language to use, defaults to C99 by default. Autosenses based on +extension. + +using a makefile +</p> + + +<!-- ======================================================================= --> +<h2 id="commandline">Command Line Options</h2> +<!-- ======================================================================= --> + +<p> +This section is generally an index into other sections. It does not go into +depth on the ones that are covered by other sections. However, the first part +introduces the language selection and other high level options like -c, -g, etc. +</p> + + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="cl_diagnostics">Options to Control Error and Warning Messages</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p><b>-Werror</b>: Turn warnings into errors.</p> +<p><b>-Werror=foo</b>: Turn warning "foo" into an error.</p> +<p><b>-Wno-error=foo</b>: Turn warning "foo" into an warning even if -Werror is + specified.</p> +<p><b>-Wfoo</b>: Enable warning foo</p> +<p><b>-Wno-foo</b>: Disable warning foo</p> +<p><b>-w</b>: Disable all warnings.</p> +<p><b>-pedantic</b>: Warn on language extensions.</p> +<p><b>-pedantic-errors</b>: Error on language extensions.</p> +<p><b>-Wsystem-headers</b>: Enable warnings from system headers.</p> + +<p><b>-ferror-limit=123</b>: Stop emitting diagnostics after 123 errors have + been produced. The default is 20, and the error limit can be disabled with + -ferror-limit=0.</p> + +<p><b>-ftemplate-backtrace-limit=123</b>: Only emit up to 123 template instantiation notes within the template instantiation backtrace for a single warning or error. The default is 10, and the limit can be disabled with -ftemplate-backtrace-limit=0.</p> + +<!-- ================================================= --> +<h4 id="cl_diag_formatting">Formatting of Diagnostics</h4> +<!-- ================================================= --> + +<p>Clang aims to produce beautiful diagnostics by default, particularly for new +users that first come to Clang. However, different people have different +preferences, and sometimes Clang is driven by another program that wants to +parse simple and consistent output, not a person. For these cases, Clang +provides a wide range of options to control the exact output format of the +diagnostics that it generates.</p> + +<dl> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fshow-column"><b>-f[no-]show-column</b>: Print column number in +diagnostic.</dt> +<dd>This option, which defaults to on, controls whether or not Clang prints the +column number of a diagnostic. For example, when this is enabled, Clang will +print something like: + +<pre> + test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ + // +</pre> + +<p>When this is disabled, Clang will print "test.c:28: warning..." with no +column number.</p> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fshow-source-location"><b>-f[no-]show-source-location</b>: Print +source file/line/column information in diagnostic.</dt> +<dd>This option, which defaults to on, controls whether or not Clang prints the +filename, line number and column number of a diagnostic. For example, +when this is enabled, Clang will print something like: + +<pre> + test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ + // +</pre> + +<p>When this is disabled, Clang will not print the "test.c:28:8: " part.</p> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fcaret-diagnostics"><b>-f[no-]caret-diagnostics</b>: Print source +line and ranges from source code in diagnostic.</dt> +<dd>This option, which defaults to on, controls whether or not Clang prints the +source line, source ranges, and caret when emitting a diagnostic. For example, +when this is enabled, Clang will print something like: + +<pre> + test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ + // +</pre> +</dd> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fcolor_diagnostics"><b>-f[no-]color-diagnostics</b>: </dt> +<dd>This option, which defaults to on when a color-capable terminal is + detected, controls whether or not Clang prints diagnostics in color. + When this option is enabled, Clang will use colors to highlight + specific parts of the diagnostic, e.g., + <pre> + <b><span style="color:black">test.c:28:8: <span style="color:magenta">warning</span>: extra tokens at end of #endif directive [-Wextra-tokens]</span></b> + #endif bad + <span style="color:green">^</span> + <span style="color:green">//</span> +</pre> + +<p>When this is disabled, Clang will just print:</p> + +<pre> + test.c:2:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ + // +</pre> +</dd> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-format"><b>-fdiagnostics-format=clang/msvc/vi</b>: +Changes diagnostic output format to better match IDEs and command line tools.</dt> +<dd>This option controls the output format of the filename, line number, and column printed in diagnostic messages. The options, and their affect on formatting a simple conversion diagnostic, follow: + + <dl> + <dt><b>clang</b> (default)</dt> + <dd> + <pre>t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int'</pre> + </dd> + + <dt><b>msvc</b></dt> + <dd> + <pre>t.c(3,11) : warning: conversion specifies type 'char *' but the argument has type 'int'</pre> + </dd> + + <dt><b>vi</b></dt> + <dd> + <pre>t.c +3:11: warning: conversion specifies type 'char *' but the argument has type 'int'</pre> + </dd> + </dl> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-show-name"><b>-f[no-]diagnostics-show-name</b>: +Enable the display of the diagnostic name.</dt> +<dd>This option, which defaults to off, controls whether or not +Clang prints the associated name.<p></p></dd> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-show-option"><b>-f[no-]diagnostics-show-option</b>: +Enable <tt>[-Woption]</tt> information in diagnostic line.</dt> +<dd>This option, which defaults to on, +controls whether or not Clang prints the associated <A +href="#cl_diag_warning_groups">warning group</a> option name when outputting +a warning diagnostic. For example, in this output: + +<pre> + test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ + // +</pre> + +<p>Passing <b>-fno-diagnostics-show-option</b> will prevent Clang from printing +the [<a href="#opt_Wextra-tokens">-Wextra-tokens</a>] information in the +diagnostic. This information tells you the flag needed to enable or disable the +diagnostic, either from the command line or through <a +href="#pragma_GCC_diagnostic">#pragma GCC diagnostic</a>.</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-show-category"><b>-fdiagnostics-show-category=none/id/name</b>: +Enable printing category information in diagnostic line.</dt> +<dd>This option, which defaults to "none", +controls whether or not Clang prints the category associated with a diagnostic +when emitting it. Each diagnostic may or many not have an associated category, +if it has one, it is listed in the diagnostic categorization field of the +diagnostic line (in the []'s). + +<p>For example, a format string warning will produce these three renditions +based on the setting of this option:</p> + +<pre> + t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat] + t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat<b>,1</b>] + t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat<b>,Format String</b>] +</pre> + +<p>This category can be used by clients that want to group diagnostics by +category, so it should be a high level category. We want dozens of these, not +hundreds or thousands of them.</p> +</dd> + + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-fixit-info"><b>-f[no-]diagnostics-fixit-info</b>: +Enable "FixIt" information in the diagnostics output.</dt> +<dd>This option, which defaults to on, controls whether or not Clang prints the +information on how to fix a specific diagnostic underneath it when it knows. +For example, in this output: + +<pre> + test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ + // +</pre> + +<p>Passing <b>-fno-diagnostics-fixit-info</b> will prevent Clang from printing +the "//" line at the end of the message. This information is useful for users +who may not understand what is wrong, but can be confusing for machine +parsing.</p> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-print-source-range-info"> +<b>-f[no-]diagnostics-print-source-range-info</b>: +Print machine parsable information about source ranges.</dt> +<dd>This option, which defaults to off, controls whether or not Clang prints +information about source ranges in a machine parsable format after the +file/line/column number information. The information is a simple sequence of +brace enclosed ranges, where each range lists the start and end line/column +locations. For example, in this output: + +<pre> +exprs.c:47:15:{47:8-47:14}{47:17-47:24}: error: invalid operands to binary expression ('int *' and '_Complex float') + P = (P-42) + Gamma*4; + ~~~~~~ ^ ~~~~~~~ +</pre> + +<p>The {}'s are generated by -fdiagnostics-print-source-range-info.</p> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-parseable-fixits"> +<b>-fdiagnostics-parseable-fixits</b>: +Print Fix-Its in a machine parseable form.</dt> +<dd><p>This option makes Clang print available Fix-Its in a machine parseable format at the end of diagnostics. The following example illustrates the format:</p> + +<pre> + fix-it:"t.cpp":{7:25-7:29}:"Gamma" +</pre> + +<p>The range printed is a half-open range, so in this example the characters at +column 25 up to but not including column 29 on line 7 in t.cpp should be +replaced with the string "Gamma". Either the range or the replacement +string may be empty (representing strict insertions and strict erasures, +respectively). Both the file name and the insertion string escape backslash (as +"\\"), tabs (as "\t"), newlines (as "\n"), double +quotes(as "\"") and non-printable characters (as octal +"\xxx").</p> +</dd> + +</dl> + + + +<!-- ===================================================== --> +<h4 id="cl_diag_warning_groups">Individual Warning Groups</h4> +<!-- ===================================================== --> + +<p>TODO: Generate this from tblgen. Define one anchor per warning group.</p> + + +<dl> + + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_Wextra-tokens"><b>-Wextra-tokens</b>: Warn about excess tokens at + the end of a preprocessor directive.</dt> +<dd>This option, which defaults to on, enables warnings about extra tokens at +the end of preprocessor directives. For example: + +<pre> + test.c:28:8: warning: extra tokens at end of #endif directive [-Wextra-tokens] + #endif bad + ^ +</pre> + +<p>These extra tokens are not strictly conforming, and are usually best handled +by commenting them out.</p> + +<p>This option is also enabled by <a href="">-Wfoo</a>, <a href="">-Wbar</a>, + and <a href="">-Wbaz</a>.</p> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_Wambiguous-member-template"><b>-Wambiguous-member-template</b>: +Warn about unqualified uses of a member template whose name resolves +to another template at the location of the use.</dt> +<dd>This option, which defaults to on, enables a warning in the +following code: + +<pre> +template<typename T> struct set{}; +template<typename T> struct trait { typedef const T& type; }; +struct Value { + template<typename T> void set(typename trait<T>::type value) {} +}; +void foo() { + Value v; + v.set<double>(3.2); +} +</pre> + +<p>C++ [basic.lookup.classref] requires this to be an error, but, +because it's hard to work around, Clang downgrades it to a warning as +an extension.</p> +</dd> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_Wbind-to-temporary-copy"><b>-Wbind-to-temporary-copy</b>: Warn about +an unusable copy constructor when binding a reference to a temporary.</dt> +<dd>This option, which defaults to on, enables warnings about binding a +reference to a temporary when the temporary doesn't have a usable copy +constructor. For example: + +<pre> + struct NonCopyable { + NonCopyable(); + private: + NonCopyable(const NonCopyable&); + }; + void foo(const NonCopyable&); + void bar() { + foo(NonCopyable()); // Disallowed in C++98; allowed in C++11. + } +</pre> +<pre> + struct NonCopyable2 { + NonCopyable2(); + NonCopyable2(NonCopyable2&); + }; + void foo(const NonCopyable2&); + void bar() { + foo(NonCopyable2()); // Disallowed in C++98; allowed in C++11. + } +</pre> + +<p>Note that if <tt>NonCopyable2::NonCopyable2()</tt> has a default +argument whose instantiation produces a compile error, that error will +still be a hard error in C++98 mode even if this warning is turned +off.</p> + +</dd> + +</dl> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="cl_crash_diagnostics">Options to Control Clang Crash Diagnostics</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>As unbelievable as it may sound, Clang does crash from time to time. +Generally, this only occurs to those living on the +<a href="http://llvm.org/releases/download.html#svn">bleeding edge</a>. Clang +goes to great lengths to assist you in filing a bug report. Specifically, Clang +generates preprocessed source file(s) and associated run script(s) upon a +crash. These files should be attached to a bug report to ease reproducibility +of the failure. Below are the command line options to control the crash +diagnostics. +</p> + +<p><b>-fno-crash-diagnostics</b>: Disable auto-generation of preprocessed +source files during a clang crash.</p> + +<p>The -fno-crash-diagnostics flag can be helpful for speeding the process of +generating a delta reduced test case.</p> + + +<!-- ======================================================================= --> +<h2 id="general_features">Language and Target-Independent Features</h2> +<!-- ======================================================================= --> + + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="diagnostics">Controlling Errors and Warnings</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>Clang provides a number of ways to control which code constructs cause it to +emit errors and warning messages, and how they are displayed to the console.</p> + +<h4 id="diagnostics_display">Controlling How Clang Displays Diagnostics</h4> + +<p>When Clang emits a diagnostic, it includes rich information in the output, +and gives you fine-grain control over which information is printed. Clang has +the ability to print this information, and these are the options that control +it:</p> + +<ol> +<li>A file/line/column indicator that shows exactly where the diagnostic occurs + in your code [<a href="#opt_fshow-column">-fshow-column</a>, <a + href="#opt_fshow-source-location">-fshow-source-location</a>].</li> +<li>A categorization of the diagnostic as a note, warning, error, or fatal + error.</li> +<li>A text string that describes what the problem is.</li> +<li>An option that indicates how to control the diagnostic (for diagnostics that + support it) [<a + href="#opt_fdiagnostics-show-option">-fdiagnostics-show-option</a>].</li> +<li>A <a href="#diagnostics_categories">high-level category</a> for the + diagnostic for clients that want to group diagnostics by class (for + diagnostics that support it) [<a + href="#opt_fdiagnostics-show-category">-fdiagnostics-show-category</a>].</li> +<li>The line of source code that the issue occurs on, along with a caret and + ranges that indicate the important locations [<a + href="opt_fcaret-diagnostics">-fcaret-diagnostics</a>].</li> +<li>"FixIt" information, which is a concise explanation of how to fix the + problem (when Clang is certain it knows) [<a + href="opt_fdiagnostics-fixit-info">-fdiagnostics-fixit-info</a>].</li> +<li>A machine-parsable representation of the ranges involved (off by + default) [<a + href="opt_fdiagnostics-print-source-range-info">-fdiagnostics-print-source-range-info</a>].</li> +</ol> + +<p>For more information please see <a href="#cl_diag_formatting">Formatting of +Diagnostics</a>.</p> + + +<h4 id="diagnostics_mappings">Diagnostic Mappings</h4> + +<p>All diagnostics are mapped into one of these 5 classes:</p> + +<ul> +<li>Ignored</li> +<li>Note</li> +<li>Warning</li> +<li>Error</li> +<li>Fatal</li> +</ul> + +<h4 id="diagnostics_categories">Diagnostic Categories</h4> + +<p>Though not shown by default, diagnostics may each be associated with a + high-level category. This category is intended to make it possible to triage + builds that produce a large number of errors or warnings in a grouped way. +</p> + +<p>Categories are not shown by default, but they can be turned on with the +<a href="#opt_fdiagnostics-show-category">-fdiagnostics-show-category</a> option. +When set to "<tt>name</tt>", the category is printed textually in the diagnostic +output. When it is set to "<tt>id</tt>", a category number is printed. The +mapping of category names to category id's can be obtained by running '<tt>clang + --print-diagnostic-categories</tt>'. +</p> + +<h4 id="diagnostics_commandline">Controlling Diagnostics via Command Line + Flags</h4> + +<p>-W flags, -pedantic, etc</p> + +<h4 id="diagnostics_pragmas">Controlling Diagnostics via Pragmas</h4> + +<p>Clang can also control what diagnostics are enabled through the use of +pragmas in the source code. This is useful for turning off specific warnings +in a section of source code. Clang supports GCC's pragma for compatibility +with existing source code, as well as several extensions. </p> + +<p>The pragma may control any warning that can be used from the command line. +Warnings may be set to ignored, warning, error, or fatal. The following +example code will tell Clang or GCC to ignore the -Wall warnings:</p> + +<pre> +#pragma GCC diagnostic ignored "-Wall" +</pre> + +<p>In addition to all of the functionality provided by GCC's pragma, Clang +also allows you to push and pop the current warning state. This is particularly +useful when writing a header file that will be compiled by other people, because +you don't know what warning flags they build with.</p> + +<p>In the below example +-Wmultichar is ignored for only a single line of code, after which the +diagnostics return to whatever state had previously existed.</p> + +<pre> +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmultichar" + +char b = 'df'; // no warning. + +#pragma clang diagnostic pop +</pre> + +<p>The push and pop pragmas will save and restore the full diagnostic state of +the compiler, regardless of how it was set. That means that it is possible to +use push and pop around GCC compatible diagnostics and Clang will push and pop +them appropriately, while GCC will ignore the pushes and pops as unknown +pragmas. It should be noted that while Clang supports the GCC pragma, Clang and +GCC do not support the exact same set of warnings, so even when using GCC +compatible #pragmas there is no guarantee that they will have identical behaviour +on both compilers. </p> + +<h4 id="diagnostics_enable_everything">Enabling All Warnings</h4> + +<p>In addition to the traditional <tt>-W</tt> flags, one can enable <b>all</b> + warnings by passing <tt>-Weverything</tt>. + This works as expected with <tt>-Werror</tt>, + and also includes the warnings from <tt>-pedantic</tt>.</p> + +<p>Note that when combined with <tt>-w</tt> (which disables all warnings), that + flag wins.</p> + +<h4 id="analyzer_diagnositics">Controlling Static Analyzer Diagnostics</h4> + +<p>While not strictly part of the compiler, the diagnostics from Clang's <a +href="http://clang-analyzer.llvm.org">static analyzer</a> can also be influenced +by the user via changes to the source code. This can be done in two ways: + +<ul> + +<li id="analyzer_annotations"><b>Annotations</b>: The static analyzer recognizes various GCC-style +attributes (e.g., <tt>__attribute__((nonnull)))</tt>) that can either suppress +static analyzer warnings or teach the analyzer about code invariants which +enable it to find more bugs. While many of these attributes are standard GCC +attributes, additional ones have been added to Clang to specifically support the +static analyzer. Detailed information on these annotations can be found in the +<a href="http://clang-analyzer.llvm.org/annotations.html">analyzer's +documentation</a>.</li> + +<li><b><tt>__clang_analyzer__</tt></b>: When the static analyzer is using Clang +to parse source files, it implicitly defines the preprocessor macro +<tt>__clang_analyzer__</tt>. While discouraged, code can use this macro to +selectively exclude code the analyzer examines. Here is an example: + +<pre> +#ifndef __clang_analyzer__ +// Code not to be analyzed +#endif +</pre> + +In general, this usage is discouraged. Instead, we prefer that users file bugs +against the analyzer when it flags false positives. There is also active +discussion of allowing users in the future to selectively silence specific +analyzer warnings (some of which can already be done using <a +href="#analyzer_annotations">annotations</a>).</li> + +</ul> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="precompiledheaders">Precompiled Headers</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p><a href="http://en.wikipedia.org/wiki/Precompiled_header">Precompiled +headers</a> are a general approach employed by many compilers to reduce +compilation time. The underlying motivation of the approach is that it is +common for the same (and often large) header files to be included by +multiple source files. Consequently, compile times can often be greatly improved +by caching some of the (redundant) work done by a compiler to process headers. +Precompiled header files, which represent one of many ways to implement +this optimization, are literally files that represent an on-disk cache that +contains the vital information necessary to reduce some of the work +needed to process a corresponding header file. While details of precompiled +headers vary between compilers, precompiled headers have been shown to be +highly effective at speeding up program compilation on systems with very large +system headers (e.g., Mac OS/X).</p> + +<h4>Generating a PCH File</h4> + +<p>To generate a PCH file using Clang, one invokes Clang with +the <b><tt>-x <i><language></i>-header</tt></b> option. This mirrors the +interface in GCC for generating PCH files:</p> + +<pre> + $ gcc -x c-header test.h -o test.h.gch + $ clang -x c-header test.h -o test.h.pch +</pre> + +<h4>Using a PCH File</h4> + +<p>A PCH file can then be used as a prefix header when a +<b><tt>-include</tt></b> option is passed to <tt>clang</tt>:</p> + +<pre> + $ clang -include test.h test.c -o test +</pre> + +<p>The <tt>clang</tt> driver will first check if a PCH file for <tt>test.h</tt> +is available; if so, the contents of <tt>test.h</tt> (and the files it includes) +will be processed from the PCH file. Otherwise, Clang falls back to +directly processing the content of <tt>test.h</tt>. This mirrors the behavior of +GCC.</p> + +<p><b>NOTE:</b> Clang does <em>not</em> automatically use PCH files +for headers that are directly included within a source file. For example:</p> + +<pre> + $ clang -x c-header test.h -o test.h.pch + $ cat test.c + #include "test.h" + $ clang test.c -o test +</pre> + +<p>In this example, <tt>clang</tt> will not automatically use the PCH file for +<tt>test.h</tt> since <tt>test.h</tt> was included directly in the source file +and not specified on the command line using <tt>-include</tt>.</p> + +<h4>Relocatable PCH Files</h4> +<p>It is sometimes necessary to build a precompiled header from headers that +are not yet in their final, installed locations. For example, one might build a +precompiled header within the build tree that is then meant to be installed +alongside the headers. Clang permits the creation of "relocatable" precompiled +headers, which are built with a given path (into the build directory) and can +later be used from an installed location.</p> + +<p>To build a relocatable precompiled header, place your headers into a +subdirectory whose structure mimics the installed location. For example, if you +want to build a precompiled header for the header <code>mylib.h</code> that +will be installed into <code>/usr/include</code>, create a subdirectory +<code>build/usr/include</code> and place the header <code>mylib.h</code> into +that subdirectory. If <code>mylib.h</code> depends on other headers, then +they can be stored within <code>build/usr/include</code> in a way that mimics +the installed location.</p> + +<p>Building a relocatable precompiled header requires two additional arguments. +First, pass the <code>--relocatable-pch</code> flag to indicate that the +resulting PCH file should be relocatable. Second, pass +<code>-isysroot /path/to/build</code>, which makes all includes for your +library relative to the build directory. For example:</p> + +<pre> + # clang -x c-header --relocatable-pch -isysroot /path/to/build /path/to/build/mylib.h mylib.h.pch +</pre> + +<p>When loading the relocatable PCH file, the various headers used in the PCH +file are found from the system header root. For example, <code>mylib.h</code> +can be found in <code>/usr/include/mylib.h</code>. If the headers are installed +in some other system root, the <code>-isysroot</code> option can be used provide +a different system root from which the headers will be based. For example, +<code>-isysroot /Developer/SDKs/MacOSX10.4u.sdk</code> will look for +<code>mylib.h</code> in +<code>/Developer/SDKs/MacOSX10.4u.sdk/usr/include/mylib.h</code>.</p> + +<p>Relocatable precompiled headers are intended to be used in a limited number +of cases where the compilation environment is tightly controlled and the +precompiled header cannot be generated after headers have been installed. +Relocatable precompiled headers also have some performance impact, because +the difference in location between the header locations at PCH build time vs. +at the time of PCH use requires one of the PCH optimizations, +<code>stat()</code> caching, to be disabled. However, this change is only +likely to affect PCH files that reference a large number of headers.</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="codegen">Controlling Code Generation</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>Clang provides a number of ways to control code generation. The options are listed below.</p> + +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dl> +<dt id="opt_fcatch-undefined-behavior"><b>-fcatch-undefined-behavior</b>: Turn +on runtime code generation to check for undefined behavior.</dt> + +<dd>This option, which defaults to off, controls whether or not Clang +adds runtime checks for undefined runtime behavior. If a check fails, +<tt>__builtin_trap()</tt> is used to indicate failure. +The checks are: +<ul> +<li>Subscripting where the static type of one operand is a variable + which is decayed from an array type and the other operand is + greater than the size of the array or less than zero.</li> +<li>Shift operators where the amount shifted is greater or equal to the + promoted bit-width of the left-hand-side or less than zero.</li> +<li>If control flow reaches __builtin_unreachable. +<li>When llvm implements more __builtin_object_size support, reads and + writes for objects that __builtin_object_size indicates we aren't + accessing valid memory. Bit-fields and vectors are not yet checked. +</ul> +</dd> + +<dt id="opt_faddress-sanitizer"><b>-f[no-]address-sanitizer</b>: +Turn on <a href="AddressSanitizer.html">AddressSanitizer</a>, +a memory error detector. + +<dt id="opt_fthread-sanitizer"><b>-f[no-]thread-sanitizer</b>: +Turn on ThreadSanitizer, an <em>experimental</em> data race detector. +Not ready for widespread use. + +<dt id="opt_fno-assume-sane-operator-new"><b>-fno-assume-sane-operator-new</b>: +Don't assume that the C++'s new operator is sane.</dt> +<dd>This option tells the compiler to do not assume that C++'s global new +operator will always return a pointer that does not +alias any other pointer when the function returns.</dd> + +<dt id="opt_ftrap-function"><b>-ftrap-function=[name]</b>: Instruct code +generator to emit a function call to the specified function name for +<tt>__builtin_trap()</tt>.</dt> + +<dd>LLVM code generator translates <tt>__builtin_trap()</tt> to a trap +instruction if it is supported by the target ISA. Otherwise, the builtin is +translated into a call to <tt>abort</tt>. If this option is set, then the code +generator will always lower the builtin to a call to the specified function +regardless of whether the target ISA has a trap instruction. This option is +useful for environments (e.g. deeply embedded) where a trap cannot be properly +handled, or when some custom behavior is desired.</dd> +</dl> + +<!-- ======================================================================= --> +<h2 id="c">C Language Features</h2> +<!-- ======================================================================= --> + +<p>The support for standard C in clang is feature-complete except for the C99 +floating-point pragmas.</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="c_ext">Extensions supported by clang</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>See <a href="LanguageExtensions.html">clang language extensions</a>.</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="c_modes">Differences between various standard modes</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>clang supports the -std option, which changes what language mode clang uses. +The supported modes for C are c89, gnu89, c94, c99, gnu99 and various aliases +for those modes. If no -std option is specified, clang defaults to gnu99 mode. +</p> + +<p>Differences between all c* and gnu* modes:</p> +<ul> +<li>c* modes define "__STRICT_ANSI__".</li> +<li>Target-specific defines not prefixed by underscores, like "linux", are +defined in gnu* modes.</li> +<li>Trigraphs default to being off in gnu* modes; they can be enabled by the +-trigraphs option.</li> +<li>The parser recognizes "asm" and "typeof" as keywords in gnu* modes; the +variants "__asm__" and "__typeof__" are recognized in all modes.</li> +<li>The Apple "blocks" extension is recognized by default in gnu* modes +on some platforms; it can be enabled in any mode with the "-fblocks" +option.</li> +<li>Arrays that are VLA's according to the standard, but which can be constant + folded by the frontend are treated as fixed size arrays. This occurs for + things like "int X[(1, 2)];", which is technically a VLA. c* modes are + strictly compliant and treat these as VLAs.</li> +</ul> + +<p>Differences between *89 and *99 modes:</p> +<ul> +<li>The *99 modes default to implementing "inline" as specified in C99, while +the *89 modes implement the GNU version. This can be overridden for individual +functions with the __gnu_inline__ attribute.</li> +<li>Digraphs are not recognized in c89 mode.</li> +<li>The scope of names defined inside a "for", "if", "switch", "while", or "do" +statement is different. (example: "if ((struct x {int x;}*)0) {}".)</li> +<li>__STDC_VERSION__ is not defined in *89 modes.</li> +<li>"inline" is not recognized as a keyword in c89 mode.</li> +<li>"restrict" is not recognized as a keyword in *89 modes.</li> +<li>Commas are allowed in integer constant expressions in *99 modes.</li> +<li>Arrays which are not lvalues are not implicitly promoted to pointers in +*89 modes.</li> +<li>Some warnings are different.</li> +</ul> + +<p>c94 mode is identical to c89 mode except that digraphs are enabled in +c94 mode (FIXME: And __STDC_VERSION__ should be defined!).</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="c_unimpl_gcc">GCC extensions not implemented yet</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>clang tries to be compatible with gcc as much as possible, but some gcc +extensions are not implemented yet:</p> + +<ul> + +<li>clang does not support #pragma weak +(<a href="http://llvm.org/bugs/show_bug.cgi?id=3679">bug 3679</a>). Due to +the uses described in the bug, this is likely to be implemented at some +point, at least partially.</li> + +<li>clang does not support decimal floating point types (_Decimal32 and +friends) or fixed-point types (_Fract and friends); nobody has expressed +interest in these features yet, so it's hard to say when they will be +implemented.</li> + +<li>clang does not support nested functions; this is a complex feature which +is infrequently used, so it is unlikely to be implemented anytime soon.</li> + +<li>clang does not support global register variables, this is unlikely +to be implemented soon because it requires additional LLVM backend support. +</li> + +<li>clang does not support static initialization of flexible array +members. This appears to be a rarely used extension, but could be +implemented pending user demand.</li> + +<li>clang does not support __builtin_va_arg_pack/__builtin_va_arg_pack_len. +This is used rarely, but in some potentially interesting places, like the +glibc headers, so it may be implemented pending user demand. Note that +because clang pretends to be like GCC 4.2, and this extension was introduced +in 4.3, the glibc headers will not try to use this extension with clang at +the moment.</li> + +<li>clang does not support the gcc extension for forward-declaring function +parameters; this has not showed up in any real-world code yet, though, so it +might never be implemented.</li> + +</ul> + +<p>This is not a complete list; if you find an unsupported extension +missing from this list, please send an e-mail to cfe-dev. This list +currently excludes C++; see <a href="#cxx">C++ Language Features</a>. +Also, this list does not include bugs in mostly-implemented features; please +see the <a href="http://llvm.org/bugs/buglist.cgi?quicksearch=product%3Aclang+component%3A-New%2BBugs%2CAST%2CBasic%2CDriver%2CHeaders%2CLLVM%2BCodeGen%2Cparser%2Cpreprocessor%2CSemantic%2BAnalyzer"> +bug tracker</a> for known existing bugs (FIXME: Is there a section for +bug-reporting guidelines somewhere?).</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="c_unsupp_gcc">Intentionally unsupported GCC extensions</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<ul> + +<li>clang does not support the gcc extension that allows variable-length arrays +in structures. This is for a few reasons: one, it is tricky +to implement, two, the extension is completely undocumented, and three, the +extension appears to be rarely used. Note that clang <em>does</em> support +flexible array members (arrays with a zero or unspecified size at the end of +a structure).</li> + +<li>clang does not have an equivalent to gcc's "fold"; this means that +clang doesn't accept some constructs gcc might accept in contexts where a +constant expression is required, like "x-x" where x is a variable.</li> + +<li>clang does not support __builtin_apply and friends; this extension is +extremely obscure and difficult to implement reliably.</li> + +</ul> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="c_ms">Microsoft extensions</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p>clang has some experimental support for extensions from +Microsoft Visual C++; to enable it, use the -fms-extensions command-line +option. This is the default for Windows targets. Note that the +support is incomplete; enabling Microsoft extensions will silently drop +certain constructs (including __declspec and Microsoft-style asm statements). +</p> + +<ul> +<li>clang allows setting _MSC_VER with -fmsc-version=. It defaults to 1300 which +is the same as Visual C/C++ 2003. Any number is supported and can greatly affect +what Windows SDK and c++stdlib headers clang can compile. This option will be +removed when clang supports the full set of MS extensions required for these +headers.</li> + +<li>clang does not support the Microsoft extension where anonymous +record members can be declared using user defined typedefs.</li> + +<li>clang supports the Microsoft "#pragma pack" feature for +controlling record layout. GCC also contains support for this feature, +however where MSVC and GCC are incompatible clang follows the MSVC +definition.</li> +</ul> + +<!-- ======================================================================= --> +<h2 id="cxx">C++ Language Features</h2> +<!-- ======================================================================= --> + +<p>clang fully implements all of standard C++98 except for exported templates +(which were removed in C++11), and +<a href="http://clang.llvm.org/cxx_status.html">many C++11 features</a> are also +implemented.</p> + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="cxx_implimits">Controlling implementation limits</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<p><b>-fconstexpr-depth=N</b>: Sets the limit for recursive constexpr function +invocations to N. The default is 512.</p> + +<p><b>-ftemplate-depth=N</b>: Sets the limit for recursively nested template +instantiations to N. The default is 1024.</p> + +<!-- ======================================================================= --> +<h2 id="target_features">Target-Specific Features and Limitations</h2> +<!-- ======================================================================= --> + + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="target_arch">CPU Architectures Features and Limitations</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<!-- ======================== --> +<h4 id="target_arch_x86">X86</h4> +<!-- ======================== --> + +<p>The support for X86 (both 32-bit and 64-bit) is considered stable on Darwin +(Mac OS/X), Linux, FreeBSD, and Dragonfly BSD: it has been tested to correctly +compile many large C, C++, Objective-C, and Objective-C++ codebases.</p> + +<p>On x86_64-mingw32, passing i128(by value) is incompatible to Microsoft x64 +calling conversion. You might need to tweak WinX86_64ABIInfo::classify() +in lib/CodeGen/TargetInfo.cpp.</p> + +<!-- ======================== --> +<h4 id="target_arch_arm">ARM</h4> +<!-- ======================== --> + +<p>The support for ARM (specifically ARMv6 and ARMv7) is considered stable on +Darwin (iOS): it has been tested to correctly compile many large C, C++, +Objective-C, and Objective-C++ codebases. Clang only supports a limited number +of ARM architectures. It does not yet fully support ARMv5, for example.</p> + +<!-- ======================== --> +<h4 id="target_arch_other">Other platforms</h4> +<!-- ======================== --> +clang currently contains some support for PPC and Sparc; however, significant +pieces of code generation are still missing, and they haven't undergone +significant testing. + +<p>clang contains limited support for the MSP430 embedded processor, but both +the clang support and the LLVM backend support are highly experimental. + +<p>Other platforms are completely unsupported at the moment. Adding the +minimal support needed for parsing and semantic analysis on a new platform +is quite easy; see lib/Basic/Targets.cpp in the clang source tree. This level +of support is also sufficient for conversion to LLVM IR for simple programs. +Proper support for conversion to LLVM IR requires adding code to +lib/CodeGen/CGCall.cpp at the moment; this is likely to change soon, though. +Generating assembly requires a suitable LLVM backend. + +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> +<h3 id="target_os">Operating System Features and Limitations</h3> +<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> + +<!-- ======================================= --> +<h4 id="target_os_darwin">Darwin (Mac OS/X)</h4> +<!-- ======================================= --> + +<p>No __thread support, 64-bit ObjC support requires SL tools.</p> + +<!-- ======================================= --> +<h4 id="target_os_win32">Windows</h4> +<!-- ======================================= --> + +<p>Experimental supports are on Cygming.</p> + +<h5>Cygwin</h5> + +<p>Clang works on Cygwin-1.7.</p> + +<h5>MinGW32</h5> + +<p>Clang works on some mingw32 distributions. +Clang assumes directories as below;</p> + +<ul> +<li><tt>C:/mingw/include</tt></li> +<li><tt>C:/mingw/lib</tt></li> +<li><tt>C:/mingw/lib/gcc/mingw32/4.[3-5].0/include/c++</tt></li> +</ul> + +<p>On MSYS, a few tests might fail.</p> + +<h5>MinGW-w64</h5> + +<p>For 32-bit (i686-w64-mingw32), and 64-bit (x86_64-w64-mingw32), Clang assumes as below;<p> + +<ul> +<li><tt>GCC versions 4.5.0 to 4.5.3, 4.6.0 to 4.6.2, or 4.7.0 (for the C++ header search path)</tt></li> +<li><tt>some_directory/bin/gcc.exe</tt></li> +<li><tt>some_directory/bin/clang.exe</tt></li> +<li><tt>some_directory/bin/clang++.exe</tt></li> +<li><tt>some_directory/bin/../include/c++/GCC_version</tt></li> +<li><tt>some_directory/bin/../include/c++/GCC_version/x86_64-w64-mingw32</tt></li> +<li><tt>some_directory/bin/../include/c++/GCC_version/i686-w64-mingw32</tt></li> +<li><tt>some_directory/bin/../include/c++/GCC_version/backward</tt></li> +<li><tt>some_directory/bin/../x86_64-w64-mingw32/include</tt></li> +<li><tt>some_directory/bin/../i686-w64-mingw32/include</tt></li> +<li><tt>some_directory/bin/../include</tt></li> +</ul> + +<p>This directory layout is standard for any toolchain you will find on the official <a href="mingw-w64.sourceforge.net">MinGW-w64 website</a>. + +<p>Clang expects the GCC executable "gcc.exe" compiled for i686-w64-mingw32 (or x86_64-w64-mingw32) to be present on PATH.</p> + +<p><a href="http://llvm.org/bugs/show_bug.cgi?id=9072">Some tests might fail</a> +on x86_64-w64-mingw32.</p> + +</div> +</body> +</html> diff --git a/clang/docs/doxygen.cfg.in b/clang/docs/doxygen.cfg.in new file mode 100644 index 0000000..ed9ffcb --- /dev/null +++ b/clang/docs/doxygen.cfg.in @@ -0,0 +1,1230 @@ +# Doxyfile 1.4.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = clang + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @PACKAGE_VERSION@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = @abs_builddir@/doxygen + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, +# Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = ../.. + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +#SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 2 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is YES. + +SHOW_DIRECTORIES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the progam writes to standard output +# is used as the file version. See the manual for examples. + +#FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = NO + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = NO + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +#WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @abs_srcdir@/../include \ + @abs_srcdir@/../lib \ + @abs_srcdir@/doxygen.intro + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @abs_srcdir@/../examples + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = YES + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = @abs_srcdir@/img + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +#USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 4 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = clang:: + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = @abs_srcdir@/doxygen.header + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = @abs_srcdir@/doxygen.footer + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = @abs_srcdir@/doxygen.css + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = letter + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = ../include + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = YES + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = NO + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +#GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +#DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = @DOT@ + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that a graph may be further truncated if the graph's +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), +# the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +#DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +#DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/clang/docs/doxygen.css b/clang/docs/doxygen.css new file mode 100644 index 0000000..9780b98 --- /dev/null +++ b/clang/docs/doxygen.css @@ -0,0 +1,408 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Verdana,Geneva,Arial,Helvetica,sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 140%; + font-weight: bold; +} +H2 { + font-size: 120%; + font-style: italic; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { + text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: Fixed, monospace; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #F4F4FB; font-weight: bold; } +TD.mdPrefix { + background-color: #F4F4FB; + color: #606060; + font-size: 80%; +} +TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } +TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdTable { + border: 1px solid #868686; + background-color: #F4F4FB; +} +.mdRow { + padding: 8px 10px; +} +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #eeeeff; +} +TD.tiny { font-size: 75%; +} +a { + color: #252E78; +} +a:visited { + color: #3D2185; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #b0b0b0; +} +TH.dirtab { background: #eeeeff; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* + * LLVM Modifications. + * Note: Everything above here is generated with "doxygen -w htlm" command. See + * "doxygen --help" for details. What follows are CSS overrides for LLVM + * specific formatting. We want to keep the above so it can be replaced with + * subsequent doxygen upgrades. + */ + +.footer { + font-size: 80%; + font-weight: bold; + text-align: center; + vertical-align: middle; +} +.title { + font-size: 25pt; + color: black; background: url("http://llvm.org/img/lines.gif"); + font-weight: bold; + border-width: 1px; + border-style: solid none solid none; + text-align: center; + vertical-align: middle; + padding-left: 8pt; + padding-top: 1px; + padding-bottom: 2px +} +A:link { + cursor: pointer; + text-decoration: none; + font-weight: bolder; +} +A:visited { + cursor: pointer; + text-decoration: underline; + font-weight: bolder; +} +A:hover { + cursor: pointer; + text-decoration: underline; + font-weight: bolder; +} +A:active { + cursor: pointer; + text-decoration: underline; + font-weight: bolder; + font-style: italic; +} +H1 { + text-align: center; + font-size: 140%; + font-weight: bold; +} +H2 { + font-size: 120%; + font-style: italic; +} +H3 { + font-size: 100%; +} + +H2, H3 { + border-bottom: 2px solid; + margin-top: 2em; +} + +A.qindex {} +A.qindexRef {} +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code { text-decoration: none; font-weight: normal; color: #4444ee } +A.codeRef { font-weight: normal; color: #4444ee } + +div.memitem { + border: 1px solid #999999; + margin-top: 1.0em; + margin-bottom: 1.0em; + -webkit-border-radius: 0.5em; + -webkit-box-shadow: 3px 3px 6px #777777; + -moz-border-radius: 0.5em; + -moz-box-shadow: black 3px 3px 3px; +} + +div.memproto { + background-color: #E3E4E5; + padding: 0.25em 0.5em; + -webkit-border-top-left-radius: 0.5em; + -webkit-border-top-right-radius: 0.5em; + -moz-border-radius-topleft: 0.5em; + -moz-border-radius-topright: 0.5em; +} + +div.memdoc { + padding-left: 1em; + padding-right: 1em; +} diff --git a/clang/docs/doxygen.footer b/clang/docs/doxygen.footer new file mode 100644 index 0000000..524e9a2 --- /dev/null +++ b/clang/docs/doxygen.footer @@ -0,0 +1,10 @@ +<hr> +<p class="footer"> +Generated on $datetime by <a href="http://www.doxygen.org">Doxygen +$doxygenversion</a>.</p> + +<p class="footer"> +See the <a href="http://clang.llvm.org">Main Clang Web Page</a> for more +information.</p> +</body> +</html> diff --git a/clang/docs/doxygen.header b/clang/docs/doxygen.header new file mode 100644 index 0000000..bea5137 --- /dev/null +++ b/clang/docs/doxygen.header @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/> +<meta name="keywords" content="clang,LLVM,Low Level Virtual Machine,C,C++,doxygen,API,frontend,documentation"/> +<meta name="description" content="C++ source code API documentation for clang."/> +<title>clang: $title</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"/> +</head><body> +<p class="title">clang API Documentation</p> diff --git a/clang/docs/doxygen.intro b/clang/docs/doxygen.intro new file mode 100644 index 0000000..accab72 --- /dev/null +++ b/clang/docs/doxygen.intro @@ -0,0 +1,15 @@ +/// @mainpage clang +/// +/// @section main_intro Introduction +/// Welcome to the clang project. +/// +/// This documentation describes the @b internal software that makes +/// up clang, not the @b external use of clang. There are no instructions +/// here on how to use clang, only the APIs that make up the software. For +/// usage instructions, please see the programmer's guide or reference +/// manual. +/// +/// @section main_caveat Caveat +/// This documentation is generated directly from the source code with doxygen. +/// Since clang is constantly under active development, what you're about to +/// read is out of date! diff --git a/clang/docs/tools/Makefile b/clang/docs/tools/Makefile new file mode 100644 index 0000000..5521d6b --- /dev/null +++ b/clang/docs/tools/Makefile @@ -0,0 +1,116 @@ +##===- docs/tools/Makefile ---------------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +ifdef BUILD_FOR_WEBSITE + +# FIXME: This was copied from the CommandGuide makefile. Figure out +# how to get this stuff on the website. + +# This special case is for keeping the CommandGuide on the LLVM web site +# up to date automatically as the documents are checked in. It must build +# the POD files to HTML only and keep them in the src directories. It must also +# build in an unconfigured tree, hence the ifdef. To use this, run +# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script. +SRC_DOC_DIR= +DST_HTML_DIR=html/ +DST_MAN_DIR=man/man1/ +DST_PS_DIR=ps/ +CLANG_VERSION := trunk + +# If we are in BUILD_FOR_WEBSITE mode, default to the all target. +all:: html man ps + +clean: + rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) + +# To create other directories, as needed, and timestamp their creation +%/.dir: + -mkdir $* > /dev/null + date > $@ + +else + +# Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info. +CLANG_LEVEL := ../.. +include $(CLANG_LEVEL)/Makefile + +CLANG_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \ + $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc)) + +SRC_DOC_DIR=$(PROJ_SRC_DIR)/ +DST_HTML_DIR=$(PROJ_OBJ_DIR)/ +DST_MAN_DIR=$(PROJ_OBJ_DIR)/ +DST_PS_DIR=$(PROJ_OBJ_DIR)/ + +endif + + +POD := $(wildcard $(SRC_DOC_DIR)*.pod) +HTML := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_HTML_DIR)%.html, $(POD)) +MAN := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_MAN_DIR)%.1, $(POD)) +PS := $(patsubst $(SRC_DOC_DIR)%.pod, $(DST_PS_DIR)%.ps, $(POD)) + +ifdef ONLY_MAN_DOCS +INSTALL_TARGETS := install-man +else +INSTALL_TARGETS := install-html install-man install-ps +endif + +.SUFFIXES: +.SUFFIXES: .html .pod .1 .ps + +$(DST_HTML_DIR)%.html: %.pod $(DST_HTML_DIR)/.dir + pod2html --css=manpage.css --htmlroot=. \ + --podpath=. --infile=$< --outfile=$@ --title=$* + +$(DST_MAN_DIR)%.1: %.pod $(DST_MAN_DIR)/.dir + pod2man --release "clang $(CLANG_VERSION)" --center="Clang Tools Documentation" $< $@ + +$(DST_PS_DIR)%.ps: $(DST_MAN_DIR)%.1 $(DST_PS_DIR)/.dir + groff -Tps -man $< > $@ + + +html: $(HTML) +man: $(MAN) +ps: $(PS) + +EXTRA_DIST := $(POD) + +clean-local:: + $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) + +HTML_DIR := $(DESTDIR)$(PROJ_docsdir)/html/clang +MAN_DIR := $(DESTDIR)$(PROJ_mandir)/man1 +PS_DIR := $(DESTDIR)$(PROJ_docsdir)/ps + +install-html:: $(HTML) + $(Echo) Installing HTML Clang Tools Documentation + $(Verb) $(MKDIR) $(HTML_DIR) + $(Verb) $(DataInstall) $(HTML) $(HTML_DIR) + $(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR) + +install-man:: $(MAN) + $(Echo) Installing MAN Clang Tools Documentation + $(Verb) $(MKDIR) $(MAN_DIR) + $(Verb) $(DataInstall) $(MAN) $(MAN_DIR) + +install-ps:: $(PS) + $(Echo) Installing PS Clang Tools Documentation + $(Verb) $(MKDIR) $(PS_DIR) + $(Verb) $(DataInstall) $(PS) $(PS_DIR) + +install-local:: $(INSTALL_TARGETS) + +uninstall-local:: + $(Echo) Uninstalling Clang Tools Documentation + $(Verb) $(RM) -rf $(HTML_DIR) $(MAN_DIR) $(PS_DIR) + +printvars:: + $(Echo) "POD : " '$(POD)' + $(Echo) "HTML : " '$(HTML)' diff --git a/clang/docs/tools/clang.pod b/clang/docs/tools/clang.pod new file mode 100644 index 0000000..8f61568 --- /dev/null +++ b/clang/docs/tools/clang.pod @@ -0,0 +1,560 @@ +=pod + +=head1 NAME + +clang - the Clang C, C++, and Objective-C compiler + +=head1 SYNOPSIS + +B<clang> [B<-c>|B<-S>|B<-E>] B<-std=>I<standard> B<-g> + [B<-O0>|B<-O1>|B<-O2>|B<-Os>|B<-Oz>|B<-O3>|B<-O4>] + B<-W>I<warnings...> B<-pedantic> + B<-I>I<dir...> B<-L>I<dir...> + B<-D>I<macro[=defn]> + B<-f>I<feature-option...> + B<-m>I<machine-option...> + B<-o> I<output-file> + B<-stdlib=>I<library> + I<input-filenames> + +=head1 DESCRIPTION + +B<clang> is a C, C++, and Objective-C compiler which encompasses preprocessing, +parsing, optimization, code generation, assembly, and linking. Depending on +which high-level mode setting is passed, Clang will stop before doing a full +link. While Clang is highly integrated, it is important to understand the +stages of compilation, to understand how to invoke it. These stages are: + +=over + +=item B<Driver> + +The B<clang> executable is actually a small driver which controls the overall +execution of other tools such as the compiler, assembler and linker. Typically +you do not need to interact with the driver, but you transparently use it to run +the other tools. + +=item B<Preprocessing> + +This stage handles tokenization of the input source file, macro expansion, +#include expansion and handling of other preprocessor directives. The output of +this stage is typically called a ".i" (for C), ".ii" (for C++), ".mi" (for +Objective-C) , or ".mii" (for Objective-C++) file. + +=item B<Parsing and Semantic Analysis> + +This stage parses the input file, translating preprocessor tokens into a parse +tree. Once in the form of a parser tree, it applies semantic analysis to compute +types for expressions as well and determine whether the code is well formed. This +stage is responsible for generating most of the compiler warnings as well as +parse errors. The output of this stage is an "Abstract Syntax Tree" (AST). + +=item B<Code Generation and Optimization> + +This stage translates an AST into low-level intermediate code (known as "LLVM +IR") and ultimately to machine code. This phase is responsible for optimizing +the generated code and handling target-specific code generation. The output of +this stage is typically called a ".s" file or "assembly" file. + +Clang also supports the use of an integrated assembler, in which the code +generator produces object files directly. This avoids the overhead of generating +the ".s" file and of calling the target assembler. + +=item B<Assembler> + +This stage runs the target assembler to translate the output of the compiler +into a target object file. The output of this stage is typically called a ".o" +file or "object" file. + +=item B<Linker> + +This stage runs the target linker to merge multiple object files into an +executable or dynamic library. The output of this stage is typically called an +"a.out", ".dylib" or ".so" file. + +=back + +The Clang compiler supports a large number of options to control each of these +stages. In addition to compilation of code, Clang also supports other tools: + +B<Clang Static Analyzer> + +The Clang Static Analyzer is a tool that scans source code to try to find bugs +through code analysis. This tool uses many parts of Clang and is built into the +same driver. + + +=head1 OPTIONS + +=head2 Stage Selection Options + +=over + +=item B<-E> + +Run the preprocessor stage. + +=item B<-fsyntax-only> + +Run the preprocessor, parser and type checking stages. + +=item B<-S> + +Run the previous stages as well as LLVM generation and optimization stages and +target-specific code generation, producing an assembly file. + +=item B<-c> + +Run all of the above, plus the assembler, generating a target ".o" object file. + +=item B<no stage selection option> + +If no stage selection option is specified, all stages above are run, and the +linker is run to combine the results into an executable or shared library. + +=item B<--analyze> + +Run the Clang Static Analyzer. + +=back + + + +=head2 Language Selection and Mode Options + +=over + +=item B<-x> I<language> + +Treat subsequent input files as having type I<language>. + +=item B<-std>=I<language> + +Specify the language standard to compile for. + +=item B<-stdlib>=I<language> + +Specify the C++ standard library to use; supported options are libstdc++ and +libc++. + +=item B<-ansi> + +Same as B<-std=c89>. + +=item B<-ObjC++> + +Treat source input files as Objective-C++ inputs. + +=item B<-ObjC> + +Treat source input files as Objective-C inputs. + +=item B<-trigraphs> + +Enable trigraphs. + +=item B<-ffreestanding> + +Indicate that the file should be compiled for a freestanding, not a hosted, +environment. + +=item B<-fno-builtin> + +Disable special handling and optimizations of builtin functions like strlen and +malloc. + +=item B<-fmath-errno> + +Indicate that math functions should be treated as updating errno. + +=item B<-fpascal-strings> + +Enable support for Pascal-style strings with "\pfoo". + +=item B<-fms-extensions> + +Enable support for Microsoft extensions. + +=item B<-fmsc-version=> + +Set _MSC_VER. Defaults to 1300 on Windows. Not set otherwise. + +=item B<-fborland-extensions> + +Enable support for Borland extensions. + +=item B<-fwritable-strings> + +Make all string literals default to writable. This disables uniquing of +strings and other optimizations. + +=item B<-flax-vector-conversions> + +Allow loose type checking rules for implicit vector conversions. + +=item B<-fblocks> + +Enable the "Blocks" language feature. + +=item B<-fobjc-gc-only> + +Indicate that Objective-C code should be compiled in GC-only mode, which only +works when Objective-C Garbage Collection is enabled. + +=item B<-fobjc-gc> + +Indicate that Objective-C code should be compiled in hybrid-GC mode, which works +with both GC and non-GC mode. + +=item B<-fobjc-abi-version>=I<version> + +Select the Objective-C ABI version to use. Available versions are 1 (legacy +"fragile" ABI), 2 (non-fragile ABI 1), and 3 (non-fragile ABI 2). + +=item B<-fobjc-nonfragile-abi-version>=I<version> + +Select the Objective-C non-fragile ABI version to use by default. This will only +be used as the Objective-C ABI when the non-fragile ABI is enabled (either via +-fobjc-nonfragile-abi, or because it is the platform default). + +=item B<-fobjc-nonfragile-abi> + +Enable use of the Objective-C non-fragile ABI. On platforms for which this is +the default ABI, it can be disabled with B<-fno-objc-nonfragile-abi>. + +=back + + + +=head2 Target Selection Options + +Clang fully supports cross compilation as an inherent part of its design. +Depending on how your version of Clang is configured, it may have support for +a number of cross compilers, or may only support a native target. + +=over + +=item B<-arch> I<architecture> + +Specify the architecture to build for. + +=item B<-mmacosx-version-min>=I<version> + +When building for Mac OS/X, specify the minimum version supported by your +application. + +=item B<-miphoneos-version-min> + +When building for iPhone OS, specify the minimum version supported by your +application. + + +=item B<-march>=I<cpu> + +Specify that Clang should generate code for a specific processor family member +and later. For example, if you specify -march=i486, the compiler is allowed to +generate instructions that are valid on i486 and later processors, but which +may not exist on earlier ones. + +=back + + +=head2 Code Generation Options + +=over + +=item B<-O0> B<-O1> B<-O2> B<-Os> B<-Oz> B<-O3> B<-O4> + +Specify which optimization level to use. B<-O0> means "no optimization": this +level compiles the fastest and generates the most debuggable code. B<-O2> is a +moderate level of optimization which enables most optimizations. B<-Os> is like +B<-O2> with extra optimizations to reduce code size. B<-Oz> is like B<-Os> +(and thus B<-O2>), but reduces code size further. B<-O3> is like B<-O2>, +except that it enables optimizations that take longer to perform or that may +generate larger code (in an attempt to make the program run faster). On +supported platforms, B<-O4> enables link-time optimization; object files are +stored in the LLVM bitcode file format and whole program optimization is done at +link time. B<-O1> is somewhere between B<-O0> and B<-O2>. + +=item B<-g> + +Generate debug information. Note that Clang debug information works best at +B<-O0>. At higher optimization levels, only line number information is +currently available. + +=item B<-fexceptions> + +Enable generation of unwind information, this allows exceptions to be thrown +through Clang compiled stack frames. This is on by default in x86-64. + +=item B<-ftrapv> + +Generate code to catch integer overflow errors. Signed integer overflow is +undefined in C, with this flag, extra code is generated to detect this and abort +when it happens. + + +=item B<-fvisibility> + +This flag sets the default visibility level. + +=item B<-fcommon> + +This flag specifies that variables without initializers get common linkage. It +can be disabled with B<-fno-common>. + +=item B<-flto> B<-emit-llvm> + +Generate output files in LLVM formats, suitable for link time optimization. When +used with B<-S> this generates LLVM intermediate language assembly files, +otherwise this generates LLVM bitcode format object files (which may be passed +to the linker depending on the stage selection options). + +=cut + +##=item B<-fnext-runtime> B<-fobjc-nonfragile-abi> B<-fgnu-runtime> +##These options specify which Objective-C runtime the code generator should +##target. FIXME: we don't want people poking these generally. + +=pod + +=back + + +=head2 Driver Options + +=over + +=item B<-###> + +Print the commands to run for this compilation. + +=item B<--help> + +Display available options. + +=item B<-Qunused-arguments> + +Don't emit warning for unused driver arguments. + +=item B<-Wa,>I<args> + +Pass the comma separated arguments in I<args> to the assembler. + +=item B<-Wl,>I<args> + +Pass the comma separated arguments in I<args> to the linker. + +=item B<-Wp,>I<args> + +Pass the comma separated arguments in I<args> to the preprocessor. + +=item B<-Xanalyzer> I<arg> + +Pass I<arg> to the static analyzer. + +=item B<-Xassembler> I<arg> + +Pass I<arg> to the assembler. + +=item B<-Xlinker> I<arg> + +Pass I<arg> to the linker. + +=item B<-Xpreprocessor> I<arg> + +Pass I<arg> to the preprocessor. + +=item B<-o> I<file> + +Write output to I<file>. + +=item B<-print-file-name>=I<file> + +Print the full library path of I<file>. + +=item B<-print-libgcc-file-name> + +Print the library path for "libgcc.a". + +=item B<-print-prog-name>=I<name> + +Print the full program path of I<name>. + +=item B<-print-search-dirs> + +Print the paths used for finding libraries and programs. + +=item B<-save-temps> + +Save intermediate compilation results. + +=item B<-integrated-as> B<-no-integrated-as> + +Used to enable and disable, respectively, the use of the integrated +assembler. Whether the integrated assembler is on by default is target +dependent. + +=item B<-time> + +Time individual commands. + +=item B<-ftime-report> + +Print timing summary of each stage of compilation. + +=item B<-v> + +Show commands to run and use verbose output. + +=back + + +=head2 Diagnostics Options + +=over + +=item B<-fshow-column> +B<-fshow-source-location> +B<-fcaret-diagnostics> +B<-fdiagnostics-fixit-info> +B<-fdiagnostics-parseable-fixits> +B<-fdiagnostics-print-source-range-info> +B<-fprint-source-range-info> +B<-fdiagnostics-show-option> +B<-fmessage-length> + +These options control how Clang prints out information about diagnostics (errors +and warnings). Please see the Clang User's Manual for more information. + +=back + + +=head2 Preprocessor Options + +=over + +=item B<-D>I<macroname=value> + +Adds an implicit #define into the predefines buffer which is read before the +source file is preprocessed. + +=item B<-U>I<macroname> + +Adds an implicit #undef into the predefines buffer which is read before the +source file is preprocessed. + +=item B<-include> I<filename> + +Adds an implicit #include into the predefines buffer which is read before the +source file is preprocessed. + +=item B<-I>I<directory> + +Add the specified directory to the search path for include files. + +=item B<-F>I<directory> + +Add the specified directory to the search path for framework include files. + +=item B<-nostdinc> + +Do not search the standard system directories or compiler builtin directories +for include files. + +=item B<-nostdlibinc> + +Do not search the standard system directories for include files, but do search +compiler builtin include directories. + +=item B<-nobuiltininc> + +Do not search clang's builtin directory for include files. + +=cut + +## TODO, but do we really want people using this stuff? +#=item B<-idirafter>I<directory> +#=item B<-iquote>I<directory> +#=item B<-isystem>I<directory> +#=item B<-iprefix>I<directory> +#=item B<-iwithprefix>I<directory> +#=item B<-iwithprefixbefore>I<directory> +#=item B<-isysroot> + +=pod + + +=back + + + +=cut + +### TODO someday. +#=head2 Warning Control Options +#=over +#=back +#=head2 Code Generation and Optimization Options +#=over +#=back +#=head2 Assembler Options +#=over +#=back +#=head2 Linker Options +#=over +#=back +#=head2 Static Analyzer Options +#=over +#=back + +=pod + + +=head1 ENVIRONMENT + +=over + +=item B<TMPDIR>, B<TEMP>, B<TMP> + +These environment variables are checked, in order, for the location to +write temporary files used during the compilation process. + +=item B<CPATH> + +If this environment variable is present, it is treated as a delimited +list of paths to be added to the default system include path list. The +delimiter is the platform dependent delimitor, as used in the I<PATH> +environment variable. + +Empty components in the environment variable are ignored. + +=item B<C_INCLUDE_PATH>, B<OBJC_INCLUDE_PATH>, B<CPLUS_INCLUDE_PATH>, +B<OBJCPLUS_INCLUDE_PATH> + +These environment variables specify additional paths, as for CPATH, +which are only used when processing the appropriate language. + +=item B<MACOSX_DEPLOYMENT_TARGET> + +If -mmacosx-version-min is unspecified, the default deployment target +is read from this environment variable. This option only affects darwin +targets. + +=back + +=head1 BUGS + +To report bugs, please visit L<http://llvm.org/bugs/>. Most bug reports should +include preprocessed source files (use the B<-E> option) and the full output of +the compiler, along with information to reproduce. + +=head1 SEE ALSO + + as(1), ld(1) + +=head1 AUTHOR + +Maintained by the Clang / LLVM Team (L<http://clang.llvm.org>). + +=cut diff --git a/clang/docs/tools/manpage.css b/clang/docs/tools/manpage.css new file mode 100644 index 0000000..c922564 --- /dev/null +++ b/clang/docs/tools/manpage.css @@ -0,0 +1,256 @@ +/* Based on http://www.perldoc.com/css/perldoc.css */ + +@import url("../llvm.css"); + +body { font-family: Arial,Helvetica; } + +blockquote { margin: 10pt; } + +h1, a { color: #336699; } + + +/*** Top menu style ****/ +.mmenuon { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ff6600; font-size: 10pt; +} +.mmenuoff { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ffffff; font-size: 10pt; +} +.cpyright { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ffffff; font-size: xx-small; +} +.cpyrightText { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #ffffff; font-size: xx-small; +} +.sections { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 11pt; +} +.dsections { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 12pt; +} +.slink { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #000000; font-size: 9pt; +} + +.slink2 { font-family: Arial,Helvetica; text-decoration: none; color: #336699; } + +.maintitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 18pt; +} +.dblArrow { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: small; +} +.menuSec { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: small; +} + +.newstext { + font-family: Arial,Helvetica; font-size: small; +} + +.linkmenu { + font-family: Arial,Helvetica; color: #000000; font-weight: bold; + text-decoration: none; +} + +P { + font-family: Arial,Helvetica; +} + +PRE { + font-size: 10pt; +} +.quote { + font-family: Times; text-decoration: none; + color: #000000; font-size: 9pt; font-style: italic; +} +.smstd { font-family: Arial,Helvetica; color: #000000; font-size: x-small; } +.std { font-family: Arial,Helvetica; color: #000000; } +.meerkatTitle { + font-family: sans-serif; font-size: x-small; color: black; } + +.meerkatDescription { font-family: sans-serif; font-size: 10pt; color: black } +.meerkatCategory { + font-family: sans-serif; font-size: 9pt; font-weight: bold; font-style: italic; + color: brown; } +.meerkatChannel { + font-family: sans-serif; font-size: 9pt; font-style: italic; color: brown; } +.meerkatDate { font-family: sans-serif; font-size: xx-small; color: #336699; } + +.tocTitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #333333; font-size: 10pt; +} + +.toc-item { + font-family: Arial,Helvetica; font-weight: bold; + color: #336699; font-size: 10pt; text-decoration: underline; +} + +.perlVersion { + font-family: Arial,Helvetica; font-weight: bold; + color: #336699; font-size: 10pt; text-decoration: none; +} + +.podTitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #000000; +} + +.docTitle { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #000000; font-size: 10pt; +} +.dotDot { + font-family: Arial,Helvetica; font-weight: bold; + color: #000000; font-size: 9pt; +} + +.docSec { + font-family: Arial,Helvetica; font-weight: normal; + color: #333333; font-size: 9pt; +} +.docVersion { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 10pt; +} + +.docSecs-on { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #ff0000; font-size: 10pt; +} +.docSecs-off { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #333333; font-size: 10pt; +} + +h2 { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: medium; +} +h1 { + font-family: Verdana,Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: large; +} + +DL { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: none; + color: #333333; font-size: 10pt; +} + +UL > LI > A { + font-family: Arial,Helvetica; font-weight: bold; + color: #336699; font-size: 10pt; +} + +.moduleInfo { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #333333; font-size: 11pt; +} + +.moduleInfoSec { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 10pt; +} + +.moduleInfoVal { + font-family: Arial,Helvetica; font-weight: normal; text-decoration: underline; + color: #000000; font-size: 10pt; +} + +.cpanNavTitle { + font-family: Arial,Helvetica; font-weight: bold; + color: #ffffff; font-size: 10pt; +} +.cpanNavLetter { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #333333; font-size: 9pt; +} +.cpanCat { + font-family: Arial,Helvetica; font-weight: bold; text-decoration: none; + color: #336699; font-size: 9pt; +} + +.bttndrkblue-bkgd-top { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgtop.gif); +} +.bttndrkblue-bkgd-left { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgleft.gif); +} +.bttndrkblue-bkgd { + padding-top: 0px; + padding-bottom: 0px; + margin-bottom: 0px; + margin-top: 0px; + background-repeat: no-repeat; + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgmiddle.gif); + vertical-align: top; +} +.bttndrkblue-bkgd-right { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgright.gif); +} +.bttndrkblue-bkgd-bottom { + background-color: #225688; + background-image: url(/global/mvc_objects/images/bttndrkblue_bgbottom.gif); +} +.bttndrkblue-text a { + color: #ffffff; + text-decoration: none; +} +a.bttndrkblue-text:hover { + color: #ffDD3C; + text-decoration: none; +} +.bg-ltblue { + background-color: #f0f5fa; +} + +.border-left-b { + background: #f0f5fa url(/i/corner-leftline.gif) repeat-y; +} + +.border-right-b { + background: #f0f5fa url(/i/corner-rightline.gif) repeat-y; +} + +.border-top-b { + background: #f0f5fa url(/i/corner-topline.gif) repeat-x; +} + +.border-bottom-b { + background: #f0f5fa url(/i/corner-botline.gif) repeat-x; +} + +.border-right-w { + background: #ffffff url(/i/corner-rightline.gif) repeat-y; +} + +.border-top-w { + background: #ffffff url(/i/corner-topline.gif) repeat-x; +} + +.border-bottom-w { + background: #ffffff url(/i/corner-botline.gif) repeat-x; +} + +.bg-white { + background-color: #ffffff; +} + +.border-left-w { + background: #ffffff url(/i/corner-leftline.gif) repeat-y; +} |