[llvm-branch-commits] [cfe-branch] r155545 - in /cfe/branches/tooling: ./ docs/ include/clang/AST/ include/clang/Analysis/ include/clang/Basic/ include/clang/Sema/ include/clang/StaticAnalyzer/Core/ include/clang/StaticAnalyzer/Core/BugReporter/ include/clang/StaticAnalyzer/Core/PathSensitive/ include/clang/Tooling/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Headers/ lib/Parse/ lib/Rewrite/ lib/Sema/ lib/Serialization/ lib/StaticAnalyzer/Core/ lib/Tooling/ test/Analysis/ test/CXX/class/class.mem/ test/CXX/...

Manuel Klimek klimek at google.com
Wed Apr 25 05:05:17 PDT 2012


Author: klimek
Date: Wed Apr 25 07:05:17 2012
New Revision: 155545

URL: http://llvm.org/viewvc/llvm-project?rev=155545&view=rev
Log:
Merging mainline.

Added:
    cfe/branches/tooling/lib/Headers/intrin.h
      - copied unchanged from r155543, cfe/trunk/lib/Headers/intrin.h
    cfe/branches/tooling/test/CXX/special/class.copy/p8-cxx11.cpp
      - copied unchanged from r155543, cfe/trunk/test/CXX/special/class.copy/p8-cxx11.cpp
    cfe/branches/tooling/test/CodeGenCXX/microsoft-abi-constructors.cpp
      - copied unchanged from r155543, cfe/trunk/test/CodeGenCXX/microsoft-abi-constructors.cpp
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/
      - copied from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/
      - copied from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/lib/
      - copied from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/lib/
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/lib/crtbegin_dynamic.o
      - copied unchanged from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/lib/crtbegin_dynamic.o
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/lib/crtbegin_so.o
      - copied unchanged from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/lib/crtbegin_so.o
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/lib/crtbegin_static.o
      - copied unchanged from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/lib/crtbegin_static.o
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/lib/crtend_android.o
      - copied unchanged from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/lib/crtend_android.o
    cfe/branches/tooling/test/Driver/Inputs/basic_android_tree/usr/lib/crtend_so.o
      - copied unchanged from r155543, cfe/trunk/test/Driver/Inputs/basic_android_tree/usr/lib/crtend_so.o
    cfe/branches/tooling/test/Driver/asan-ld.c
      - copied unchanged from r155543, cfe/trunk/test/Driver/asan-ld.c
    cfe/branches/tooling/test/Headers/ms-intrin.c
      - copied unchanged from r155543, cfe/trunk/test/Headers/ms-intrin.c
    cfe/branches/tooling/test/Headers/ms-null-ms-header-vs-stddef.cpp
      - copied unchanged from r155543, cfe/trunk/test/Headers/ms-null-ms-header-vs-stddef.cpp
    cfe/branches/tooling/test/PCH/cxx11-exception-spec.cpp
      - copied unchanged from r155543, cfe/trunk/test/PCH/cxx11-exception-spec.cpp
    cfe/branches/tooling/test/Tooling/clang-check-builtin-headers.cpp
      - copied unchanged from r155543, cfe/trunk/test/Tooling/clang-check-builtin-headers.cpp
Modified:
    cfe/branches/tooling/   (props changed)
    cfe/branches/tooling/docs/AddressSanitizer.html
    cfe/branches/tooling/docs/LanguageExtensions.html
    cfe/branches/tooling/docs/ObjectiveCLiterals.html
    cfe/branches/tooling/docs/UsersManual.html
    cfe/branches/tooling/include/clang/AST/Decl.h
    cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h
    cfe/branches/tooling/include/clang/Analysis/ProgramPoint.h
    cfe/branches/tooling/include/clang/Basic/Builtins.def
    cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
    cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/branches/tooling/include/clang/Sema/Sema.h
    cfe/branches/tooling/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
    cfe/branches/tooling/include/clang/StaticAnalyzer/Core/CheckerManager.h
    cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
    cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
    cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
    cfe/branches/tooling/include/clang/Tooling/Tooling.h
    cfe/branches/tooling/lib/AST/Decl.cpp
    cfe/branches/tooling/lib/AST/StmtPrinter.cpp
    cfe/branches/tooling/lib/Analysis/ProgramPoint.cpp
    cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp
    cfe/branches/tooling/lib/Basic/Targets.cpp
    cfe/branches/tooling/lib/CodeGen/CGClass.cpp
    cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp
    cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp
    cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp
    cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp
    cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.cpp
    cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.h
    cfe/branches/tooling/lib/Driver/Driver.cpp
    cfe/branches/tooling/lib/Driver/Tools.cpp
    cfe/branches/tooling/lib/Headers/CMakeLists.txt
    cfe/branches/tooling/lib/Headers/float.h
    cfe/branches/tooling/lib/Headers/stddef.h
    cfe/branches/tooling/lib/Parse/ParseDecl.cpp
    cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
    cfe/branches/tooling/lib/Parse/ParseTentative.cpp
    cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp
    cfe/branches/tooling/lib/Sema/Sema.cpp
    cfe/branches/tooling/lib/Sema/SemaDecl.cpp
    cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp
    cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
    cfe/branches/tooling/lib/Sema/SemaExprMember.cpp
    cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp
    cfe/branches/tooling/lib/Sema/SemaLookup.cpp
    cfe/branches/tooling/lib/Sema/SemaOverload.cpp
    cfe/branches/tooling/lib/Sema/SemaTemplate.cpp
    cfe/branches/tooling/lib/Sema/SemaType.cpp
    cfe/branches/tooling/lib/Serialization/ASTReader.cpp
    cfe/branches/tooling/lib/Serialization/ASTWriter.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/BugReporter.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerManager.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/CoreEngine.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
    cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp
    cfe/branches/tooling/lib/Tooling/Tooling.cpp
    cfe/branches/tooling/test/Analysis/malloc-plist.c
    cfe/branches/tooling/test/Analysis/self-init.m
    cfe/branches/tooling/test/CXX/class/class.mem/p2.cpp
    cfe/branches/tooling/test/CXX/special/class.copy/implicit-move.cpp
    cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c
    cfe/branches/tooling/test/CodeGen/arm-homogenous.c
    cfe/branches/tooling/test/CodeGen/debug-info-line3.c
    cfe/branches/tooling/test/CodeGen/debug-line-1.c
    cfe/branches/tooling/test/CodeGen/libcalls.c
    cfe/branches/tooling/test/CodeGen/tbaa-for-vptr.cpp
    cfe/branches/tooling/test/CodeGenCXX/debug-info-artificial-arg.cpp
    cfe/branches/tooling/test/CodeGenCXX/debug-info-fwd-ref.cpp
    cfe/branches/tooling/test/CodeGenCXX/debug-info-nullptr.cpp
    cfe/branches/tooling/test/CodeGenCXX/debug-info-static-fns.cpp
    cfe/branches/tooling/test/CodeGenCXX/global-array-destruction.cpp
    cfe/branches/tooling/test/CodeGenCXX/visibility.cpp
    cfe/branches/tooling/test/CodeGenObjC/debug-info-block-helper.m
    cfe/branches/tooling/test/CodeGenObjC/debug-info-synthesis.m
    cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m
    cfe/branches/tooling/test/Driver/arclite-link.c
    cfe/branches/tooling/test/Driver/clang-translation.c
    cfe/branches/tooling/test/Driver/linux-as.c
    cfe/branches/tooling/test/Driver/linux-ld.c
    cfe/branches/tooling/test/FixIt/fixit.cpp
    cfe/branches/tooling/test/PCH/cxx-friends.cpp
    cfe/branches/tooling/test/PCH/cxx-friends.h
    cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm
    cfe/branches/tooling/test/Rewriter/rewrite-modern-block.mm
    cfe/branches/tooling/test/Rewriter/rewrite-modern-extern-c-func-decl.mm
    cfe/branches/tooling/test/Sema/MicrosoftExtensions.c
    cfe/branches/tooling/test/Sema/attr-availability-ios.c
    cfe/branches/tooling/test/Sema/attr-availability-macosx.c
    cfe/branches/tooling/test/Sema/attr-availability.c
    cfe/branches/tooling/test/Sema/attr-deprecated-message.c
    cfe/branches/tooling/test/SemaCXX/implicit-exception-spec.cpp
    cfe/branches/tooling/test/SemaCXX/member-expr.cpp
    cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp
    cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp   (props changed)
    cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m
    cfe/branches/tooling/test/SemaObjC/attr-availability.m
    cfe/branches/tooling/test/SemaObjC/weak-receiver-warn.m
    cfe/branches/tooling/test/SemaObjCXX/ivar-construct.mm
    cfe/branches/tooling/test/SemaTemplate/class-template-decl.cpp
    cfe/branches/tooling/test/SemaTemplate/friend-template.cpp
    cfe/branches/tooling/tools/driver/driver.cpp
    cfe/branches/tooling/tools/libclang/CMakeLists.txt
    cfe/branches/tooling/tools/libclang/Makefile
    cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp
    cfe/branches/tooling/utils/clang-completion-mode.el
    cfe/branches/tooling/utils/clangVisualizers.txt
    cfe/branches/tooling/www/comparison.html
    cfe/branches/tooling/www/cxx_status.html

Propchange: cfe/branches/tooling/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 25 07:05:17 2012
@@ -1,3 +1,3 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:146581-155108
+/cfe/trunk:146581-155543
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/tooling/docs/AddressSanitizer.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/AddressSanitizer.html?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/docs/AddressSanitizer.html (original)
+++ cfe/branches/tooling/docs/AddressSanitizer.html Wed Apr 25 07:05:17 2012
@@ -21,14 +21,16 @@
 
 <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>
+  <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>
+    <ul><li> <a href="#no_address_safety_analysis">
+        __attribute__((no_address_safety_analysis))</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>
@@ -104,6 +106,14 @@
 #endif
 </pre>
 
+<h3 id="no_address_safety_analysis">__attribute__((no_address_safety_analysis))</h3>
+Some code should not be instrumentated by AddressSanitizer.
+One may use the function attribute 
+<a href="LanguageExtensions.html#address_sanitizer">
+  <tt>no_address_safety_analysis</tt></a>
+to disable instrumentation of a particular function.
+Note: currently, this attribute will be lost if the function is inlined.
+
 <h2 id="platforms">Supported Platforms</h2>
 AddressSanitizer is supported on
 <ul><li>Linux x86_64 (tested on Ubuntu 10.04).
@@ -115,18 +125,19 @@
 
 <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.
+<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> AddressSanitizer uses more stack memory. We have seen up to 3x increase.
+<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.
+AddressSanitizer is fully functional on supported platforms starting from LLVM 3.1.
 However, the test suite is not fully integrated yet and we lack the testing
 process (buildbots).
 

Modified: cfe/branches/tooling/docs/LanguageExtensions.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/LanguageExtensions.html?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/docs/LanguageExtensions.html (original)
+++ cfe/branches/tooling/docs/LanguageExtensions.html Wed Apr 25 07:05:17 2012
@@ -937,8 +937,8 @@
 <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>
+used to implement the <tt><stdatomic.h></tt> operations on
+<tt>_Atomic</tt> types.</p>
 
 <h4 id="c_generic_selections">C11 generic selections</h4>
 

Modified: cfe/branches/tooling/docs/ObjectiveCLiterals.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/ObjectiveCLiterals.html?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/docs/ObjectiveCLiterals.html (original)
+++ cfe/branches/tooling/docs/ObjectiveCLiterals.html Wed Apr 25 07:05:17 2012
@@ -24,21 +24,21 @@
 
 <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>
+<p>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>
+<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>
+<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>
+<p>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.
+<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.</p>
 
 <h3>Examples</h3>
 
-The following program illustrates the rules for <code>NSNumber</code> literals:<p>
+<p>The following program illustrates the rules for <code>NSNumber</code> literals:</p>
 
 <pre>
 void main(int argc, const char *argv[]) {
@@ -68,19 +68,19 @@
 
 <h3>Discussion</h3>
 
-NSNumber literals only support literal scalar values after the <code>'@'</code>. Consequently, <code>@INT_MAX</code> works, but <code>@INT_MIN</code> does not, because they are defined like this:<p>
+<p>NSNumber literals only support literal scalar values after the <code>'@'</code>. Consequently, <code>@INT_MAX</code> works, but <code>@INT_MIN</code> 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 <code>INT_MIN</code> is not a simple literal, but a parenthesized expression. Parenthesized
-expressions are supported using the <a href="#objc_boxed_expressions">boxed expression</a> syntax, which is described in the next section.<p>
+<p>The definition of <code>INT_MIN</code> is not a simple literal, but a parenthesized expression. Parenthesized
+expressions are supported using the <a href="#objc_boxed_expressions">boxed expression</a> syntax, which is described in the next section.</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>
+<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>
+<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)
@@ -92,9 +92,9 @@
 #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>
+<p>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>.
+<p>Objective-C++ also supports <code>@true</code> and <code>@false</code> expressions, which are equivalent to <code>@YES</code> and <code>@NO</code>.</p>
 
 <!-- ======================================================================= -->
 <h2 id="objc_boxed_expressions">Boxed Expressions</h2>
@@ -111,15 +111,15 @@
 
 <pre>
 // numbers.
-NSNumber *smallestInt = @(-INT_MAX - 1);
-NSNumber *piOverTwo = @(M_PI / 2);
+NSNumber *smallestInt = @(-INT_MAX - 1);  // [NSNumber numberWithInt:(-INT_MAX - 1)]
+NSNumber *piOverTwo = @(M_PI / 2);        // [NSNumber numberWithDouble:(M_PI / 2)]
 
 // enumerated types.
 typedef enum { Red, Green, Blue } Color;
-NSNumber *favoriteColor = @(Green);
+NSNumber *favoriteColor = @(Green);       // [NSNumber numberWithInt:((int)Green)]
 
 // strings.
-NSString *path = @(getenv("PATH"));
+NSString *path = @(getenv("PATH"));       // [NSString stringWithUTF8String:(getenv("PATH"))]
 NSArray *pathComponents = [path componentsSeparatedByString:@":"];
 </pre>
 
@@ -160,7 +160,7 @@
 <h3>Boxed C Strings</h3>
 
 <p>
-A C string literal prefixed by the <code>'@'</code> token denotes an <code>NSString</code> literal in the same way a numeric literal prefixed by the <code>'@'</code> token denotes an <code>NSNumber</code> literal. When the type of the parenthesized expression is <code>(char *)</code> or <code>(const char *)</code>, the result of the boxed expression is a pointer to an <code>NSString</code> object containing equivalent character data. The following example converts C-style command line arguments into <code>NSString</code> objects.
+A C string literal prefixed by the <code>'@'</code> token denotes an <code>NSString</code> literal in the same way a numeric literal prefixed by the <code>'@'</code> token denotes an <code>NSNumber</code> literal. When the type of the parenthesized expression is <code>(char *)</code> or <code>(const char *)</code>, the result of the boxed expression is a pointer to an <code>NSString</code> object containing equivalent character data, which is assumed to be '\0'-terminated and UTF-8 encoded. The following example converts C-style command line arguments into <code>NSString</code> objects.
 </p>
 
 <pre>
@@ -183,25 +183,23 @@
 
 <h3>Availability</h3>
 
-<p>This feature will be available after clang 3.1. It is not currently available in any Apple compiler.</p>
+<p>Boxed expressions will be available in clang 3.2. It is not currently available in any Apple compiler.</p>
 
 <h2>Container Literals</h2>
 
-Objective-C now supports a new expression syntax for creating immutable array and dictionary container objects.
+<p>Objective-C now supports a new expression syntax for creating immutable array and dictionary container objects.</p>
 
 <h3>Examples</h3>
 
-Immutable array expression:<p>
+<p>Immutable array expression:</p>
  
-<blockquote>
 <pre>
 NSArray *array = @[ @"Hello", NSApp, [NSNumber numberWithInt:42] ];
 </pre>
-</blockquote>
 
-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>
+<p>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>
+<p>Immutable dictionary expression:</p>
 
 <pre>
 NSDictionary *dictionary = @{
@@ -211,21 +209,21 @@
 };
 </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>
+<p>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>
+<p>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>
+<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>
+<p>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>
+<p>The following code demonstrates the use of object subscripting syntax with <code>NSMutableArray</code> and <code>NSMutableDictionary</code> objects:</p>
 
 <pre>
 NSMutableArray *array = ...;
@@ -240,87 +238,87 @@
 dictionary[key] = newObject;	// replace oldObject with newObject
 </pre>
 
-The next section explains how subscripting expressions map to accessor methods.<p>
+<p>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.
+<p>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.</p>
 
 <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>
+<p>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>
+<p>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>
+<p>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>
+<p>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>
+<p>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>
+<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>.
+<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>.</p>
 
 <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>
+<p>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>
+<p>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>
+<p>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>
+<p>it is translated to a call to <code>setObject:forKeyedSubscript:</code></p>
 
 <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>
+<p>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>
+<p>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>
+<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>
+<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>
+<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>
+<p>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)
@@ -354,11 +352,11 @@
                ;
 </pre>
 
-Note:  <code>@true</code> and <code>@false</code> are only supported in Objective-C++.<p>
+<p>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>
+<p>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)
@@ -398,10 +396,9 @@
 #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>
+<p>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>
 
-<p>To check whether boxed expressions are supported, use
-<code>__has_feature(objc_boxed_expressions)</code> feature macro.</p>
+<p>To check whether boxed expressions are supported, use <code>__has_feature(objc_boxed_expressions)</code> feature macro.</p>
 
 </div>
 </body>

Modified: cfe/branches/tooling/docs/UsersManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/UsersManual.html?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/docs/UsersManual.html (original)
+++ cfe/branches/tooling/docs/UsersManual.html Wed Apr 25 07:05:17 2012
@@ -1135,7 +1135,7 @@
 <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>This directory layout is standard for any toolchain you will find on the official <a href="http://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>
 

Modified: cfe/branches/tooling/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/Decl.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/Decl.h (original)
+++ cfe/branches/tooling/include/clang/AST/Decl.h Wed Apr 25 07:05:17 2012
@@ -277,10 +277,16 @@
       if (visibility() < V)
         return;
 
-      // Don't lose the explicit bit for nothing
-      if (visibility() == V && visibilityExplicit())
+      // FIXME: this
+      // If this visibility is explicit, keep it.
+      if (visibilityExplicit() && !E)
         return;
 
+      // should be replaced with this
+      // Don't lose the explicit bit for nothing
+      //      if (visibility() == V && visibilityExplicit())
+      //        return;
+
       setVisibility(V, E);
     }
     void mergeVisibility(LinkageInfo Other) {
@@ -298,11 +304,6 @@
       mergeLinkage(Other);
       mergeVisibilityWithMin(Other);
     }
-
-    friend LinkageInfo merge(LinkageInfo L, LinkageInfo R) {
-      L.merge(R);
-      return L;
-    }
   };
 
   /// \brief Determine what kind of linkage this entity has.

Modified: cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h Wed Apr 25 07:05:17 2012
@@ -1436,7 +1436,8 @@
     if (getDerived().shouldVisitTemplateInstantiations()) {
       // If this is the definition of the primary template, visit
       // instantiations which were formed from this pattern.
-      if (D->isThisDeclarationADefinition())
+      if (D->isThisDeclarationADefinition() ||
+          D->getInstantiatedFromMemberTemplate())
         TRY_TO(TraverseClassInstantiations(D, D));
     }
 
@@ -1489,7 +1490,8 @@
       //
       // In addition, we only traverse the function instantiations when
       // the function template is a function template definition.
-      if (D->isThisDeclarationADefinition()) {
+      if (D->isThisDeclarationADefinition() ||
+          D->getInstantiatedFromMemberTemplate()) {
         TRY_TO(TraverseFunctionInstantiations(D));
       }
     }
@@ -1567,7 +1569,7 @@
     CXXRecordDecl *D) {
   if (!TraverseRecordHelper(D))
     return false;
-  if (D->hasDefinition()) {
+  if (D->isCompleteDefinition()) {
     for (CXXRecordDecl::base_class_iterator I = D->bases_begin(),
                                             E = D->bases_end();
          I != E; ++I) {

Modified: cfe/branches/tooling/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Analysis/ProgramPoint.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/branches/tooling/include/clang/Analysis/ProgramPoint.h Wed Apr 25 07:05:17 2012
@@ -45,14 +45,16 @@
               PostLoadKind,
               PreStoreKind,
               PostStoreKind,
-              PostPurgeDeadSymbolsKind,
+              PostStmtPurgeDeadSymbolsKind,
+              PreStmtPurgeDeadSymbolsKind,
               PostConditionKind,
               PostLValueKind,
               PostInitializerKind,
               CallEnterKind,
-              CallExitKind,
+              CallExitBeginKind,
+              CallExitEndKind,
               MinPostStmtKind = PostStmtKind,
-              MaxPostStmtKind = CallExitKind,
+              MaxPostStmtKind = CallExitEndKind,
               EpsilonKind};
 
 private:
@@ -113,6 +115,14 @@
     return (Kind) x;
   }
 
+  /// \brief Is this a program point corresponding to purge/removal of dead
+  /// symbols and bindings.
+  bool isPurgeKind() {
+    Kind K = getKind();
+    return (K == PostStmtPurgeDeadSymbolsKind ||
+            K == PreStmtPurgeDeadSymbolsKind);
+  }
+
   const ProgramPointTag *getTag() const { return Tag; }
 
   const LocationContext *getLocationContext() const {
@@ -340,14 +350,29 @@
   }
 };
 
-class PostPurgeDeadSymbols : public PostStmt {
+/// \class Represents a point after we ran remove dead bindings BEFORE
+/// processing the given statement.
+class PreStmtPurgeDeadSymbols : public PostStmt {
+public:
+  PreStmtPurgeDeadSymbols(const Stmt *S, const LocationContext *L,
+                       const ProgramPointTag *tag = 0)
+    : PostStmt(S, PreStmtPurgeDeadSymbolsKind, L, tag) { }
+
+  static bool classof(const ProgramPoint* Location) {
+    return Location->getKind() == PreStmtPurgeDeadSymbolsKind;
+  }
+};
+
+/// \class Represents a point after we ran remove dead bindings AFTER
+/// processing the  given statement.
+class PostStmtPurgeDeadSymbols : public PostStmt {
 public:
-  PostPurgeDeadSymbols(const Stmt *S, const LocationContext *L,
+  PostStmtPurgeDeadSymbols(const Stmt *S, const LocationContext *L,
                        const ProgramPointTag *tag = 0)
-    : PostStmt(S, PostPurgeDeadSymbolsKind, L, tag) {}
+    : PostStmt(S, PostStmtPurgeDeadSymbolsKind, L, tag) { }
 
   static bool classof(const ProgramPoint* Location) {
-    return Location->getKind() == PostPurgeDeadSymbolsKind;
+    return Location->getKind() == PostStmtPurgeDeadSymbolsKind;
   }
 };
 
@@ -383,6 +408,7 @@
   }
 };
 
+/// \class Represents a point when we begin processing an inlined call.
 class CallEnter : public StmtPoint {
 public:
   CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx, 
@@ -402,14 +428,38 @@
   }
 };
 
-class CallExit : public StmtPoint {
+/// \class Represents a point when we start the call exit sequence (for
+/// inlined call).
+///
+/// The call exit is simulated with a sequence of nodes, which occur between
+/// CallExitBegin and CallExitEnd. The following operations occur between the
+/// two program points:
+/// - CallExitBegin
+/// - Bind the return value
+/// - Run Remove dead bindings (to clean up the dead symbols from the callee).
+/// - CallExitEnd
+class CallExitBegin : public StmtPoint {
+public:
+  // CallExitBegin uses the callee's location context.
+  CallExitBegin(const Stmt *S, const LocationContext *L)
+    : StmtPoint(S, 0, CallExitBeginKind, L, 0) {}
+
+  static bool classof(const ProgramPoint *Location) {
+    return Location->getKind() == CallExitBeginKind;
+  }
+};
+
+/// \class Represents a point when we finish the call exit sequence (for
+/// inlined call).
+/// \sa CallExitBegin
+class CallExitEnd : public StmtPoint {
 public:
-  // CallExit uses the callee's location context.
-  CallExit(const Stmt *S, const LocationContext *L)
-    : StmtPoint(S, 0, CallExitKind, L, 0) {}
+  // CallExitEnd uses the caller's location context.
+  CallExitEnd(const Stmt *S, const LocationContext *L)
+    : StmtPoint(S, 0, CallExitEndKind, L, 0) {}
 
   static bool classof(const ProgramPoint *Location) {
-    return Location->getKind() == CallExitKind;
+    return Location->getKind() == CallExitEndKind;
   }
 };
 

Modified: cfe/branches/tooling/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/Builtins.def?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/Builtins.def (original)
+++ cfe/branches/tooling/include/clang/Basic/Builtins.def Wed Apr 25 07:05:17 2012
@@ -804,25 +804,77 @@
 LIBBUILTIN(NSLogv, "vGa", "fP:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG)
 
 // Builtin math library functions
+LIBBUILTIN(acos, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(acosl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(acosf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(asin, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(asinl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(asinf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(atan, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(atanl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(atanf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(atan2, "ddd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(atan2l, "LdLdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(atan2f, "fff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(ceil, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(ceill, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(ceilf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(cos, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(cosl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(cosf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(exp, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(expl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(expf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(fabs, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fabsl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fabsf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(floor, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(floorl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(floorf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(fma, "dddd", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmal, "LdLdLdLd", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmaf, "ffff", "fc", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(fmax, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmaxl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmaxf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(fmin, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fminl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fminf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(log, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(logl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(logf, "ff", "fe", "math.h", ALL_LANGUAGES)
+
 LIBBUILTIN(pow, "ddd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(powl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(powf, "fff", "fe", "math.h", ALL_LANGUAGES)
 
-LIBBUILTIN(sqrt, "dd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(sqrtl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(sqrtf, "ff", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(round, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(roundl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(roundf, "ff", "fe", "math.h", ALL_LANGUAGES)
 
 LIBBUILTIN(sin, "dd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(sinl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(sinf, "ff", "fe", "math.h", ALL_LANGUAGES)
 
-LIBBUILTIN(cos, "dd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(cosl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(cosf, "ff", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(sqrt, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(sqrtl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(sqrtf, "ff", "fe", "math.h", ALL_LANGUAGES)
 
-LIBBUILTIN(fma, "dddd", "fc", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fmal, "LdLdLdLd", "fc", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fmaf, "ffff", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(tan, "dd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(tanl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(tanf, "ff", "fe", "math.h", ALL_LANGUAGES)
 
 // Blocks runtime Builtin math library functions
 LIBBUILTIN(_Block_object_assign, "vv*vC*iC", "f", "Blocks.h", ALL_LANGUAGES)

Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td Wed Apr 25 07:05:17 2012
@@ -354,7 +354,10 @@
  ]>;
 
 // Thread Safety warnings 
-def ThreadSafety : DiagGroup<"thread-safety">;
+def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
+def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">;
+def ThreadSafety : DiagGroup<"thread-safety", 
+                             [ThreadSafetyAttributes, ThreadSafetyAnalysis]>;
 
 // Note that putting warnings in -Wall will not disable them by default. If a
 // warning should be active _only_ when -Wall is passed in, mark it as

Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td Wed Apr 25 07:05:17 2012
@@ -660,7 +660,8 @@
 def err_gc_weak_property_strong_type : Error<
   "weak attribute declared on a __strong type property in GC mode">;
 def warn_receiver_is_weak : Warning <
-  "weak receiver may be unpredictably null in ARC mode">,
+  "weak %select{receiver|property|implicit property}0 may be "
+  "unpredictably null in ARC mode">,
   InGroup<DiagGroup<"receiver-is-weak">>, DefaultIgnore;
 
 def error_synthesized_ivar_yet_not_supported : Error<
@@ -1656,72 +1657,79 @@
   "attribute ignored">;
   
 // Thread Safety Attributes
-// Errors when parsing the attributes
+def warn_thread_attribute_ignored : Warning<
+  "ignoring %0 attribute because its argument is invalid">,
+  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
+def warn_thread_attribute_argument_not_lockable : Warning<
+  "%0 attribute requires arguments whose type is annotated "
+  "with 'lockable' attribute; type here is '%1'">,
+  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
+def warn_thread_attribute_argument_not_class : Warning<
+  "%0 attribute requires arguments that are class type or point to"
+  " class type; type here is '%1'">,
+  InGroup<ThreadSafetyAttributes>, DefaultIgnore;  
+def warn_thread_attribute_decl_not_lockable : Warning<
+  "%0 attribute can only be applied in a context annotated "
+  "with 'lockable' attribute">,
+  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
+def warn_thread_attribute_decl_not_pointer : Warning<
+  "'%0' only applies to pointer types; type here is %1">,
+  InGroup<ThreadSafetyAttributes>, DefaultIgnore;
 def err_attribute_argument_out_of_range : Error<
   "%0 attribute parameter %1 is out of bounds: "
   "%plural{0:no parameters to index into|"
   "1:can only be 1, since there is one parameter|"
   ":must be between 1 and %2}2">;
-def warn_attribute_argument_not_lockable : Warning<
-  "%0 attribute requires arguments whose type is annotated "
-  "with 'lockable' attribute; type here is '%1'">,
-  InGroup<ThreadSafety>, DefaultIgnore;
-def warn_attribute_decl_not_lockable : Warning<
-  "%0 attribute can only be applied in a context annotated "
-  "with 'lockable' attribute">,
-  InGroup<ThreadSafety>, DefaultIgnore;
-def warn_attribute_argument_not_class : Warning<
-  "%0 attribute requires arguments that are class type or point to"
-  " class type; type here is '%1'">,
-  InGroup<ThreadSafety>, DefaultIgnore;   
+
+// Thread Safety Analysis   
 def warn_unlock_but_no_lock : Warning<
   "unlocking '%0' that was not locked">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_double_lock : Warning<
   "locking '%0' that is already locked">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_no_unlock : Warning<
   "mutex '%0' is still locked at the end of function">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 // FIXME: improve the error message about locks not in scope
 def warn_lock_some_predecessors : Warning<
   "mutex '%0' is not locked on every path through here">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_expecting_lock_held_on_loop : Warning<
   "expecting mutex '%0' to be locked at start of each loop">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def note_locked_here : Note<"mutex acquired here">;
 def warn_lock_exclusive_and_shared : Warning<
   "mutex '%0' is locked exclusively and shared in the same scope">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def note_lock_exclusive_and_shared : Note<
   "the other lock of mutex '%0' is here">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_variable_requires_lock : Warning<
   "%select{reading|writing}2 variable '%0' requires locking "
   "%select{'%1'|'%1' exclusively}2">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_var_deref_requires_lock : Warning<
   "%select{reading|writing}2 the value pointed to by '%0' requires locking "
   "%select{'%1'|'%1' exclusively}2">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_variable_requires_any_lock : Warning<
   "%select{reading|writing}1 variable '%0' requires locking "
   "%select{any mutex|any mutex exclusively}1">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_var_deref_requires_any_lock : Warning<
   "%select{reading|writing}1 the value pointed to by '%0' requires locking "
   "%select{any mutex|any mutex exclusively}1">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_fun_requires_lock : Warning<
   "calling function '%0' requires %select{shared|exclusive}2 lock on '%1'">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_fun_excludes_mutex : Warning<
   "cannot call function '%0' while mutex '%1' is locked">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 def warn_cannot_resolve_lock : Warning<
   "cannot resolve lock expression">,
-  InGroup<ThreadSafety>, DefaultIgnore;
+  InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
 
 
 def warn_impcast_vector_scalar : Warning<
@@ -3650,6 +3658,8 @@
   "out-of-line definition of %0 from class %1 without definition">;
 def err_member_def_does_not_match : Error<
   "out-of-line definition of %0 does not match any declaration in %1">;
+def err_friend_decl_does_not_match : Error<
+  "friend declaration of %0 does not match any declaration in %1">;
 def err_member_def_does_not_match_suggest : Error<
   "out-of-line definition of %0 does not match any declaration in %1; "
   "did you mean %2?">;

Modified: cfe/branches/tooling/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Sema/Sema.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Sema/Sema.h (original)
+++ cfe/branches/tooling/include/clang/Sema/Sema.h Wed Apr 25 07:05:17 2012
@@ -331,6 +331,11 @@
   /// cycle detection at the end of the TU.
   DelegatingCtorDeclsType DelegatingCtorDecls;
 
+  /// \brief All the destructors seen during a class definition that had their
+  /// exception spec computation delayed because it depended on an unparsed
+  /// exception spec.
+  SmallVector<CXXDestructorDecl*, 2> DelayedDestructorExceptionSpecs;
+
   /// \brief All the overriding destructors seen during a class definition
   /// (there could be multiple due to nested classes) that had their exception
   /// spec checks delayed, plus the overridden destructor.
@@ -665,23 +670,14 @@
   /// SpecialMemberOverloadResult - The overloading result for a special member
   /// function.
   ///
-  /// This is basically a wrapper around PointerIntPair. The lowest bit of the
-  /// integer is used to determine whether we have a parameter qualification
-  /// match, the second-lowest is whether we had success in resolving the
-  /// overload to a unique non-deleted function.
-  ///
-  /// The ConstParamMatch bit represents whether, when looking up a copy
-  /// constructor or assignment operator, we found a potential copy
-  /// constructor/assignment operator whose first parameter is const-qualified.
-  /// This is used for determining parameter types of other objects and is
-  /// utterly meaningless on other types of special members.
+  /// This is basically a wrapper around PointerIntPair. The lowest bits of the
+  /// integer are used to determine whether overload resolution succeeded.
   class SpecialMemberOverloadResult : public llvm::FastFoldingSetNode {
   public:
     enum Kind {
       NoMemberOrDeleted,
       Ambiguous,
-      SuccessNonConst,
-      SuccessConst
+      Success
     };
 
   private:
@@ -697,9 +693,6 @@
 
     Kind getKind() const { return static_cast<Kind>(Pair.getInt()); }
     void setKind(Kind K) { Pair.setInt(K); }
-
-    bool hasSuccess() const { return getKind() >= SuccessNonConst; }
-    bool hasConstParamMatch() const { return getKind() == SuccessConst; }
   };
 
   /// \brief A cache of special member function overload resolution results
@@ -1921,11 +1914,9 @@
   DeclContextLookupResult LookupConstructors(CXXRecordDecl *Class);
   CXXConstructorDecl *LookupDefaultConstructor(CXXRecordDecl *Class);
   CXXConstructorDecl *LookupCopyingConstructor(CXXRecordDecl *Class,
-                                               unsigned Quals,
-                                               bool *ConstParam = 0);
+                                               unsigned Quals);
   CXXMethodDecl *LookupCopyingAssignment(CXXRecordDecl *Class, unsigned Quals,
-                                         bool RValueThis, unsigned ThisQuals,
-                                         bool *ConstParam = 0);
+                                         bool RValueThis, unsigned ThisQuals);
   CXXConstructorDecl *LookupMovingConstructor(CXXRecordDecl *Class);
   CXXMethodDecl *LookupMovingAssignment(CXXRecordDecl *Class, bool RValueThis,
                                         unsigned ThisQuals);
@@ -3217,7 +3208,8 @@
   /// C++11 says that user-defined destructors with no exception spec get one
   /// that looks as if the destructor was implicitly declared.
   void AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl,
-                                     CXXDestructorDecl *Destructor);
+                                     CXXDestructorDecl *Destructor,
+                                     bool WasDelayed = false);
 
   /// \brief Declare all inherited constructors for the given class.
   ///
@@ -4062,6 +4054,7 @@
                                          SourceLocation LBrac,
                                          SourceLocation RBrac,
                                          AttributeList *AttrList);
+  void ActOnFinishCXXMemberDecls();
 
   void ActOnReenterTemplateScope(Scope *S, Decl *Template);
   void ActOnReenterDeclaratorTemplateScope(Scope *S, DeclaratorDecl *D);

Modified: cfe/branches/tooling/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h (original)
+++ cfe/branches/tooling/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h Wed Apr 25 07:05:17 2012
@@ -362,7 +362,7 @@
 /// \brief Interface for classes constructing Stack hints.
 ///
 /// If a PathDiagnosticEvent occurs in a different frame than the final 
-/// diagnostic the hints can be used to summarise the effect of the call.
+/// diagnostic the hints can be used to summarize the effect of the call.
 class StackHintGenerator {
 public:
   virtual ~StackHintGenerator() = 0;
@@ -510,7 +510,7 @@
   }
   
   static PathDiagnosticCallPiece *construct(const ExplodedNode *N,
-                                            const CallExit &CE,
+                                            const CallExitEnd &CE,
                                             const SourceManager &SM);
   
   static PathDiagnosticCallPiece *construct(PathPieces &pieces,

Modified: cfe/branches/tooling/include/clang/StaticAnalyzer/Core/CheckerManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/StaticAnalyzer/Core/CheckerManager.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/StaticAnalyzer/Core/CheckerManager.h (original)
+++ cfe/branches/tooling/include/clang/StaticAnalyzer/Core/CheckerManager.h Wed Apr 25 07:05:17 2012
@@ -272,7 +272,8 @@
   void runCheckersForDeadSymbols(ExplodedNodeSet &Dst,
                                  const ExplodedNodeSet &Src,
                                  SymbolReaper &SymReaper, const Stmt *S,
-                                 ExprEngine &Eng);
+                                 ExprEngine &Eng,
+                                 ProgramPoint::Kind K);
 
   /// \brief True if at least one checker wants to check region changes.
   bool wantsRegionChangeUpdate(ProgramStateRef state);

Modified: cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h (original)
+++ cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h Wed Apr 25 07:05:17 2012
@@ -104,7 +104,7 @@
   CoreEngine(const CoreEngine&); // Do not implement.
   CoreEngine& operator=(const CoreEngine&);
 
-  ExplodedNode *generateCallExitNode(ExplodedNode *N);
+  ExplodedNode *generateCallExitBeginNode(ExplodedNode *N);
 
 public:
   /// Construct a CoreEngine object to analyze the provided CFG using
@@ -188,10 +188,10 @@
 
 // TODO: Turn into a calss.
 struct NodeBuilderContext {
-  CoreEngine &Eng;
+  const CoreEngine &Eng;
   const CFGBlock *Block;
   ExplodedNode *Pred;
-  NodeBuilderContext(CoreEngine &E, const CFGBlock *B, ExplodedNode *N)
+  NodeBuilderContext(const CoreEngine &E, const CFGBlock *B, ExplodedNode *N)
     : Eng(E), Block(B), Pred(N) { assert(B); assert(!N->isSink()); }
 
   ExplodedNode *getPred() const { return Pred; }

Modified: cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h (original)
+++ cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h Wed Apr 25 07:05:17 2012
@@ -151,6 +151,25 @@
   ExplodedGraph& getGraph() { return G; }
   const ExplodedGraph& getGraph() const { return G; }
 
+  /// \brief Run the analyzer's garbage collection - remove dead symbols and
+  /// bindings.
+  ///
+  /// \param Node - The predecessor node, from which the processing should 
+  /// start.
+  /// \param Out - The returned set of output nodes.
+  /// \param ReferenceStmt - Run garbage collection using the symbols, 
+  /// which are live before the given statement.
+  /// \param LC - The location context of the ReferenceStmt.
+  /// \param DiagnosticStmt - the statement used to associate the diagnostic 
+  /// message, if any warnings should occur while removing the dead (leaks 
+  /// are usually reported here).
+  /// \param K - In some cases it is possible to use PreStmt kind. (Do 
+  /// not use it unless you know what you are doing.) 
+  void removeDead(ExplodedNode *Node, ExplodedNodeSet &Out,
+            const Stmt *ReferenceStmt, const LocationContext *LC,
+            const Stmt *DiagnosticStmt,
+            ProgramPoint::Kind K = ProgramPoint::PreStmtPurgeDeadSymbolsKind);
+
   /// processCFGElement - Called by CoreEngine. Used to generate new successor
   ///  nodes by processing the 'effects' of a CFG element.
   void processCFGElement(const CFGElement E, ExplodedNode *Pred,
@@ -199,7 +218,8 @@
   /// Generate the entry node of the callee.
   void processCallEnter(CallEnter CE, ExplodedNode *Pred);
 
-  /// Generate the first post callsite node.
+  /// Generate the sequence of nodes that simulate the call exit and the post
+  /// visit for CallExpr.
   void processCallExit(ExplodedNode *Pred);
 
   /// Called by CoreEngine when the analysis worklist has terminated.

Modified: cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h (original)
+++ cfe/branches/tooling/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h Wed Apr 25 07:05:17 2012
@@ -553,6 +553,7 @@
   BasicValueFactory &getBasicVals() { return BV; }
 };
 
+/// \class A class responsible for cleaning up unused symbols.
 class SymbolReaper {
   enum SymbolStatus {
     NotProcessed,
@@ -576,6 +577,11 @@
   llvm::DenseMap<const MemRegion *, unsigned> includedRegionCache;
 
 public:
+  /// \brief Construct a reaper object, which removes everything which is not
+  /// live before we execute statement s in the given location context.
+  ///
+  /// If the statement is NULL, everything is this and parent contexts is
+  /// considered live.
   SymbolReaper(const LocationContext *ctx, const Stmt *s, SymbolManager& symmgr,
                StoreManager &storeMgr)
    : LCtx(ctx), Loc(s), SymMgr(symmgr), reapedStore(0, storeMgr) {}
@@ -583,7 +589,6 @@
   ~SymbolReaper() {}
 
   const LocationContext *getLocationContext() const { return LCtx; }
-  const Stmt *getCurrentStatement() const { return Loc; }
 
   bool isLive(SymbolRef sym);
   bool isLiveRegion(const MemRegion *region);

Modified: cfe/branches/tooling/include/clang/Tooling/Tooling.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Tooling/Tooling.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Tooling/Tooling.h (original)
+++ cfe/branches/tooling/include/clang/Tooling/Tooling.h Wed Apr 25 07:05:17 2012
@@ -15,7 +15,7 @@
 //  all TUs in which the given files are compiled.
 //
 //  It is also possible to run a FrontendAction over a snippet of code by
-//  calling runSyntaxOnlyToolOnCode, which is useful for unit testing.
+//  calling runToolOnCode, which is useful for unit testing.
 //
 //  Applications that need more fine grained control over how to run
 //  multiple FrontendActions over code can use ToolInvocation.

Modified: cfe/branches/tooling/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Decl.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Decl.cpp (original)
+++ cfe/branches/tooling/lib/AST/Decl.cpp Wed Apr 25 07:05:17 2012
@@ -66,32 +66,6 @@
 
 typedef NamedDecl::LinkageInfo LinkageInfo;
 
-namespace {
-/// Flags controlling the computation of linkage and visibility.
-struct LVFlags {
-  const bool ConsiderGlobalVisibility;
-  const bool ConsiderVisibilityAttributes;
-  const bool ConsiderTemplateParameterTypes;
-
-  LVFlags() : ConsiderGlobalVisibility(true), 
-              ConsiderVisibilityAttributes(true),
-              ConsiderTemplateParameterTypes(true) {
-  }
-
-  LVFlags(bool Global, bool Attributes, bool Parameters) :
-    ConsiderGlobalVisibility(Global),
-    ConsiderVisibilityAttributes(Attributes),
-    ConsiderTemplateParameterTypes(Parameters) {
-  }
-
-  /// \brief Returns a set of flags that is only useful for computing the 
-  /// linkage, not the visibility, of a declaration.
-  static LVFlags CreateOnlyDeclLinkage() {
-    return LVFlags(false, false, false);
-  }
-}; 
-} // end anonymous namespace
-
 static LinkageInfo getLVForType(QualType T) {
   std::pair<Linkage,Visibility> P = T->getLinkageAndVisibility();
   return LinkageInfo(P.first, P.second, T->isVisibilityExplicit());
@@ -131,13 +105,13 @@
 }
 
 /// getLVForDecl - Get the linkage and visibility for the given declaration.
-static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags F);
+static LinkageInfo getLVForDecl(const NamedDecl *D, bool OnlyTemplate);
 
 /// \brief Get the most restrictive linkage for the types and
 /// declarations in the given template argument list.
 static LinkageInfo getLVForTemplateArgumentList(const TemplateArgument *Args,
                                                 unsigned NumArgs,
-                                                LVFlags &F) {
+                                                bool OnlyTemplate) {
   LinkageInfo LV(ExternalLinkage, DefaultVisibility, false);
 
   for (unsigned I = 0; I != NumArgs; ++I) {
@@ -148,7 +122,7 @@
       break;
 
     case TemplateArgument::Type:
-      LV.merge(getLVForType(Args[I].getAsType()));
+      LV.mergeWithMin(getLVForType(Args[I].getAsType()));
       break;
 
     case TemplateArgument::Declaration:
@@ -156,7 +130,7 @@
       // arguments, valid only in C++0x.
       if (Decl *D = Args[I].getAsDecl()) {
         if (NamedDecl *ND = dyn_cast<NamedDecl>(D))
-          LV = merge(LV, getLVForDecl(ND, F));
+          LV.mergeWithMin(getLVForDecl(ND, OnlyTemplate));
       }
       break;
 
@@ -164,13 +138,13 @@
     case TemplateArgument::TemplateExpansion:
       if (TemplateDecl *Template
                 = Args[I].getAsTemplateOrTemplatePattern().getAsTemplateDecl())
-        LV.merge(getLVForDecl(Template, F));
+        LV.mergeWithMin(getLVForDecl(Template, OnlyTemplate));
       break;
 
     case TemplateArgument::Pack:
       LV.mergeWithMin(getLVForTemplateArgumentList(Args[I].pack_begin(),
                                                    Args[I].pack_size(),
-                                                   F));
+                                                   OnlyTemplate));
       break;
     }
   }
@@ -180,8 +154,8 @@
 
 static LinkageInfo
 getLVForTemplateArgumentList(const TemplateArgumentList &TArgs,
-                             LVFlags &F) {
-  return getLVForTemplateArgumentList(TArgs.data(), TArgs.size(), F);
+                             bool OnlyTemplate) {
+  return getLVForTemplateArgumentList(TArgs.data(), TArgs.size(), OnlyTemplate);
 }
 
 static bool shouldConsiderTemplateLV(const FunctionDecl *fn,
@@ -194,7 +168,8 @@
   return !(d->isExplicitSpecialization() && d->hasAttr<VisibilityAttr>());
 }
 
-static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
+static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
+                                              bool OnlyTemplate) {
   assert(D->getDeclContext()->getRedeclContext()->isFileContext() &&
          "Not a name having namespace scope");
   ASTContext &Context = D->getASTContext();
@@ -272,7 +247,7 @@
   //   external.
   LinkageInfo LV;
 
-  if (F.ConsiderVisibilityAttributes) {
+  if (!OnlyTemplate) {
     if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility()) {
       LV.mergeVisibility(*Vis, true);
     } else {
@@ -291,7 +266,7 @@
     }
   }
 
-  if (F.ConsiderGlobalVisibility)
+  if (!OnlyTemplate)
     LV.mergeVisibility(Context.getLangOpts().getVisibilityMode());
 
   // C++ [basic.link]p4:
@@ -347,7 +322,7 @@
       //   is visible, or if the prior declaration specifies no
       //   linkage, then the identifier has external linkage.
       if (const VarDecl *PrevVar = Var->getPreviousDecl()) {
-        LinkageInfo PrevLV = getLVForDecl(PrevVar, F);
+        LinkageInfo PrevLV = getLVForDecl(PrevVar, OnlyTemplate);
         if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage());
         LV.mergeVisibility(PrevLV);
       }
@@ -382,7 +357,7 @@
       //   is visible, or if the prior declaration specifies no
       //   linkage, then the identifier has external linkage.
       if (const FunctionDecl *PrevFunc = Function->getPreviousDecl()) {
-        LinkageInfo PrevLV = getLVForDecl(PrevFunc, F);
+        LinkageInfo PrevLV = getLVForDecl(PrevFunc, OnlyTemplate);
         if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage());
         LV.mergeVisibility(PrevLV);
       }
@@ -403,9 +378,10 @@
                                = Function->getTemplateSpecializationInfo()) {
       if (shouldConsiderTemplateLV(Function, specInfo)) {
         LV.merge(getLVForDecl(specInfo->getTemplate(),
-                              LVFlags::CreateOnlyDeclLinkage()));
+                              true));
         const TemplateArgumentList &templateArgs = *specInfo->TemplateArguments;
-        LV.mergeWithMin(getLVForTemplateArgumentList(templateArgs, F));
+        LV.mergeWithMin(getLVForTemplateArgumentList(templateArgs,
+                                                     OnlyTemplate));
       }
     }
 
@@ -427,17 +403,19 @@
       if (shouldConsiderTemplateLV(spec)) {
         // From the template.
         LV.merge(getLVForDecl(spec->getSpecializedTemplate(),
-                              LVFlags::CreateOnlyDeclLinkage()));
+                              true));
 
         // The arguments at which the template was instantiated.
         const TemplateArgumentList &TemplateArgs = spec->getTemplateArgs();
-        LV.mergeWithMin(getLVForTemplateArgumentList(TemplateArgs, F));
+        LV.merge(getLVForTemplateArgumentList(TemplateArgs,
+                                              OnlyTemplate));
       }
     }
 
   //     - an enumerator belonging to an enumeration with external linkage;
   } else if (isa<EnumConstantDecl>(D)) {
-    LinkageInfo EnumLV = getLVForDecl(cast<NamedDecl>(D->getDeclContext()), F);
+    LinkageInfo EnumLV = getLVForDecl(cast<NamedDecl>(D->getDeclContext()),
+                                      OnlyTemplate);
     if (!isExternalLinkage(EnumLV.linkage()))
       return LinkageInfo::none();
     LV.merge(EnumLV);
@@ -445,9 +423,7 @@
   //     - a template, unless it is a function template that has
   //       internal linkage (Clause 14);
   } else if (const TemplateDecl *temp = dyn_cast<TemplateDecl>(D)) {
-    if (F.ConsiderTemplateParameterTypes)
-      LV.merge(getLVForTemplateParameterList(temp->getTemplateParameters()));
-
+    LV.merge(getLVForTemplateParameterList(temp->getTemplateParameters()));
   //     - a namespace (7.3), unless it is declared within an unnamed
   //       namespace.
   } else if (isa<NamespaceDecl>(D) && !D->isInAnonymousNamespace()) {
@@ -471,7 +447,7 @@
   return LV;
 }
 
-static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) {
+static LinkageInfo getLVForClassMember(const NamedDecl *D, bool OnlyTemplate) {
   // Only certain class members have linkage.  Note that fields don't
   // really have linkage, but it's convenient to say they do for the
   // purposes of calculating linkage of pointer-to-data-member
@@ -486,7 +462,7 @@
   LinkageInfo LV;
 
   // If we have an explicit visibility attribute, merge that in.
-  if (F.ConsiderVisibilityAttributes) {
+  if (!OnlyTemplate) {
     if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility())
       LV.mergeVisibility(*Vis, true);
   }
@@ -494,8 +470,7 @@
   // If this class member has an explicit visibility attribute, the only
   // thing that can change its visibility is the template arguments, so
   // only look for them when processing the the class.
-  LVFlags ClassF =  LV.visibilityExplicit() ?
-    LVFlags::CreateOnlyDeclLinkage() : F;
+  bool ClassOnlyTemplate =  LV.visibilityExplicit() ? true : OnlyTemplate;
 
   // If we're paying attention to global visibility, apply
   // -finline-visibility-hidden if this is an inline method.
@@ -518,7 +493,7 @@
     // anyway.
     if (TSK != TSK_ExplicitInstantiationDeclaration &&
         TSK != TSK_ExplicitInstantiationDefinition &&
-        F.ConsiderGlobalVisibility &&
+        !OnlyTemplate &&
         !LV.visibilityExplicit() &&
         MD->getASTContext().getLangOpts().InlineVisibilityHidden &&
         MD->hasBody(Def) && Def->isInlined())
@@ -530,7 +505,8 @@
   // about the template instantiation. If the member has no visibility
   // attributes, mergeWithMin behaves like merge, so in both cases mergeWithMin
   // produces the desired result.
-  LV.mergeWithMin(getLVForDecl(cast<RecordDecl>(D->getDeclContext()), ClassF));
+  LV.mergeWithMin(getLVForDecl(cast<RecordDecl>(D->getDeclContext()),
+                               ClassOnlyTemplate));
   if (!isExternalLinkage(LV.linkage()))
     return LinkageInfo::none();
 
@@ -538,7 +514,7 @@
   if (LV.linkage() == UniqueExternalLinkage)
     return LinkageInfo::uniqueExternal();
 
-  if (F.ConsiderGlobalVisibility)
+  if (!OnlyTemplate)
     LV.mergeVisibility(D->getASTContext().getLangOpts().getVisibilityMode());
 
   if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
@@ -553,8 +529,8 @@
            = MD->getTemplateSpecializationInfo()) {
       if (shouldConsiderTemplateLV(MD, spec)) {
         LV.mergeWithMin(getLVForTemplateArgumentList(*spec->TemplateArguments,
-                                                     F));
-        if (F.ConsiderTemplateParameterTypes)
+                                                     OnlyTemplate));
+        if (!OnlyTemplate)
           LV.merge(getLVForTemplateParameterList(
                               spec->getTemplate()->getTemplateParameters()));
       }
@@ -570,8 +546,8 @@
         // Merge template argument/parameter information for member
         // class template specializations.
         LV.mergeWithMin(getLVForTemplateArgumentList(spec->getTemplateArgs(),
-                                                     F));
-      if (F.ConsiderTemplateParameterTypes)
+                                                     OnlyTemplate));
+      if (!OnlyTemplate)
         LV.merge(getLVForTemplateParameterList(
                     spec->getSpecializedTemplate()->getTemplateParameters()));
       }
@@ -640,18 +616,17 @@
 Linkage NamedDecl::getLinkage() const {
   if (HasCachedLinkage) {
     assert(Linkage(CachedLinkage) ==
-             getLVForDecl(this, LVFlags::CreateOnlyDeclLinkage()).linkage());
+             getLVForDecl(this, true).linkage());
     return Linkage(CachedLinkage);
   }
 
-  CachedLinkage = getLVForDecl(this, 
-                               LVFlags::CreateOnlyDeclLinkage()).linkage();
+  CachedLinkage = getLVForDecl(this, true).linkage();
   HasCachedLinkage = 1;
   return Linkage(CachedLinkage);
 }
 
 LinkageInfo NamedDecl::getLinkageAndVisibility() const {
-  LinkageInfo LI = getLVForDecl(this, LVFlags());
+  LinkageInfo LI = getLVForDecl(this, false);
   assert(!HasCachedLinkage || Linkage(CachedLinkage) == LI.linkage());
   HasCachedLinkage = 1;
   CachedLinkage = LI.linkage();
@@ -707,7 +682,7 @@
   return llvm::Optional<Visibility>();
 }
 
-static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags Flags) {
+static LinkageInfo getLVForDecl(const NamedDecl *D, bool OnlyTemplate) {
   // Objective-C: treat all Objective-C declarations as having external
   // linkage.
   switch (D->getKind()) {
@@ -742,11 +717,12 @@
           if (isa<ParmVarDecl>(ContextDecl))
             DC = ContextDecl->getDeclContext()->getRedeclContext();
           else
-            return getLVForDecl(cast<NamedDecl>(ContextDecl), Flags);
+            return getLVForDecl(cast<NamedDecl>(ContextDecl),
+                                OnlyTemplate);
         }
 
         if (const NamedDecl *ND = dyn_cast<NamedDecl>(DC))
-          return getLVForDecl(ND, Flags);
+          return getLVForDecl(ND, OnlyTemplate);
         
         return LinkageInfo::external();
       }
@@ -757,7 +733,7 @@
 
   // Handle linkage for namespace-scope names.
   if (D->getDeclContext()->getRedeclContext()->isFileContext())
-    return getLVForNamespaceScopeDecl(D, Flags);
+    return getLVForNamespaceScopeDecl(D, OnlyTemplate);
   
   // C++ [basic.link]p5:
   //   In addition, a member function, static data member, a named
@@ -767,7 +743,7 @@
   //   purposes (7.1.3), has external linkage if the name of the class
   //   has external linkage.
   if (D->getDeclContext()->isRecord())
-    return getLVForClassMember(D, Flags);
+    return getLVForClassMember(D, OnlyTemplate);
 
   // C++ [basic.link]p6:
   //   The name of a function declared in block scope and the name of
@@ -787,13 +763,13 @@
         return LinkageInfo::uniqueExternal();
 
       LinkageInfo LV;
-      if (Flags.ConsiderVisibilityAttributes) {
+      if (!OnlyTemplate) {
         if (llvm::Optional<Visibility> Vis = Function->getExplicitVisibility())
           LV.mergeVisibility(*Vis, true);
       }
       
       if (const FunctionDecl *Prev = Function->getPreviousDecl()) {
-        LinkageInfo PrevLV = getLVForDecl(Prev, Flags);
+        LinkageInfo PrevLV = getLVForDecl(Prev, OnlyTemplate);
         if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage());
         LV.mergeVisibility(PrevLV);
       }
@@ -811,13 +787,13 @@
         LinkageInfo LV;
         if (Var->getStorageClass() == SC_PrivateExtern)
           LV.mergeVisibility(HiddenVisibility, true);
-        else if (Flags.ConsiderVisibilityAttributes) {
+        else if (!OnlyTemplate) {
           if (llvm::Optional<Visibility> Vis = Var->getExplicitVisibility())
             LV.mergeVisibility(*Vis, true);
         }
         
         if (const VarDecl *Prev = Var->getPreviousDecl()) {
-          LinkageInfo PrevLV = getLVForDecl(Prev, Flags);
+          LinkageInfo PrevLV = getLVForDecl(Prev, OnlyTemplate);
           if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage());
           LV.mergeVisibility(PrevLV);
         }

Modified: cfe/branches/tooling/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/StmtPrinter.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/StmtPrinter.cpp (original)
+++ cfe/branches/tooling/lib/AST/StmtPrinter.cpp Wed Apr 25 07:05:17 2012
@@ -742,7 +742,7 @@
   case StringLiteral::UTF32: OS << 'U'; break;
   }
   OS << '"';
-  static char Hex[] = "0123456789ABCDEF";
+  static const char Hex[] = "0123456789ABCDEF";
 
   unsigned LastSlashX = Str->getLength();
   for (unsigned I = 0, N = Str->getLength(); I != N; ++I) {

Modified: cfe/branches/tooling/lib/Analysis/ProgramPoint.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/ProgramPoint.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/ProgramPoint.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/ProgramPoint.cpp Wed Apr 25 07:05:17 2012
@@ -36,8 +36,10 @@
       return PreStore(S, LC, tag);
     case ProgramPoint::PostLValueKind:
       return PostLValue(S, LC, tag);
-    case ProgramPoint::PostPurgeDeadSymbolsKind:
-      return PostPurgeDeadSymbols(S, LC, tag);
+    case ProgramPoint::PostStmtPurgeDeadSymbolsKind:
+      return PostStmtPurgeDeadSymbols(S, LC, tag);
+    case ProgramPoint::PreStmtPurgeDeadSymbolsKind:
+      return PreStmtPurgeDeadSymbols(S, LC, tag);
   }
 }
 

Modified: cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/ThreadSafety.cpp Wed Apr 25 07:05:17 2012
@@ -334,7 +334,7 @@
 /// A Lockset maps each MutexID (defined above) to information about how it has
 /// been locked.
 typedef llvm::ImmutableMap<MutexID, LockData> Lockset;
-typedef llvm::ImmutableMap<NamedDecl*, unsigned> LocalVarContext;
+typedef llvm::ImmutableMap<const NamedDecl*, unsigned> LocalVarContext;
 
 class LocalVariableMap;
 
@@ -398,21 +398,21 @@
   public:
     friend class LocalVariableMap;
 
-    NamedDecl *Dec;       // The original declaration for this variable.
-    Expr *Exp;            // The expression for this variable, OR
-    unsigned Ref;         // Reference to another VarDefinition
-    Context Ctx;          // The map with which Exp should be interpreted.
+    const NamedDecl *Dec;  // The original declaration for this variable.
+    const Expr *Exp;       // The expression for this variable, OR
+    unsigned Ref;          // Reference to another VarDefinition
+    Context Ctx;           // The map with which Exp should be interpreted.
 
     bool isReference() { return !Exp; }
 
   private:
     // Create ordinary variable definition
-    VarDefinition(NamedDecl *D, Expr *E, Context C)
+    VarDefinition(const NamedDecl *D, const Expr *E, Context C)
       : Dec(D), Exp(E), Ref(0), Ctx(C)
     { }
 
     // Create reference to previous definition
-    VarDefinition(NamedDecl *D, unsigned R, Context C)
+    VarDefinition(const NamedDecl *D, unsigned R, Context C)
       : Dec(D), Exp(0), Ref(R), Ctx(C)
     { }
   };
@@ -430,7 +430,7 @@
   }
 
   /// Look up a definition, within the given context.
-  const VarDefinition* lookup(NamedDecl *D, Context Ctx) {
+  const VarDefinition* lookup(const NamedDecl *D, Context Ctx) {
     const unsigned *i = Ctx.lookup(D);
     if (!i)
       return 0;
@@ -441,7 +441,7 @@
   /// Look up the definition for D within the given context.  Returns
   /// NULL if the expression is not statically known.  If successful, also
   /// modifies Ctx to hold the context of the return Expr.
-  Expr* lookupExpr(NamedDecl *D, Context &Ctx) {
+  const Expr* lookupExpr(const NamedDecl *D, Context &Ctx) {
     const unsigned *P = Ctx.lookup(D);
     if (!P)
       return 0;
@@ -476,7 +476,7 @@
       llvm::errs() << "Undefined";
       return;
     }
-    NamedDecl *Dec = VarDefinitions[i].Dec;
+    const NamedDecl *Dec = VarDefinitions[i].Dec;
     if (!Dec) {
       llvm::errs() << "<<NULL>>";
       return;
@@ -488,7 +488,7 @@
   /// Dumps an ASCII representation of the variable map to llvm::errs()
   void dump() {
     for (unsigned i = 1, e = VarDefinitions.size(); i < e; ++i) {
-      Expr *Exp = VarDefinitions[i].Exp;
+      const Expr *Exp = VarDefinitions[i].Exp;
       unsigned Ref = VarDefinitions[i].Ref;
 
       dumpVarDefinitionName(i);
@@ -504,7 +504,7 @@
   /// Dumps an ASCII representation of a Context to llvm::errs()
   void dumpContext(Context C) {
     for (Context::iterator I = C.begin(), E = C.end(); I != E; ++I) {
-      NamedDecl *D = I.getKey();
+      const NamedDecl *D = I.getKey();
       D->printName(llvm::errs());
       const unsigned *i = C.lookup(D);
       llvm::errs() << " -> ";
@@ -528,7 +528,7 @@
 
   // Adds a new definition to the given context, and returns a new context.
   // This method should be called when declaring a new variable.
-  Context addDefinition(NamedDecl *D, Expr *Exp, Context Ctx) {
+  Context addDefinition(const NamedDecl *D, Expr *Exp, Context Ctx) {
     assert(!Ctx.contains(D));
     unsigned newID = VarDefinitions.size();
     Context NewCtx = ContextFactory.add(Ctx, D, newID);
@@ -537,7 +537,7 @@
   }
 
   // Add a new reference to an existing definition.
-  Context addReference(NamedDecl *D, unsigned i, Context Ctx) {
+  Context addReference(const NamedDecl *D, unsigned i, Context Ctx) {
     unsigned newID = VarDefinitions.size();
     Context NewCtx = ContextFactory.add(Ctx, D, newID);
     VarDefinitions.push_back(VarDefinition(D, i, Ctx));
@@ -546,7 +546,7 @@
 
   // Updates a definition only if that definition is already in the map.
   // This method should be called when assigning to an existing variable.
-  Context updateDefinition(NamedDecl *D, Expr *Exp, Context Ctx) {
+  Context updateDefinition(const NamedDecl *D, Expr *Exp, Context Ctx) {
     if (Ctx.contains(D)) {
       unsigned newID = VarDefinitions.size();
       Context NewCtx = ContextFactory.remove(Ctx, D);
@@ -559,7 +559,7 @@
 
   // Removes a definition from the context, but keeps the variable name
   // as a valid variable.  The index 0 is a placeholder for cleared definitions.
-  Context clearDefinition(NamedDecl *D, Context Ctx) {
+  Context clearDefinition(const NamedDecl *D, Context Ctx) {
     Context NewCtx = Ctx;
     if (NewCtx.contains(D)) {
       NewCtx = ContextFactory.remove(NewCtx, D);
@@ -569,7 +569,7 @@
   }
 
   // Remove a definition entirely frmo the context.
-  Context removeDefinition(NamedDecl *D, Context Ctx) {
+  Context removeDefinition(const NamedDecl *D, Context Ctx) {
     Context NewCtx = Ctx;
     if (NewCtx.contains(D)) {
       NewCtx = ContextFactory.remove(NewCtx, D);
@@ -655,7 +655,7 @@
 LocalVariableMap::intersectContexts(Context C1, Context C2) {
   Context Result = C1;
   for (Context::iterator I = C1.begin(), E = C1.end(); I != E; ++I) {
-    NamedDecl *Dec = I.getKey();
+    const NamedDecl *Dec = I.getKey();
     unsigned i1 = I.getData();
     const unsigned *i2 = C2.lookup(Dec);
     if (!i2)             // variable doesn't exist on second path
@@ -672,7 +672,7 @@
 LocalVariableMap::Context LocalVariableMap::createReferenceContext(Context C) {
   Context Result = getEmptyContext();
   for (Context::iterator I = C.begin(), E = C.end(); I != E; ++I) {
-    NamedDecl *Dec = I.getKey();
+    const NamedDecl *Dec = I.getKey();
     unsigned i = I.getData();
     Result = addReference(Dec, i, Result);
   }
@@ -684,7 +684,7 @@
 // createReferenceContext.
 void LocalVariableMap::intersectBackEdge(Context C1, Context C2) {
   for (Context::iterator I = C1.begin(), E = C1.end(); I != E; ++I) {
-    NamedDecl *Dec = I.getKey();
+    const NamedDecl *Dec = I.getKey();
     unsigned i1 = I.getData();
     VarDefinition *VDef = &VarDefinitions[i1];
     assert(VDef->isReference());
@@ -869,145 +869,103 @@
 class ThreadSafetyAnalyzer {
   friend class BuildLockset;
 
-  ThreadSafetyHandler &Handler;
-  Lockset::Factory    LocksetFactory;
-  LocalVariableMap    LocalVarMap;
+  ThreadSafetyHandler       &Handler;
+  Lockset::Factory          LocksetFactory;
+  LocalVariableMap          LocalVarMap;
+  std::vector<CFGBlockInfo> BlockInfo;
 
 public:
   ThreadSafetyAnalyzer(ThreadSafetyHandler &H) : Handler(H) {}
 
-  Lockset intersectAndWarn(const CFGBlockInfo &Block1, CFGBlockSide Side1,
-                           const CFGBlockInfo &Block2, CFGBlockSide Side2,
-                           LockErrorKind LEK);
-
-  Lockset addLock(Lockset &LSet, Expr *MutexExp, const NamedDecl *D,
-                  LockKind LK, SourceLocation Loc);
-
-  void runAnalysis(AnalysisDeclContext &AC);
-};
-
-
-/// \brief We use this class to visit different types of expressions in
-/// CFGBlocks, and build up the lockset.
-/// An expression may cause us to add or remove locks from the lockset, or else
-/// output error messages related to missing locks.
-/// FIXME: In future, we may be able to not inherit from a visitor.
-class BuildLockset : public StmtVisitor<BuildLockset> {
-  friend class ThreadSafetyAnalyzer;
-
-  ThreadSafetyHandler &Handler;
-  Lockset::Factory &LocksetFactory;
-  LocalVariableMap &LocalVarMap;
-
-  Lockset LSet;
-  LocalVariableMap::Context LVarCtx;
-  unsigned CtxIndex;
-
-  // Helper functions
-  void addLock(const MutexID &Mutex, const LockData &LDat);
-  void removeLock(const MutexID &Mutex, SourceLocation UnlockLoc);
+  Lockset addLock(const Lockset &LSet, const MutexID &Mutex,
+                  const LockData &LDat);
+  Lockset addLock(const Lockset &LSet, Expr *MutexExp, const NamedDecl *D,
+                  const LockData &LDat);
+  Lockset removeLock(const Lockset &LSet, const MutexID &Mutex,
+                     SourceLocation UnlockLoc);
 
   template <class AttrType>
-  void addLocksToSet(LockKind LK, AttrType *Attr,
-                     Expr *Exp, NamedDecl *D, VarDecl *VD = 0);
-  void removeLocksFromSet(UnlockFunctionAttr *Attr,
-                          Expr *Exp, NamedDecl* FunDecl);
-
-  const ValueDecl *getValueDecl(Expr *Exp);
-  void warnIfMutexNotHeld (const NamedDecl *D, Expr *Exp, AccessKind AK,
-                           Expr *MutexExp, ProtectedOperationKind POK);
-  void checkAccess(Expr *Exp, AccessKind AK);
-  void checkDereference(Expr *Exp, AccessKind AK);
-  void handleCall(Expr *Exp, NamedDecl *D, VarDecl *VD = 0);
+  Lockset addLocksToSet(const Lockset &LSet, LockKind LK, AttrType *Attr,
+                        Expr *Exp, NamedDecl *D, VarDecl *VD = 0);
+  Lockset removeLocksFromSet(const Lockset &LSet,
+                             UnlockFunctionAttr *Attr,
+                             Expr *Exp, NamedDecl* FunDecl);
 
   template <class AttrType>
-  void addTrylock(LockKind LK, AttrType *Attr, Expr *Exp, NamedDecl *FunDecl,
-                  const CFGBlock* PredBlock, const CFGBlock *CurrBlock,
-                  Expr *BrE, bool Neg);
-  CallExpr* getTrylockCallExpr(Stmt *Cond, LocalVariableMap::Context C,
-                               bool &Negate);
-  void handleTrylock(Stmt *Cond, const CFGBlock* PredBlock,
-                     const CFGBlock *CurrBlock);
+  Lockset addTrylock(const Lockset &LSet,
+                     LockKind LK, AttrType *Attr, Expr *Exp, NamedDecl *FunDecl,
+                     const CFGBlock* PredBlock, const CFGBlock *CurrBlock,
+                     Expr *BrE, bool Neg);
+  const CallExpr* getTrylockCallExpr(const Stmt *Cond, LocalVarContext C,
+                                     bool &Negate);
+  Lockset handleTrylock(const Lockset &LSet,
+                        const CFGBlock* PredBlock,
+                        const CFGBlock *CurrBlock);
 
-  /// \brief Returns true if the lockset contains a lock, regardless of whether
-  /// the lock is held exclusively or shared.
-  bool locksetContains(const MutexID &Lock) const {
-    return LSet.lookup(Lock);
-  }
-
-  /// \brief Returns true if the lockset contains a lock with the passed in
-  /// locktype.
-  bool locksetContains(const MutexID &Lock, LockKind KindRequested) const {
-    const LockData *LockHeld = LSet.lookup(Lock);
-    return (LockHeld && KindRequested == LockHeld->LKind);
-  }
-
-  /// \brief Returns true if the lockset contains a lock with at least the
-  /// passed in locktype. So for example, if we pass in LK_Shared, this function
-  /// returns true if the lock is held LK_Shared or LK_Exclusive. If we pass in
-  /// LK_Exclusive, this function returns true if the lock is held LK_Exclusive.
-  bool locksetContainsAtLeast(const MutexID &Lock,
-                              LockKind KindRequested) const {
-    switch (KindRequested) {
-      case LK_Shared:
-        return locksetContains(Lock);
-      case LK_Exclusive:
-        return locksetContains(Lock, KindRequested);
-    }
-    llvm_unreachable("Unknown LockKind");
-  }
-
-public:
-  BuildLockset(ThreadSafetyAnalyzer *analyzer, CFGBlockInfo &Info)
-    : StmtVisitor<BuildLockset>(),
-      Handler(analyzer->Handler),
-      LocksetFactory(analyzer->LocksetFactory),
-      LocalVarMap(analyzer->LocalVarMap),
-      LSet(Info.EntrySet),
-      LVarCtx(Info.EntryContext),
-      CtxIndex(Info.EntryIndex)
-  {}
+  Lockset intersectAndWarn(const CFGBlockInfo &Block1, CFGBlockSide Side1,
+                           const CFGBlockInfo &Block2, CFGBlockSide Side2,
+                           LockErrorKind LEK);
 
-  void VisitUnaryOperator(UnaryOperator *UO);
-  void VisitBinaryOperator(BinaryOperator *BO);
-  void VisitCastExpr(CastExpr *CE);
-  void VisitCallExpr(CallExpr *Exp);
-  void VisitCXXConstructExpr(CXXConstructExpr *Exp);
-  void VisitDeclStmt(DeclStmt *S);
+  void runAnalysis(AnalysisDeclContext &AC);
 };
 
+
 /// \brief Add a new lock to the lockset, warning if the lock is already there.
 /// \param Mutex -- the Mutex expression for the lock
 /// \param LDat  -- the LockData for the lock
-void BuildLockset::addLock(const MutexID &Mutex, const LockData& LDat) {
+Lockset ThreadSafetyAnalyzer::addLock(const Lockset &LSet,
+                                      const MutexID &Mutex,
+                                      const LockData &LDat) {
   // FIXME: deal with acquired before/after annotations.
   // FIXME: Don't always warn when we have support for reentrant locks.
-  if (locksetContains(Mutex))
+  if (LSet.lookup(Mutex)) {
     Handler.handleDoubleLock(Mutex.getName(), LDat.AcquireLoc);
-  else
-    LSet = LocksetFactory.add(LSet, Mutex, LDat);
+    return LSet;
+  } else {
+    return LocksetFactory.add(LSet, Mutex, LDat);
+  }
+}
+
+/// \brief Construct a new mutex and add it to the lockset.
+Lockset ThreadSafetyAnalyzer::addLock(const Lockset &LSet,
+                                      Expr *MutexExp, const NamedDecl *D,
+                                      const LockData &LDat) {
+  MutexID Mutex(MutexExp, 0, D);
+  if (!Mutex.isValid()) {
+    MutexID::warnInvalidLock(Handler, MutexExp, 0, D);
+    return LSet;
+  }
+  return addLock(LSet, Mutex, LDat);
 }
 
+
 /// \brief Remove a lock from the lockset, warning if the lock is not there.
 /// \param LockExp The lock expression corresponding to the lock to be removed
 /// \param UnlockLoc The source location of the unlock (only used in error msg)
-void BuildLockset::removeLock(const MutexID &Mutex, SourceLocation UnlockLoc) {
+Lockset ThreadSafetyAnalyzer::removeLock(const Lockset &LSet,
+                                         const MutexID &Mutex,
+                                         SourceLocation UnlockLoc) {
   const LockData *LDat = LSet.lookup(Mutex);
-  if (!LDat)
+  if (!LDat) {
     Handler.handleUnmatchedUnlock(Mutex.getName(), UnlockLoc);
+    return LSet;
+  }
   else {
+    Lockset Result = LSet;
     // For scoped-lockable vars, remove the mutex associated with this var.
     if (LDat->UnderlyingMutex.isValid())
-      removeLock(LDat->UnderlyingMutex, UnlockLoc);
-    LSet = LocksetFactory.remove(LSet, Mutex);
+      Result = removeLock(Result, LDat->UnderlyingMutex, UnlockLoc);
+    return LocksetFactory.remove(Result, Mutex);
   }
 }
 
 /// \brief This function, parameterized by an attribute type, is used to add a
 /// set of locks specified as attribute arguments to the lockset.
 template <typename AttrType>
-void BuildLockset::addLocksToSet(LockKind LK, AttrType *Attr,
-                                 Expr *Exp, NamedDecl* FunDecl, VarDecl *VD) {
+Lockset ThreadSafetyAnalyzer::addLocksToSet(const Lockset &LSet,
+                                            LockKind LK, AttrType *Attr,
+                                            Expr *Exp, NamedDecl* FunDecl,
+                                            VarDecl *VD) {
   typedef typename AttrType::args_iterator iterator_type;
 
   SourceLocation ExpLocation = Exp->getExprLoc();
@@ -1025,56 +983,248 @@
   if (Attr->args_size() == 0) {
     // The mutex held is the "this" object.
     MutexID Mutex(0, Exp, FunDecl);
-    if (!Mutex.isValid())
+    if (!Mutex.isValid()) {
       MutexID::warnInvalidLock(Handler, 0, Exp, FunDecl);
-    else
-      addLock(Mutex, LockData(ExpLocation, LK));
-    return;
+      return LSet;
+    }
+    else {
+      return addLock(LSet, Mutex, LockData(ExpLocation, LK));
+    }
   }
 
+  Lockset Result = LSet;
   for (iterator_type I=Attr->args_begin(), E=Attr->args_end(); I != E; ++I) {
     MutexID Mutex(*I, Exp, FunDecl);
     if (!Mutex.isValid())
       MutexID::warnInvalidLock(Handler, *I, Exp, FunDecl);
     else {
-      addLock(Mutex, LockData(ExpLocation, LK));
+      Result = addLock(Result, Mutex, LockData(ExpLocation, LK));
       if (isScopedVar) {
         // For scoped lockable vars, map this var to its underlying mutex.
         DeclRefExpr DRE(VD, false, VD->getType(), VK_LValue, VD->getLocation());
         MutexID SMutex(&DRE, 0, 0);
-        addLock(SMutex, LockData(VD->getLocation(), LK, Mutex));
+        Result = addLock(Result, SMutex,
+                         LockData(VD->getLocation(), LK, Mutex));
       }
     }
   }
+  return Result;
 }
 
 /// \brief This function removes a set of locks specified as attribute
 /// arguments from the lockset.
-void BuildLockset::removeLocksFromSet(UnlockFunctionAttr *Attr,
-                                      Expr *Exp, NamedDecl* FunDecl) {
+Lockset ThreadSafetyAnalyzer::removeLocksFromSet(const Lockset &LSet,
+                                                 UnlockFunctionAttr *Attr,
+                                                 Expr *Exp, NamedDecl* FunDecl) {
   SourceLocation ExpLocation;
   if (Exp) ExpLocation = Exp->getExprLoc();
 
   if (Attr->args_size() == 0) {
     // The mutex held is the "this" object.
     MutexID Mu(0, Exp, FunDecl);
-    if (!Mu.isValid())
+    if (!Mu.isValid()) {
       MutexID::warnInvalidLock(Handler, 0, Exp, FunDecl);
-    else
-      removeLock(Mu, ExpLocation);
-    return;
+      return LSet;
+    } else {
+      return removeLock(LSet, Mu, ExpLocation);
+    }
   }
 
+  Lockset Result = LSet;
   for (UnlockFunctionAttr::args_iterator I = Attr->args_begin(),
        E = Attr->args_end(); I != E; ++I) {
     MutexID Mutex(*I, Exp, FunDecl);
     if (!Mutex.isValid())
       MutexID::warnInvalidLock(Handler, *I, Exp, FunDecl);
     else
-      removeLock(Mutex, ExpLocation);
+      Result = removeLock(Result, Mutex, ExpLocation);
+  }
+  return Result;
+}
+
+
+/// \brief Add lock to set, if the current block is in the taken branch of a
+/// trylock.
+template <class AttrType>
+Lockset ThreadSafetyAnalyzer::addTrylock(const Lockset &LSet,
+                                         LockKind LK, AttrType *Attr,
+                                         Expr *Exp, NamedDecl *FunDecl,
+                                         const CFGBlock *PredBlock,
+                                         const CFGBlock *CurrBlock,
+                                         Expr *BrE, bool Neg) {
+  // Find out which branch has the lock
+  bool branch = 0;
+  if (CXXBoolLiteralExpr *BLE = dyn_cast_or_null<CXXBoolLiteralExpr>(BrE)) {
+    branch = BLE->getValue();
+  }
+  else if (IntegerLiteral *ILE = dyn_cast_or_null<IntegerLiteral>(BrE)) {
+    branch = ILE->getValue().getBoolValue();
+  }
+  int branchnum = branch ? 0 : 1;
+  if (Neg) branchnum = !branchnum;
+
+  Lockset Result = LSet;
+  // If we've taken the trylock branch, then add the lock
+  int i = 0;
+  for (CFGBlock::const_succ_iterator SI = PredBlock->succ_begin(),
+       SE = PredBlock->succ_end(); SI != SE && i < 2; ++SI, ++i) {
+    if (*SI == CurrBlock && i == branchnum) {
+      Result = addLocksToSet(Result, LK, Attr, Exp, FunDecl, 0);
+    }
+  }
+  return Result;
+}
+
+
+// If Cond can be traced back to a function call, return the call expression.
+// The negate variable should be called with false, and will be set to true
+// if the function call is negated, e.g. if (!mu.tryLock(...))
+const CallExpr* ThreadSafetyAnalyzer::getTrylockCallExpr(const Stmt *Cond,
+                                                         LocalVarContext C,
+                                                         bool &Negate) {
+  if (!Cond)
+    return 0;
+
+  if (const CallExpr *CallExp = dyn_cast<CallExpr>(Cond)) {
+    return CallExp;
+  }
+  else if (const ImplicitCastExpr *CE = dyn_cast<ImplicitCastExpr>(Cond)) {
+    return getTrylockCallExpr(CE->getSubExpr(), C, Negate);
+  }
+  else if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Cond)) {
+    const Expr *E = LocalVarMap.lookupExpr(DRE->getDecl(), C);
+    return getTrylockCallExpr(E, C, Negate);
+  }
+  else if (const UnaryOperator *UOP = dyn_cast<UnaryOperator>(Cond)) {
+    if (UOP->getOpcode() == UO_LNot) {
+      Negate = !Negate;
+      return getTrylockCallExpr(UOP->getSubExpr(), C, Negate);
+    }
+  }
+  // FIXME -- handle && and || as well.
+  return NULL;
+}
+
+
+/// \brief Process a conditional branch from a previous block to the current
+/// block, looking for trylock calls.
+Lockset ThreadSafetyAnalyzer::handleTrylock(const Lockset &LSet,
+                                            const CFGBlock *PredBlock,
+                                            const CFGBlock *CurrBlock) {
+  bool Negate = false;
+  const Stmt *Cond = PredBlock->getTerminatorCondition();
+  const CFGBlockInfo *PredBlockInfo = &BlockInfo[PredBlock->getBlockID()];
+  const LocalVarContext &LVarCtx = PredBlockInfo->ExitContext;
+
+  CallExpr *Exp = const_cast<CallExpr*>(
+    getTrylockCallExpr(Cond, LVarCtx, Negate));
+  if (!Exp)
+    return LSet;
+
+  NamedDecl *FunDecl = dyn_cast_or_null<NamedDecl>(Exp->getCalleeDecl());
+  if(!FunDecl || !FunDecl->hasAttrs())
+    return LSet;
+
+  Lockset Result = LSet;
+
+  // If the condition is a call to a Trylock function, then grab the attributes
+  AttrVec &ArgAttrs = FunDecl->getAttrs();
+  for (unsigned i = 0; i < ArgAttrs.size(); ++i) {
+    Attr *Attr = ArgAttrs[i];
+    switch (Attr->getKind()) {
+      case attr::ExclusiveTrylockFunction: {
+        ExclusiveTrylockFunctionAttr *A =
+          cast<ExclusiveTrylockFunctionAttr>(Attr);
+        Result = addTrylock(Result, LK_Exclusive, A, Exp, FunDecl,
+                            PredBlock, CurrBlock,
+                            A->getSuccessValue(), Negate);
+        break;
+      }
+      case attr::SharedTrylockFunction: {
+        SharedTrylockFunctionAttr *A =
+          cast<SharedTrylockFunctionAttr>(Attr);
+        Result = addTrylock(Result, LK_Shared, A, Exp, FunDecl,
+                            PredBlock, CurrBlock,
+                            A->getSuccessValue(), Negate);
+        break;
+      }
+      default:
+        break;
+    }
   }
+  return Result;
 }
 
+
+/// \brief We use this class to visit different types of expressions in
+/// CFGBlocks, and build up the lockset.
+/// An expression may cause us to add or remove locks from the lockset, or else
+/// output error messages related to missing locks.
+/// FIXME: In future, we may be able to not inherit from a visitor.
+class BuildLockset : public StmtVisitor<BuildLockset> {
+  friend class ThreadSafetyAnalyzer;
+
+  ThreadSafetyAnalyzer *Analyzer;
+  Lockset LSet;
+  LocalVariableMap::Context LVarCtx;
+  unsigned CtxIndex;
+
+  // Helper functions
+  const ValueDecl *getValueDecl(Expr *Exp);
+
+  void warnIfMutexNotHeld(const NamedDecl *D, Expr *Exp, AccessKind AK,
+                          Expr *MutexExp, ProtectedOperationKind POK);
+
+  void checkAccess(Expr *Exp, AccessKind AK);
+  void checkDereference(Expr *Exp, AccessKind AK);
+  void handleCall(Expr *Exp, NamedDecl *D, VarDecl *VD = 0);
+
+  /// \brief Returns true if the lockset contains a lock, regardless of whether
+  /// the lock is held exclusively or shared.
+  bool locksetContains(const MutexID &Lock) const {
+    return LSet.lookup(Lock);
+  }
+
+  /// \brief Returns true if the lockset contains a lock with the passed in
+  /// locktype.
+  bool locksetContains(const MutexID &Lock, LockKind KindRequested) const {
+    const LockData *LockHeld = LSet.lookup(Lock);
+    return (LockHeld && KindRequested == LockHeld->LKind);
+  }
+
+  /// \brief Returns true if the lockset contains a lock with at least the
+  /// passed in locktype. So for example, if we pass in LK_Shared, this function
+  /// returns true if the lock is held LK_Shared or LK_Exclusive. If we pass in
+  /// LK_Exclusive, this function returns true if the lock is held LK_Exclusive.
+  bool locksetContainsAtLeast(const MutexID &Lock,
+                              LockKind KindRequested) const {
+    switch (KindRequested) {
+      case LK_Shared:
+        return locksetContains(Lock);
+      case LK_Exclusive:
+        return locksetContains(Lock, KindRequested);
+    }
+    llvm_unreachable("Unknown LockKind");
+  }
+
+public:
+  BuildLockset(ThreadSafetyAnalyzer *Anlzr, CFGBlockInfo &Info)
+    : StmtVisitor<BuildLockset>(),
+      Analyzer(Anlzr),
+      LSet(Info.EntrySet),
+      LVarCtx(Info.EntryContext),
+      CtxIndex(Info.EntryIndex)
+  {}
+
+  void VisitUnaryOperator(UnaryOperator *UO);
+  void VisitBinaryOperator(BinaryOperator *BO);
+  void VisitCastExpr(CastExpr *CE);
+  void VisitCallExpr(CallExpr *Exp);
+  void VisitCXXConstructExpr(CXXConstructExpr *Exp);
+  void VisitDeclStmt(DeclStmt *S);
+};
+
+
 /// \brief Gets the value decl pointer from DeclRefExprs or MemberExprs
 const ValueDecl *BuildLockset::getValueDecl(Expr *Exp) {
   if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Exp))
@@ -1095,9 +1245,10 @@
 
   MutexID Mutex(MutexExp, Exp, D);
   if (!Mutex.isValid())
-    MutexID::warnInvalidLock(Handler, MutexExp, Exp, D);
+    MutexID::warnInvalidLock(Analyzer->Handler, MutexExp, Exp, D);
   else if (!locksetContainsAtLeast(Mutex, LK))
-    Handler.handleMutexNotHeld(D, POK, Mutex.getName(), LK, Exp->getExprLoc());
+    Analyzer->Handler.handleMutexNotHeld(D, POK, Mutex.getName(), LK,
+                                         Exp->getExprLoc());
 }
 
 /// \brief This method identifies variable dereferences and checks pt_guarded_by
@@ -1117,7 +1268,8 @@
     return;
 
   if (D->getAttr<PtGuardedVarAttr>() && LSet.isEmpty())
-    Handler.handleNoMutexHeld(D, POK_VarDereference, AK, Exp->getExprLoc());
+    Analyzer->Handler.handleNoMutexHeld(D, POK_VarDereference, AK,
+                                        Exp->getExprLoc());
 
   const AttrVec &ArgAttrs = D->getAttrs();
   for(unsigned i = 0, Size = ArgAttrs.size(); i < Size; ++i)
@@ -1135,7 +1287,8 @@
     return;
 
   if (D->getAttr<GuardedVarAttr>() && LSet.isEmpty())
-    Handler.handleNoMutexHeld(D, POK_VarAccess, AK, Exp->getExprLoc());
+    Analyzer->Handler.handleNoMutexHeld(D, POK_VarAccess, AK,
+                                        Exp->getExprLoc());
 
   const AttrVec &ArgAttrs = D->getAttrs();
   for(unsigned i = 0, Size = ArgAttrs.size(); i < Size; ++i)
@@ -1166,7 +1319,7 @@
       // to our lockset with kind exclusive.
       case attr::ExclusiveLockFunction: {
         ExclusiveLockFunctionAttr *A = cast<ExclusiveLockFunctionAttr>(Attr);
-        addLocksToSet(LK_Exclusive, A, Exp, D, VD);
+        LSet = Analyzer->addLocksToSet(LSet, LK_Exclusive, A, Exp, D, VD);
         break;
       }
 
@@ -1174,7 +1327,7 @@
       // to our lockset with kind shared.
       case attr::SharedLockFunction: {
         SharedLockFunctionAttr *A = cast<SharedLockFunctionAttr>(Attr);
-        addLocksToSet(LK_Shared, A, Exp, D, VD);
+        LSet = Analyzer->addLocksToSet(LSet, LK_Shared, A, Exp, D, VD);
         break;
       }
 
@@ -1182,7 +1335,7 @@
       // mutexes from the lockset, and flag a warning if they are not there.
       case attr::UnlockFunction: {
         UnlockFunctionAttr *UFAttr = cast<UnlockFunctionAttr>(Attr);
-        removeLocksFromSet(UFAttr, Exp, D);
+        LSet = Analyzer->removeLocksFromSet(LSet, UFAttr, Exp, D);
         break;
       }
 
@@ -1211,10 +1364,11 @@
             E = LEAttr->args_end(); I != E; ++I) {
           MutexID Mutex(*I, Exp, D);
           if (!Mutex.isValid())
-            MutexID::warnInvalidLock(Handler, *I, Exp, D);
+            MutexID::warnInvalidLock(Analyzer->Handler, *I, Exp, D);
           else if (locksetContains(Mutex))
-            Handler.handleFunExcludesLock(D->getName(), Mutex.getName(),
-                                          Exp->getExprLoc());
+            Analyzer->Handler.handleFunExcludesLock(D->getName(),
+                                                    Mutex.getName(),
+                                                    Exp->getExprLoc());
         }
         break;
       }
@@ -1227,103 +1381,6 @@
 }
 
 
-/// \brief Add lock to set, if the current block is in the taken branch of a
-/// trylock.
-template <class AttrType>
-void BuildLockset::addTrylock(LockKind LK, AttrType *Attr, Expr *Exp,
-                              NamedDecl *FunDecl, const CFGBlock *PredBlock,
-                              const CFGBlock *CurrBlock, Expr *BrE, bool Neg) {
-  // Find out which branch has the lock
-  bool branch = 0;
-  if (CXXBoolLiteralExpr *BLE = dyn_cast_or_null<CXXBoolLiteralExpr>(BrE)) {
-    branch = BLE->getValue();
-  }
-  else if (IntegerLiteral *ILE = dyn_cast_or_null<IntegerLiteral>(BrE)) {
-    branch = ILE->getValue().getBoolValue();
-  }
-  int branchnum = branch ? 0 : 1;
-  if (Neg) branchnum = !branchnum;
-
-  // If we've taken the trylock branch, then add the lock
-  int i = 0;
-  for (CFGBlock::const_succ_iterator SI = PredBlock->succ_begin(),
-       SE = PredBlock->succ_end(); SI != SE && i < 2; ++SI, ++i) {
-    if (*SI == CurrBlock && i == branchnum) {
-      addLocksToSet(LK, Attr, Exp, FunDecl, 0);
-    }
-  }
-}
-
-
-// If Cond can be traced back to a function call, return the call expression.
-// The negate variable should be called with false, and will be set to true
-// if the function call is negated, e.g. if (!mu.tryLock(...))
-CallExpr* BuildLockset::getTrylockCallExpr(Stmt *Cond,
-                               LocalVariableMap::Context C,
-                               bool &Negate) {
-  if (!Cond)
-    return 0;
-
-  if (CallExpr *CallExp = dyn_cast<CallExpr>(Cond)) {
-    return CallExp;
-  }
-  else if (ImplicitCastExpr *CE = dyn_cast<ImplicitCastExpr>(Cond)) {
-    return getTrylockCallExpr(CE->getSubExpr(), C, Negate);
-  }
-  else if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Cond)) {
-    Expr *E = LocalVarMap.lookupExpr(DRE->getDecl(), C);
-    return getTrylockCallExpr(E, C, Negate);
-  }
-  else if (UnaryOperator *UOP = dyn_cast<UnaryOperator>(Cond)) {
-    if (UOP->getOpcode() == UO_LNot) {
-      Negate = !Negate;
-      return getTrylockCallExpr(UOP->getSubExpr(), C, Negate);
-    }
-  }
-  // FIXME -- handle && and || as well.
-  return NULL;
-}
-
-
-/// \brief Process a conditional branch from a previous block to the current
-/// block, looking for trylock calls.
-void BuildLockset::handleTrylock(Stmt *Cond, const CFGBlock *PredBlock,
-                                 const CFGBlock *CurrBlock) {
-  bool Negate = false;
-  CallExpr *Exp = getTrylockCallExpr(Cond, LVarCtx, Negate);
-  if (!Exp)
-    return;
-
-  NamedDecl *FunDecl = dyn_cast_or_null<NamedDecl>(Exp->getCalleeDecl());
-  if(!FunDecl || !FunDecl->hasAttrs())
-    return;
-
-  // If the condition is a call to a Trylock function, then grab the attributes
-  AttrVec &ArgAttrs = FunDecl->getAttrs();
-  for (unsigned i = 0; i < ArgAttrs.size(); ++i) {
-    Attr *Attr = ArgAttrs[i];
-    switch (Attr->getKind()) {
-      case attr::ExclusiveTrylockFunction: {
-        ExclusiveTrylockFunctionAttr *A =
-          cast<ExclusiveTrylockFunctionAttr>(Attr);
-        addTrylock(LK_Exclusive, A, Exp, FunDecl, PredBlock, CurrBlock,
-                   A->getSuccessValue(), Negate);
-        break;
-      }
-      case attr::SharedTrylockFunction: {
-        SharedTrylockFunctionAttr *A =
-          cast<SharedTrylockFunctionAttr>(Attr);
-        addTrylock(LK_Shared, A, Exp, FunDecl, PredBlock, CurrBlock,
-                   A->getSuccessValue(), Negate);
-        break;
-      }
-      default:
-        break;
-    }
-  }
-}
-
-
 /// \brief For unary operations which read and write a variable, we need to
 /// check whether we hold any required mutexes. Reads are checked in
 /// VisitCastExpr.
@@ -1351,7 +1408,7 @@
     return;
 
   // adjust the context
-  LVarCtx = LocalVarMap.getNextContext(CtxIndex, BO, LVarCtx);
+  LVarCtx = Analyzer->LocalVarMap.getNextContext(CtxIndex, BO, LVarCtx);
 
   Expr *LHSExp = BO->getLHS()->IgnoreParenCasts();
   checkAccess(LHSExp, AK_Written);
@@ -1383,7 +1440,7 @@
 
 void BuildLockset::VisitDeclStmt(DeclStmt *S) {
   // adjust the context
-  LVarCtx = LocalVarMap.getNextContext(CtxIndex, S, LVarCtx);
+  LVarCtx = Analyzer->LocalVarMap.getNextContext(CtxIndex, S, LVarCtx);
 
   DeclGroupRef DGrp = S->getDeclGroup();
   for (DeclGroupRef::iterator I = DGrp.begin(), E = DGrp.end(); I != E; ++I) {
@@ -1450,17 +1507,6 @@
   return Intersection;
 }
 
-Lockset ThreadSafetyAnalyzer::addLock(Lockset &LSet, Expr *MutexExp,
-                                      const NamedDecl *D,
-                                      LockKind LK, SourceLocation Loc) {
-  MutexID Mutex(MutexExp, 0, D);
-  if (!Mutex.isValid()) {
-    MutexID::warnInvalidLock(Handler, MutexExp, 0, D);
-    return LSet;
-  }
-  LockData NewLock(Loc, LK);
-  return LocksetFactory.add(LSet, Mutex, NewLock);
-}
 
 /// \brief Check a function's CFG for thread-safety violations.
 ///
@@ -1485,7 +1531,7 @@
   if (isa<CXXDestructorDecl>(D))
     return;  // Don't check inside destructors.
 
-  std::vector<CFGBlockInfo> BlockInfo(CFGraph->getNumBlockIDs(),
+  BlockInfo.resize(CFGraph->getNumBlockIDs(),
     CFGBlockInfo::getEmptyBlockInfo(LocksetFactory, LocalVarMap));
 
   // We need to explore the CFG via a "topological" ordering.
@@ -1515,17 +1561,15 @@
         for (SharedLocksRequiredAttr::args_iterator
              SLRIter = SLRAttr->args_begin(),
              SLREnd = SLRAttr->args_end(); SLRIter != SLREnd; ++SLRIter)
-          InitialLockset = addLock(InitialLockset,
-                                   *SLRIter, D, LK_Shared,
-                                   AttrLoc);
+          InitialLockset = addLock(InitialLockset, *SLRIter, D,
+                                   LockData(AttrLoc, LK_Shared));
       } else if (ExclusiveLocksRequiredAttr *ELRAttr
                    = dyn_cast<ExclusiveLocksRequiredAttr>(Attr)) {
         for (ExclusiveLocksRequiredAttr::args_iterator
              ELRIter = ELRAttr->args_begin(),
              ELREnd = ELRAttr->args_end(); ELRIter != ELREnd; ++ELRIter)
-          InitialLockset = addLock(InitialLockset,
-                                   *ELRIter, D, LK_Exclusive,
-                                   AttrLoc);
+          InitialLockset = addLock(InitialLockset, *ELRIter, D,
+                                   LockData(AttrLoc, LK_Exclusive));
       } else if (isa<UnlockFunctionAttr>(Attr)) {
         // Don't try to check unlock functions for now
         return;
@@ -1626,17 +1670,19 @@
       }
     }
 
-    BuildLockset LocksetBuilder(this, *CurrBlockInfo);
-    CFGBlock::const_pred_iterator PI = CurrBlock->pred_begin(),
-                                  PE = CurrBlock->pred_end();
-    if (PI != PE) {
+    // If the previous block ended in a trylock, then grab any extra mutexes
+    // from the trylock.
+    for (CFGBlock::const_pred_iterator PI = CurrBlock->pred_begin(),
+         PE = CurrBlock->pred_end(); PI != PE; ++PI) {
       // If the predecessor ended in a branch, then process any trylocks.
-      // FIXME -- check to make sure there's only one predecessor.
-      if (Stmt *TCE = (*PI)->getTerminatorCondition()) {
-        LocksetBuilder.handleTrylock(TCE, *PI, CurrBlock);
+      if ((*PI)->getTerminatorCondition()) {
+        CurrBlockInfo->EntrySet = handleTrylock(CurrBlockInfo->EntrySet,
+                                                *PI, CurrBlock);
       }
     }
 
+    BuildLockset LocksetBuilder(this, *CurrBlockInfo);
+
     // Visit all the statements in the basic block.
     for (CFGBlock::const_iterator BI = CurrBlock->begin(),
          BE = CurrBlock->end(); BI != BE; ++BI) {

Modified: cfe/branches/tooling/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Basic/Targets.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Basic/Targets.cpp (original)
+++ cfe/branches/tooling/lib/Basic/Targets.cpp Wed Apr 25 07:05:17 2012
@@ -365,7 +365,7 @@
     DefineStd(Builder, "unix", Opts);
     Builder.defineMacro("__ELF__");
     if (Opts.POSIXThreads)
-      Builder.defineMacro("_POSIX_THREADS");
+      Builder.defineMacro("_REENTRANT");
   }
 public:
   OpenBSDTargetInfo(const std::string &triple)

Modified: cfe/branches/tooling/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGClass.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGClass.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGClass.cpp Wed Apr 25 07:05:17 2012
@@ -717,7 +717,8 @@
 
   // Before we go any further, try the complete->base constructor
   // delegation optimization.
-  if (CtorType == Ctor_Complete && IsConstructorDelegationValid(Ctor)) {
+  if (CtorType == Ctor_Complete && IsConstructorDelegationValid(Ctor) &&
+      CGM.getContext().getTargetInfo().getCXXABI() != CXXABI_Microsoft) {
     if (CGDebugInfo *DI = getDebugInfo()) 
       DI->EmitLocation(Builder, Ctor->getLocEnd());
     EmitDelegateCXXConstructorCall(Ctor, Ctor_Base, Args);
@@ -916,7 +917,7 @@
     // Enter the cleanup scopes for virtual bases.
     EnterDtorCleanups(Dtor, Dtor_Complete);
 
-    if (!isTryBody) {
+    if (!isTryBody && CGM.getContext().getTargetInfo().getCXXABI() != CXXABI_Microsoft) {
       EmitCXXDestructorCall(Dtor, Dtor_Base, /*ForVirtualBase=*/false,
                             LoadCXXThis());
       break;

Modified: cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp Wed Apr 25 07:05:17 2012
@@ -350,8 +350,8 @@
     return llvm::DIType();
   case BuiltinType::ObjCClass:
     return DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
-                                      "objc_class", getOrCreateMainFile(),
-                                      0);
+                                      "objc_class", TheCU,
+                                      getOrCreateMainFile(), 0);
   case BuiltinType::ObjCId: {
     // typedef struct objc_class *Class;
     // typedef struct objc_object {
@@ -361,8 +361,7 @@
     // TODO: Cache these two types to avoid duplicates.
     llvm::DIType OCTy =
       DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
-                                 "objc_class", getOrCreateMainFile(),
-                                 0);
+                                 "objc_class", TheCU, getOrCreateMainFile(), 0);
     unsigned Size = CGM.getContext().getTypeSize(CGM.getContext().VoidPtrTy);
     
     llvm::DIType ISATy = DBuilder.createPointerType(OCTy, Size);
@@ -382,7 +381,7 @@
   case BuiltinType::ObjCSel: {
     return
       DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
-                                 "objc_selector", getOrCreateMainFile(),
+                                 "objc_selector", TheCU, getOrCreateMainFile(),
                                  0);
   }
   case BuiltinType::UChar:
@@ -514,7 +513,7 @@
     llvm_unreachable("Unknown RecordDecl type!");
 
   // Create the type.
-  return DBuilder.createForwardDecl(Tag, RDName, DefUnit, Line);
+  return DBuilder.createForwardDecl(Tag, RDName, Ctx, DefUnit, Line);
 }
 
 // Walk up the context chain and create forward decls for record decls,
@@ -1287,7 +1286,7 @@
   if (!Def) {
     llvm::DIType FwdDecl =
       DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
-				 ID->getName(), DefUnit, Line,
+				 ID->getName(), TheCU, DefUnit, Line,
 				 RuntimeLang);
     return FwdDecl;
   }

Modified: cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGObjCMac.cpp Wed Apr 25 07:05:17 2012
@@ -3612,7 +3612,8 @@
 
   // A flag indicating that the module has no instances of a @synthesize of a
   // superclass variable. <rdar://problem/6803242>
-  eImageInfo_CorrectedSynthesize = (1 << 4)
+  eImageInfo_CorrectedSynthesize = (1 << 4),
+  eImageInfo_ImageIsSimulated    = (1 << 5)
 };
 
 void CGObjCCommonMac::EmitImageInfo() {
@@ -3657,6 +3658,14 @@
                         llvm::MDNode::get(VMContext, Ops));
     }
   }
+
+  // Indicate whether we're compiling this to run on a simulator.
+  const llvm::Triple &Triple = CGM.getTarget().getTriple();
+  if (Triple.getOS() == llvm::Triple::IOS &&
+      (Triple.getArch() == llvm::Triple::x86 ||
+       Triple.getArch() == llvm::Triple::x86_64))
+    Mod.addModuleFlag(llvm::Module::Error, "Objective-C Is Simulated",
+                      eImageInfo_ImageIsSimulated);
 }
 
 // struct objc_module {

Modified: cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp Wed Apr 25 07:05:17 2012
@@ -881,33 +881,49 @@
   llvm::ConstantInt *zero = Builder.getInt32(0);
   gepIndices.push_back(zero);
 
-  // It's more efficient to calculate the count from the LLVM
-  // constant-length arrays than to re-evaluate the array bounds.
   uint64_t countFromCLAs = 1;
+  QualType eltType;
 
   llvm::ArrayType *llvmArrayType =
-    cast<llvm::ArrayType>(
+    dyn_cast<llvm::ArrayType>(
       cast<llvm::PointerType>(addr->getType())->getElementType());
-  while (true) {
+  while (llvmArrayType) {
     assert(isa<ConstantArrayType>(arrayType));
     assert(cast<ConstantArrayType>(arrayType)->getSize().getZExtValue()
              == llvmArrayType->getNumElements());
 
     gepIndices.push_back(zero);
     countFromCLAs *= llvmArrayType->getNumElements();
+    eltType = arrayType->getElementType();
 
     llvmArrayType =
       dyn_cast<llvm::ArrayType>(llvmArrayType->getElementType());
-    if (!llvmArrayType) break;
-
     arrayType = getContext().getAsArrayType(arrayType->getElementType());
-    assert(arrayType && "LLVM and Clang types are out-of-synch");
+    assert((!llvmArrayType || arrayType) &&
+           "LLVM and Clang types are out-of-synch");
   }
 
-  baseType = arrayType->getElementType();
+  if (arrayType) {
+    // From this point onwards, the Clang array type has been emitted
+    // as some other type (probably a packed struct). Compute the array
+    // size, and just emit the 'begin' expression as a bitcast.
+    while (arrayType) {
+      countFromCLAs *=
+          cast<ConstantArrayType>(arrayType)->getSize().getZExtValue();
+      eltType = arrayType->getElementType();
+      arrayType = getContext().getAsArrayType(eltType);
+    }
+
+    unsigned AddressSpace =
+        cast<llvm::PointerType>(addr->getType())->getAddressSpace();
+    llvm::Type *BaseType = ConvertType(eltType)->getPointerTo(AddressSpace);
+    addr = Builder.CreateBitCast(addr, BaseType, "array.begin");
+  } else {
+    // Create the actual GEP.
+    addr = Builder.CreateInBoundsGEP(addr, gepIndices, "array.begin");
+  }
 
-  // Create the actual GEP.
-  addr = Builder.CreateInBoundsGEP(addr, gepIndices, "array.begin");
+  baseType = eltType;
 
   llvm::Value *numElements
     = llvm::ConstantInt::get(SizeTy, countFromCLAs);

Modified: cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp Wed Apr 25 07:05:17 2012
@@ -102,9 +102,10 @@
   if (LangOpts.CUDA)
     createCUDARuntime();
 
-  // Enable TBAA unless it's suppressed.
-  if (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0)
-    TBAA = new CodeGenTBAA(Context, VMContext, getLangOpts(),
+  // Enable TBAA unless it's suppressed. ThreadSanitizer needs TBAA even at O0.
+  if (LangOpts.ThreadSanitizer ||
+      (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0))
+    TBAA = new CodeGenTBAA(Context, VMContext, CodeGenOpts, getLangOpts(),
                            ABI.getMangleContext());
 
   // If debug info or coverage generation is enabled, create the CGDebugInfo

Modified: cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.cpp Wed Apr 25 07:05:17 2012
@@ -18,6 +18,7 @@
 #include "CodeGenTBAA.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Mangle.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/LLVMContext.h"
 #include "llvm/Metadata.h"
 #include "llvm/Constants.h"
@@ -26,8 +27,10 @@
 using namespace CodeGen;
 
 CodeGenTBAA::CodeGenTBAA(ASTContext &Ctx, llvm::LLVMContext& VMContext,
+                         const CodeGenOptions &CGO,
                          const LangOptions &Features, MangleContext &MContext)
-  : Context(Ctx), VMContext(VMContext), Features(Features), MContext(MContext),
+  : Context(Ctx), VMContext(VMContext), CodeGenOpts(CGO),
+    Features(Features), MContext(MContext),
     MDHelper(VMContext), Root(0), Char(0) {
 }
 
@@ -74,6 +77,10 @@
 
 llvm::MDNode *
 CodeGenTBAA::getTBAAInfo(QualType QTy) {
+  // At -O0 TBAA is not emitted for regular types.
+  if (CodeGenOpts.OptimizationLevel == 0 || CodeGenOpts.RelaxedAliasing)
+    return NULL;
+
   // If the type has the may_alias attribute (even on a typedef), it is
   // effectively in the general char alias class.
   if (TypeHasMayAlias(QTy))

Modified: cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.h (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenTBAA.h Wed Apr 25 07:05:17 2012
@@ -26,6 +26,7 @@
 
 namespace clang {
   class ASTContext;
+  class CodeGenOptions;
   class LangOptions;
   class MangleContext;
   class QualType;
@@ -39,6 +40,7 @@
 class CodeGenTBAA {
   ASTContext &Context;
   llvm::LLVMContext& VMContext;
+  const CodeGenOptions &CodeGenOpts;
   const LangOptions &Features;
   MangleContext &MContext;
 
@@ -61,6 +63,7 @@
 
 public:
   CodeGenTBAA(ASTContext &Ctx, llvm::LLVMContext &VMContext,
+              const CodeGenOptions &CGO,
               const LangOptions &Features,
               MangleContext &MContext);
   ~CodeGenTBAA();

Modified: cfe/branches/tooling/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Driver.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Driver.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Driver.cpp Wed Apr 25 07:05:17 2012
@@ -379,7 +379,7 @@
     return;  
 
   // Don't try to generate diagnostics for link jobs.
-  if (FailingCommand->getCreator().isLinkJob())
+  if (FailingCommand && FailingCommand->getCreator().isLinkJob())
     return;
 
   Diag(clang::diag::note_drv_command_failed_diag_msg)
@@ -489,6 +489,21 @@
         Diag(clang::diag::note_drv_command_failed_diag_msg)
           << "Error generating run script: " + Script + " " + Err;
       } else {
+        // Strip -D, -F, and -I.
+        // FIXME: This doesn't work with quotes (e.g., -D "foo bar").
+        std::string Flag[4] = {"-D ", "-F", "-I ", "-o "};
+        for (unsigned i = 0; i < 4; ++i) {
+          size_t I = 0, E = 0;
+          do {
+            I = Cmd.find(Flag[i], I);
+            if (I == std::string::npos) break;
+            
+            E = Cmd.find(" ", I + Flag[i].length());
+            if (E == std::string::npos) break;
+            Cmd.erase(I, E - I + 1);
+          } while(1);
+        }
+        // FIXME: Append the new filename with correct preprocessed suffix.
         ScriptOS << Cmd;
         Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;
       }
@@ -1453,15 +1468,24 @@
     NamedOutput = C.getArgs().MakeArgString(Suffixed.c_str());
   }
 
-  // If we're saving temps and the temp filename conflicts with the input
-  // filename, then avoid overwriting input file.
+  // If we're saving temps and the temp file conflicts with the input file, 
+  // then avoid overwriting input file.
   if (!AtTopLevel && C.getArgs().hasArg(options::OPT_save_temps) &&
       NamedOutput == BaseName) {
-    StringRef Name = llvm::sys::path::filename(BaseInput);
-    std::pair<StringRef, StringRef> Split = Name.split('.');
-    std::string TmpName =
-      GetTemporaryPath(Split.first, types::getTypeTempSuffix(JA.getType()));
-    return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str()));
+
+    bool SameFile = false;
+    SmallString<256> Result;
+    llvm::sys::fs::current_path(Result);
+    llvm::sys::path::append(Result, BaseName);
+    llvm::sys::fs::equivalent(BaseInput, Result.c_str(), SameFile);
+    // Must share the same path to conflict.
+    if (SameFile) {
+      StringRef Name = llvm::sys::path::filename(BaseInput);
+      std::pair<StringRef, StringRef> Split = Name.split('.');
+      std::string TmpName =
+        GetTemporaryPath(Split.first, types::getTypeTempSuffix(JA.getType()));
+      return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str()));
+    }
   }
 
   // As an annoying special case, PCH generation doesn't strip the pathname.

Modified: cfe/branches/tooling/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Tools.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Tools.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Tools.cpp Wed Apr 25 07:05:17 2012
@@ -448,7 +448,7 @@
     .Case("armv3m", "arm7m")
     .Cases("armv4", "armv4t", "arm7tdmi")
     .Cases("armv5", "armv5t", "arm10tdmi")
-    .Cases("armv5e", "armv5te", "arm1026ejs")
+    .Cases("armv5e", "armv5te", "arm1022e")
     .Case("armv5tej", "arm926ej-s")
     .Cases("armv6", "armv6k", "arm1136jf-s")
     .Case("armv6j", "arm1136j-s")
@@ -1269,22 +1269,33 @@
 /// This needs to be called before we add the C run-time (malloc, etc).
 static void addAsanRTLinux(const ToolChain &TC, const ArgList &Args,
                            ArgStringList &CmdArgs) {
-  // Add asan linker flags when linking an executable, but not a shared object.
-  if (Args.hasArg(options::OPT_shared) ||
-      !Args.hasFlag(options::OPT_faddress_sanitizer,
+  if (!Args.hasFlag(options::OPT_faddress_sanitizer,
                     options::OPT_fno_address_sanitizer, false))
     return;
+  if(TC.getTriple().getEnvironment() == llvm::Triple::ANDROIDEABI) {
+    if (!Args.hasArg(options::OPT_shared)) {
+      // For an executable, we add a .preinit_array stub.
+      CmdArgs.push_back("-u");
+      CmdArgs.push_back("__asan_preinit");
+      CmdArgs.push_back("-lasan");
+    }
 
-  // LibAsan is "libclang_rt.asan-<ArchName>.a" in the Linux library resource
-  // directory.
-  SmallString<128> LibAsan(TC.getDriver().ResourceDir);
-  llvm::sys::path::append(LibAsan, "lib", "linux",
-                          (Twine("libclang_rt.asan-") +
-                           TC.getArchName() + ".a"));
-  CmdArgs.push_back(Args.MakeArgString(LibAsan));
-  CmdArgs.push_back("-lpthread");
-  CmdArgs.push_back("-ldl");
-  CmdArgs.push_back("-export-dynamic");
+    CmdArgs.push_back("-lasan_preload");
+    CmdArgs.push_back("-ldl");
+  } else {
+    if (!Args.hasArg(options::OPT_shared)) {
+      // LibAsan is "libclang_rt.asan-<ArchName>.a" in the Linux library
+      // resource directory.
+      SmallString<128> LibAsan(TC.getDriver().ResourceDir);
+      llvm::sys::path::append(LibAsan, "lib", "linux",
+                              (Twine("libclang_rt.asan-") +
+                               TC.getArchName() + ".a"));
+      CmdArgs.push_back(Args.MakeArgString(LibAsan));
+      CmdArgs.push_back("-lpthread");
+      CmdArgs.push_back("-ldl");
+      CmdArgs.push_back("-export-dynamic");
+    }
+  }
 }
 
 static bool shouldUseFramePointer(const ArgList &Args,
@@ -4216,9 +4227,9 @@
       if ((!runtime.HasARC && isObjCAutoRefCount(Args)) ||
           !runtime.HasSubscripting)
         getDarwinToolChain().AddLinkARCArgs(Args, CmdArgs);
-      CmdArgs.push_back("-framework");
-      CmdArgs.push_back("Foundation");
     }
+    CmdArgs.push_back("-framework");
+    CmdArgs.push_back("Foundation");
     // Link libobj.
     CmdArgs.push_back("-lobjc");
   }
@@ -5064,6 +5075,14 @@
     StringRef MArch = getToolChain().getArchName();
     if (MArch == "armv7" || MArch == "armv7a" || MArch == "armv7-a")
       CmdArgs.push_back("-mfpu=neon");
+
+    StringRef ARMFloatABI = getARMFloatABI(getToolChain().getDriver(), Args,
+                                           getToolChain().getTriple());
+    CmdArgs.push_back(Args.MakeArgString("-mfloat-abi=" + ARMFloatABI));
+
+    Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
+    Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ);
+    Args.AddLastArg(CmdArgs, options::OPT_mfpu_EQ);
   } else if (getToolChain().getArch() == llvm::Triple::mips ||
              getToolChain().getArch() == llvm::Triple::mipsel ||
              getToolChain().getArch() == llvm::Triple::mips64 ||
@@ -5091,10 +5110,6 @@
       CmdArgs.push_back("-EL");
   }
 
-  Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
-  Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ);
-  Args.AddLastArg(CmdArgs, options::OPT_mfpu_EQ);
-
   Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
                        options::OPT_Xassembler);
 
@@ -5112,9 +5127,10 @@
   C.addCommand(new Command(JA, *this, Exec, CmdArgs));
 }
 
-static void AddLibgcc(const Driver &D, ArgStringList &CmdArgs,
-                      const ArgList &Args) {
-  bool StaticLibgcc = Args.hasArg(options::OPT_static) ||
+static void AddLibgcc(llvm::Triple Triple, const Driver &D,
+                      ArgStringList &CmdArgs, const ArgList &Args) {
+  bool isAndroid = Triple.getEnvironment() == llvm::Triple::ANDROIDEABI;
+  bool StaticLibgcc = isAndroid || Args.hasArg(options::OPT_static) ||
     Args.hasArg(options::OPT_static_libgcc);
   if (!D.CCCIsCXX)
     CmdArgs.push_back("-lgcc");
@@ -5130,7 +5146,7 @@
       CmdArgs.push_back("--no-as-needed");
   }
 
-  if (StaticLibgcc)
+  if (StaticLibgcc && !isAndroid)
     CmdArgs.push_back("-lgcc_eh");
   else if (!Args.hasArg(options::OPT_shared) && D.CCCIsCXX)
     CmdArgs.push_back("-lgcc");
@@ -5144,6 +5160,9 @@
   const toolchains::Linux& ToolChain =
     static_cast<const toolchains::Linux&>(getToolChain());
   const Driver &D = ToolChain.getDriver();
+  const bool isAndroid = ToolChain.getTriple().getEnvironment() ==
+    llvm::Triple::ANDROIDEABI;
+
   ArgStringList CmdArgs;
 
   // Silence warning for "clang -g foo.o -o foo"
@@ -5204,6 +5223,10 @@
       CmdArgs.push_back("-static");
   } else if (Args.hasArg(options::OPT_shared)) {
     CmdArgs.push_back("-shared");
+    if ((ToolChain.getArch() == llvm::Triple::arm
+         || ToolChain.getArch() == llvm::Triple::thumb) && isAndroid) {
+      CmdArgs.push_back("-Bsymbolic");
+    }
   }
 
   if (ToolChain.getArch() == llvm::Triple::arm ||
@@ -5211,7 +5234,9 @@
       (!Args.hasArg(options::OPT_static) &&
        !Args.hasArg(options::OPT_shared))) {
     CmdArgs.push_back("-dynamic-linker");
-    if (ToolChain.getArch() == llvm::Triple::x86)
+    if (isAndroid)
+      CmdArgs.push_back("/system/bin/linker");
+    else if (ToolChain.getArch() == llvm::Triple::x86)
       CmdArgs.push_back("/lib/ld-linux.so.2");
     else if (ToolChain.getArch() == llvm::Triple::arm ||
              ToolChain.getArch() == llvm::Triple::thumb)
@@ -5235,25 +5260,27 @@
 
   if (!Args.hasArg(options::OPT_nostdlib) &&
       !Args.hasArg(options::OPT_nostartfiles)) {
-    const char *crt1 = NULL;
-    if (!Args.hasArg(options::OPT_shared)){
-      if (Args.hasArg(options::OPT_pie))
-        crt1 = "Scrt1.o";
-      else
-        crt1 = "crt1.o";
-    }
-    if (crt1)
-      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
+    if (!isAndroid) {
+      const char *crt1 = NULL;
+      if (!Args.hasArg(options::OPT_shared)){
+        if (Args.hasArg(options::OPT_pie))
+          crt1 = "Scrt1.o";
+        else
+          crt1 = "crt1.o";
+      }
+      if (crt1)
+        CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crt1)));
 
-    CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
+      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
+    }
 
     const char *crtbegin;
     if (Args.hasArg(options::OPT_static))
-      crtbegin = "crtbeginT.o";
+      crtbegin = isAndroid ? "crtbegin_static.o" : "crtbeginT.o";
     else if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
-      crtbegin = "crtbeginS.o";
+      crtbegin = isAndroid ? "crtbegin_so.o" : "crtbeginS.o";
     else
-      crtbegin = "crtbegin.o";
+      crtbegin = isAndroid ? "crtbegin_dynamic.o" : "crtbegin.o";
     CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
   }
 
@@ -5294,7 +5321,7 @@
     if (Args.hasArg(options::OPT_static))
       CmdArgs.push_back("--start-group");
 
-    AddLibgcc(D, CmdArgs, Args);
+    AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);
 
     if (Args.hasArg(options::OPT_pthread) ||
         Args.hasArg(options::OPT_pthreads))
@@ -5305,18 +5332,19 @@
     if (Args.hasArg(options::OPT_static))
       CmdArgs.push_back("--end-group");
     else
-      AddLibgcc(D, CmdArgs, Args);
+      AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);
 
 
     if (!Args.hasArg(options::OPT_nostartfiles)) {
       const char *crtend;
       if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_pie))
-        crtend = "crtendS.o";
+        crtend = isAndroid ? "crtend_so.o" : "crtendS.o";
       else
-        crtend = "crtend.o";
+        crtend = isAndroid ? "crtend_android.o" : "crtend.o";
 
       CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
-      CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
+      if (!isAndroid)
+        CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
     }
   }
 

Modified: cfe/branches/tooling/lib/Headers/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Headers/CMakeLists.txt?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Headers/CMakeLists.txt (original)
+++ cfe/branches/tooling/lib/Headers/CMakeLists.txt Wed Apr 25 07:05:17 2012
@@ -8,6 +8,7 @@
   float.h
   fma4intrin.h
   immintrin.h
+  intrin.h
   iso646.h
   limits.h
   lzcntintrin.h

Modified: cfe/branches/tooling/lib/Headers/float.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Headers/float.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Headers/float.h (original)
+++ cfe/branches/tooling/lib/Headers/float.h Wed Apr 25 07:05:17 2012
@@ -28,7 +28,7 @@
  * additional definitions provided for Windows.
  * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx
  */
-#if defined(__MINGW32__) && \
+#if (defined(__MINGW32__) || defined(_MSC_VER)) && \
     defined(__has_include_next) && __has_include_next(<float.h>)
 #  include_next <float.h>
 

Modified: cfe/branches/tooling/lib/Headers/stddef.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Headers/stddef.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Headers/stddef.h (original)
+++ cfe/branches/tooling/lib/Headers/stddef.h Wed Apr 25 07:05:17 2012
@@ -43,10 +43,13 @@
 
 #undef NULL
 #ifdef __cplusplus
-#undef __null  // VC++ hack.
-#define NULL __null
+#  if !defined(__MINGW32__) && !defined(_MSC_VER)
+#    define NULL __null
+#  else
+#    define NULL 0
+#  endif
 #else
-#define NULL ((void*)0)
+#  define NULL ((void*)0)
 #endif
 
 #define offsetof(t, d) __builtin_offsetof(t, d)

Modified: cfe/branches/tooling/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDecl.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDecl.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDecl.cpp Wed Apr 25 07:05:17 2012
@@ -4270,6 +4270,8 @@
                       D.getDeclSpec().getStorageClassSpec()
                         != DeclSpec::SCS_typedef &&
                       !D.getDeclSpec().isFriendSpecified());
+      for (unsigned i = 0, e = D.getNumTypeObjects(); Delayed && i != e; ++i)
+        Delayed &= D.getTypeObject(i).Kind == DeclaratorChunk::Paren;
       ESpecType = tryParseExceptionSpecification(Delayed,
                                                  ESpecRange,
                                                  DynamicExceptions,

Modified: cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp Wed Apr 25 07:05:17 2012
@@ -2369,6 +2369,10 @@
     SourceLocation SavedPrevTokLocation = PrevTokLocation;
     ParseLexedAttributes(getCurrentClass());
     ParseLexedMethodDeclarations(getCurrentClass());
+
+    // We've finished with all pending member declarations.
+    Actions.ActOnFinishCXXMemberDecls();
+
     ParseLexedMemberInitializers(getCurrentClass());
     ParseLexedMethodDefs(getCurrentClass());
     PrevTokLocation = SavedPrevTokLocation;
@@ -2843,7 +2847,7 @@
     StringRef Spelling = PP.getSpelling(Tok.getLocation(), SpellingBuf);
     if (std::isalpha(Spelling[0])) {
       Loc = ConsumeToken();
-      return &PP.getIdentifierTable().get(Spelling.data());
+      return &PP.getIdentifierTable().get(Spelling);
     }
     return 0;
   }

Modified: cfe/branches/tooling/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseTentative.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseTentative.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseTentative.cpp Wed Apr 25 07:05:17 2012
@@ -931,8 +931,12 @@
     // recurse to handle whatever we get.
     if (TryAnnotateTypeOrScopeToken())
       return TPResult::Error();
-    if (Tok.is(tok::identifier))
-      return TPResult::False();
+    if (Tok.is(tok::identifier)) {
+      const Token &Next = NextToken();
+      bool NotObjC = !(getLangOpts().ObjC1 || getLangOpts().ObjC2);
+      return (NotObjC && Next.is(tok::identifier)) ?
+          TPResult::True() : TPResult::False();
+    }
     return isCXXDeclarationSpecifier(BracedCastResult);
 
   case tok::coloncolon: {    // ::foo::bar

Modified: cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp Wed Apr 25 07:05:17 2012
@@ -337,7 +337,7 @@
     
     // Block specific rewrite rules.
     void RewriteBlockPointerDecl(NamedDecl *VD);
-    void RewriteByRefVar(VarDecl *VD);
+    void RewriteByRefVar(VarDecl *VD, bool firstDecl, bool lastDecl);
     Stmt *RewriteBlockDeclRefExpr(DeclRefExpr *VD);
     Stmt *RewriteLocalVariableExternalStorage(DeclRefExpr *DRE);
     void RewriteBlockPointerFunctionArgs(FunctionDecl *FD);
@@ -2262,7 +2262,11 @@
   if (i+1 < numArgs)
     FdStr += ", ";
   }
-  FdStr +=  ");\n";
+  if (FD->isVariadic()) {
+    FdStr +=  (numArgs > 0) ? ", ...);\n" : "...);\n";
+  }
+  else
+    FdStr +=  ");\n";
   InsertText(FunLocStart, FdStr);
 }
 
@@ -4007,19 +4011,15 @@
 /// extern "C" or extern "C" {...}
 static SourceLocation getFunctionSourceLocation (RewriteModernObjC &R,
                                                  FunctionDecl *FD) {
-  if (!FD->isExternC() || FD->isMain()) {
-    if (FD->getStorageClassAsWritten() != SC_None)
-      R.RewriteBlockLiteralFunctionDecl(FD);
-    return FD->getTypeSpecStartLoc();
-  }
-  const DeclContext *DC = FD->getDeclContext();
-  if (const LinkageSpecDecl *LSD = dyn_cast<LinkageSpecDecl>(DC)) {
-    SourceLocation BodyRBrace = LSD->getRBraceLoc();
-    // if it is extern "C" {...}, return function decl's own location.
-    if (BodyRBrace.isValid())
-      return FD->getTypeSpecStartLoc();
-    return LSD->getExternLoc();
+  if (FD->isExternC()  && !FD->isMain()) {
+    const DeclContext *DC = FD->getDeclContext();
+    if (const LinkageSpecDecl *LSD = dyn_cast<LinkageSpecDecl>(DC))
+      // if it is extern "C" {...}, return function decl's own location.
+      if (!LSD->getRBraceLoc().isValid())
+        return LSD->getExternLoc();
   }
+  if (FD->getStorageClassAsWritten() != SC_None)
+    R.RewriteBlockLiteralFunctionDecl(FD);
   return FD->getTypeSpecStartLoc();
 }
 
@@ -4742,7 +4742,8 @@
 ///                               ND=initializer-if-any};
 ///
 ///
-void RewriteModernObjC::RewriteByRefVar(VarDecl *ND) {
+void RewriteModernObjC::RewriteByRefVar(VarDecl *ND, bool firstDecl,
+                                        bool lastDecl) {
   int flag = 0;
   int isa = 0;
   SourceLocation DeclLoc = ND->getTypeSpecStartLoc();
@@ -4787,11 +4788,11 @@
     FunLocStart = CurMethodDef->getLocStart();
   }
   InsertText(FunLocStart, ByrefType);
+  
   if (Ty.isObjCGCWeak()) {
     flag |= BLOCK_FIELD_IS_WEAK;
     isa = 1;
   }
-  
   if (HasCopyAndDispose) {
     flag = BLOCK_BYREF_CALLER;
     QualType Ty = ND->getType();
@@ -4821,21 +4822,36 @@
   RewriteByRefString(ByrefType, Name, ND);
   std::string ForwardingCastType("(");
   ForwardingCastType += ByrefType + " *)";
+  ByrefType += " " + Name + " = {(void*)";
+  ByrefType += utostr(isa);
+  ByrefType += "," +  ForwardingCastType + "&" + Name + ", ";
+  ByrefType += utostr(flags);
+  ByrefType += ", ";
+  ByrefType += "sizeof(";
+  RewriteByRefString(ByrefType, Name, ND);
+  ByrefType += ")";
+  if (HasCopyAndDispose) {
+    ByrefType += ", __Block_byref_id_object_copy_";
+    ByrefType += utostr(flag);
+    ByrefType += ", __Block_byref_id_object_dispose_";
+    ByrefType += utostr(flag);
+  }
+  
+  if (!firstDecl) {
+    // In multiple __block declarations, and for all but 1st declaration,
+    // find location of the separating comma. This would be start location
+    // where new text is to be inserted.
+    DeclLoc = ND->getLocation();
+    const char *startDeclBuf = SM->getCharacterData(DeclLoc);
+    const char *commaBuf = startDeclBuf;
+    while (*commaBuf != ',')
+      commaBuf--;
+    assert((*commaBuf == ',') && "RewriteByRefVar: can't find ','");
+    DeclLoc = DeclLoc.getLocWithOffset(commaBuf - startDeclBuf);
+    startBuf = commaBuf;
+  }
+  
   if (!hasInit) {
-    ByrefType += " " + Name + " = {(void*)";
-    ByrefType += utostr(isa);
-    ByrefType += "," +  ForwardingCastType + "&" + Name + ", ";
-    ByrefType += utostr(flags);
-    ByrefType += ", ";
-    ByrefType += "sizeof(";
-    RewriteByRefString(ByrefType, Name, ND);
-    ByrefType += ")";
-    if (HasCopyAndDispose) {
-      ByrefType += ", __Block_byref_id_object_copy_";
-      ByrefType += utostr(flag);
-      ByrefType += ", __Block_byref_id_object_dispose_";
-      ByrefType += utostr(flag);
-    }
     ByrefType += "};\n";
     unsigned nameSize = Name.size();
     // for block or function pointer declaration. Name is aleady
@@ -4845,6 +4861,7 @@
     ReplaceText(DeclLoc, endBuf-startBuf+nameSize, ByrefType);
   }
   else {
+    ByrefType += ", ";
     SourceLocation startLoc;
     Expr *E = ND->getInit();
     if (const CStyleCastExpr *ECE = dyn_cast<CStyleCastExpr>(E))
@@ -4853,39 +4870,17 @@
       startLoc = E->getLocStart();
     startLoc = SM->getExpansionLoc(startLoc);
     endBuf = SM->getCharacterData(startLoc);
-    ByrefType += " " + Name;
-    ByrefType += " = {(void*)";
-    ByrefType += utostr(isa);
-    ByrefType += "," +  ForwardingCastType + "&" + Name + ", ";
-    ByrefType += utostr(flags);
-    ByrefType += ", ";
-    ByrefType += "sizeof(";
-    RewriteByRefString(ByrefType, Name, ND);
-    ByrefType += "), ";
-    if (HasCopyAndDispose) {
-      ByrefType += "__Block_byref_id_object_copy_";
-      ByrefType += utostr(flag);
-      ByrefType += ", __Block_byref_id_object_dispose_";
-      ByrefType += utostr(flag);
-      ByrefType += ", ";
-    }
     ReplaceText(DeclLoc, endBuf-startBuf, ByrefType);
-    
-    // Complete the newly synthesized compound expression by inserting a right
-    // curly brace before the end of the declaration.
-    // FIXME: This approach avoids rewriting the initializer expression. It
-    // also assumes there is only one declarator. For example, the following
-    // isn't currently supported by this routine (in general):
-    // 
-    // double __block BYREFVAR = 1.34, BYREFVAR2 = 1.37;
-    //
-    const char *startInitializerBuf = SM->getCharacterData(startLoc);
-    const char *semiBuf = strchr(startInitializerBuf, ';');
-    assert((*semiBuf == ';') && "RewriteByRefVar: can't find ';'");
-    SourceLocation semiLoc =
-      startLoc.getLocWithOffset(semiBuf-startInitializerBuf);
 
-    InsertText(semiLoc, "}");
+    const char separator = lastDecl ? ';' : ',';
+    const char *startInitializerBuf = SM->getCharacterData(startLoc);
+    const char *separatorBuf = strchr(startInitializerBuf, separator);
+    assert((*separatorBuf == separator) && 
+           "RewriteByRefVar: can't find ';' or ','");
+    SourceLocation separatorLoc =
+      startLoc.getLocWithOffset(separatorBuf-startInitializerBuf);
+    
+    InsertText(separatorLoc, lastDecl ? "}" : "};\n");
   }
   return;
 }
@@ -5323,7 +5318,7 @@
             assert(!BlockByRefDeclNo.count(ND) &&
               "RewriteFunctionBodyOrGlobalInitializer: Duplicate byref decl");
             BlockByRefDeclNo[ND] = uniqueByrefDeclCount++;
-            RewriteByRefVar(VD);
+            RewriteByRefVar(VD, (DI == DS->decl_begin()), ((DI+1) == DE));
           }
           else           
             RewriteTypeOfDecl(VD);

Modified: cfe/branches/tooling/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/Sema.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/Sema.cpp (original)
+++ cfe/branches/tooling/lib/Sema/Sema.cpp Wed Apr 25 07:05:17 2012
@@ -90,7 +90,9 @@
     PackContext(0), MSStructPragmaOn(false), VisContext(0),
     ExprNeedsCleanups(false), LateTemplateParser(0), OpaqueParser(0),
     IdResolver(pp), StdInitializerList(0), CXXTypeInfoDecl(0), MSVCGuidDecl(0),
-    NSNumberDecl(0), NSArrayDecl(0), ArrayWithObjectsMethod(0), 
+    NSNumberDecl(0),
+    NSStringDecl(0), StringWithUTF8StringMethod(0),
+    NSArrayDecl(0), ArrayWithObjectsMethod(0),
     NSDictionaryDecl(0), DictionaryWithObjectsMethod(0),
     GlobalNewDeleteDeclared(false), 
     ObjCShouldCallSuperDealloc(false),

Modified: cfe/branches/tooling/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDecl.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDecl.cpp Wed Apr 25 07:05:17 2012
@@ -9784,21 +9784,6 @@
     if (!Completed)
       Record->completeDefinition();
 
-    // Now that the record is complete, do any delayed exception spec checks
-    // we were missing.
-    while (!DelayedDestructorExceptionSpecChecks.empty()) {
-      const CXXDestructorDecl *Dtor =
-              DelayedDestructorExceptionSpecChecks.back().first;
-      if (Dtor->getParent() != Record)
-        break;
-
-      assert(!Dtor->getParent()->isDependentType() &&
-          "Should not ever add destructors of templates into the list.");
-      CheckOverridingFunctionExceptionSpec(Dtor,
-          DelayedDestructorExceptionSpecChecks.back().second);
-      DelayedDestructorExceptionSpecChecks.pop_back();
-    }
-
   } else {
     ObjCIvarDecl **ClsFields =
       reinterpret_cast<ObjCIvarDecl**>(RecFields.data());

Modified: cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp Wed Apr 25 07:05:17 2012
@@ -238,17 +238,40 @@
   return QT->isBooleanType() || QT->isIntegerType();
 }
 
+
+// Check to see if the type is a smart pointer of some kind.  We assume
+// it's a smart pointer if it defines both operator-> and operator*.
+static bool threadSafetyCheckIsSmartPointer(Sema &S, const QualType QT) {
+  if (const RecordType *RT = QT->getAs<RecordType>()) {
+    DeclContextLookupConstResult Res1 = RT->getDecl()->lookup(
+      S.Context.DeclarationNames.getCXXOperatorName(OO_Star));
+    if (Res1.first == Res1.second)
+      return false;
+
+    DeclContextLookupConstResult Res2 = RT->getDecl()->lookup(
+      S.Context.DeclarationNames.getCXXOperatorName(OO_Arrow));
+    if (Res2.first != Res2.second)
+      return true;
+  }
+  return false;
+}
+
 ///
 /// \brief Check if passed in Decl is a pointer type.
 /// Note that this function may produce an error message.
 /// \return true if the Decl is a pointer type; false otherwise
 ///
-static bool checkIsPointer(Sema &S, const Decl *D, const AttributeList &Attr) {
+static bool threadSafetyCheckIsPointer(Sema &S, const Decl *D,
+                                       const AttributeList &Attr) {
   if (const ValueDecl *vd = dyn_cast<ValueDecl>(D)) {
     QualType QT = vd->getType();
     if (QT->isAnyPointerType())
       return true;
-    S.Diag(Attr.getLoc(), diag::warn_pointer_attribute_wrong_type)
+
+    if (threadSafetyCheckIsSmartPointer(S, QT))
+      return true;
+
+    S.Diag(Attr.getLoc(), diag::warn_thread_attribute_decl_not_pointer)
       << Attr.getName()->getName() << QT;
   } else {
     S.Diag(Attr.getLoc(), diag::err_attribute_can_be_applied_only_to_value_decl)
@@ -271,14 +294,14 @@
 }
 
 /// \brief Thread Safety Analysis: Checks that the passed in RecordType
-/// resolves to a lockable object. May flag an error.
+/// resolves to a lockable object.
 static void checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr,
                                    QualType Ty) {
   const RecordType *RT = getRecordType(Ty);
                                    
   // Warn if could not get record type for this argument.
   if (!RT) {
-    S.Diag(Attr.getLoc(), diag::warn_attribute_argument_not_class)
+    S.Diag(Attr.getLoc(), diag::warn_thread_attribute_argument_not_class)
       << Attr.getName() << Ty.getAsString();
     return;
   }
@@ -287,18 +310,18 @@
     return;
   // Warn if the type is not lockable.
   if (!RT->getDecl()->getAttr<LockableAttr>()) {
-    S.Diag(Attr.getLoc(), diag::warn_attribute_argument_not_lockable)
+    S.Diag(Attr.getLoc(), diag::warn_thread_attribute_argument_not_lockable)
       << Attr.getName() << Ty.getAsString();
     return;
   }
 }
 
 /// \brief Thread Safety Analysis: Checks that all attribute arguments, starting
-/// from Sidx, resolve to a lockable object. May flag an error.
+/// from Sidx, resolve to a lockable object.
 /// \param Sidx The attribute argument index to start checking with.
 /// \param ParamIdxOk Whether an argument can be indexing into a function
 /// parameter list.
-static bool checkAttrArgsAreLockableObjs(Sema &S, Decl *D,
+static void checkAttrArgsAreLockableObjs(Sema &S, Decl *D,
                                          const AttributeList &Attr,
                                          SmallVectorImpl<Expr*> &Args,
                                          int Sidx = 0,
@@ -307,13 +330,33 @@
     Expr *ArgExp = Attr.getArg(Idx);
 
     if (ArgExp->isTypeDependent()) {
-      // FIXME -- need to processs this again on template instantiation
+      // FIXME -- need to check this again on template instantiation
       Args.push_back(ArgExp);
       continue;
     }
 
+    if (StringLiteral *StrLit = dyn_cast<StringLiteral>(ArgExp)) {
+      // Ignore empty strings without warnings
+      if (StrLit->getLength() == 0)
+        continue;
+
+      // We allow constant strings to be used as a placeholder for expressions
+      // that are not valid C++ syntax, but warn that they are ignored.
+      S.Diag(Attr.getLoc(), diag::warn_thread_attribute_ignored) <<
+        Attr.getName();
+      continue;
+    }
+
     QualType ArgTy = ArgExp->getType();
 
+    // A pointer to member expression of the form  &MyClass::mu is treated
+    // specially -- we need to look at the type of the member.
+    if (UnaryOperator *UOp = dyn_cast<UnaryOperator>(ArgExp))
+      if (UOp->getOpcode() == UO_AddrOf)
+        if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(UOp->getSubExpr()))
+          if (DRE->getDecl()->isCXXInstanceMember())
+            ArgTy = DRE->getDecl()->getType();
+
     // First see if we can just cast to record type, or point to record type.
     const RecordType *RT = getRecordType(ArgTy);
 
@@ -329,7 +372,7 @@
         if(!ArgValue.isStrictlyPositive() || ParamIdxFromOne > NumParams) {
           S.Diag(Attr.getLoc(), diag::err_attribute_argument_out_of_range)
             << Attr.getName() << Idx + 1 << NumParams;
-          return false;
+          continue;
         }
         ArgTy = FD->getParamDecl(ParamIdxFromZero)->getType();
       }
@@ -339,7 +382,6 @@
 
     Args.push_back(ArgExp);
   }
-  return true;
 }
 
 //===----------------------------------------------------------------------===//
@@ -364,7 +406,7 @@
     return;
   }
 
-  if (pointer && !checkIsPointer(S, D, Attr))
+  if (pointer && !threadSafetyCheckIsPointer(S, D, Attr))
     return;
 
   if (pointer)
@@ -380,8 +422,6 @@
   if (!checkAttributeNumArgs(S, Attr, 1))
     return;
 
-  Expr *Arg = Attr.getArg(0);
-
   // D must be either a member field or global (potentially shared) variable.
   if (!mayBeSharedVariable(D)) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
@@ -389,12 +429,16 @@
     return;
   }
 
-  if (pointer && !checkIsPointer(S, D, Attr))
+  if (pointer && !threadSafetyCheckIsPointer(S, D, Attr))
     return;
 
-  if (!Arg->isTypeDependent()) {
-    checkForLockableRecord(S, D, Attr, Arg->getType());
-  }
+  SmallVector<Expr*, 1> Args;
+  // check that all arguments are lockable objects
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args);
+  unsigned Size = Args.size();
+  if (Size != 1)
+    return;
+  Expr *Arg = Args[0];
 
   if (pointer)
     D->addAttr(::new (S.Context) PtGuardedByAttr(Attr.getRange(),
@@ -442,7 +486,7 @@
 }
 
 static void handleNoAddressSafetyAttr(Sema &S, Decl *D,
-                                     const AttributeList &Attr) {
+                                      const AttributeList &Attr) {
   assert(!Attr.isInvalid());
 
   if (!checkAttributeNumArgs(S, Attr, 0))
@@ -473,25 +517,24 @@
     return;
   }
 
-  // Check that this attribute only applies to lockable types
+  // Check that this attribute only applies to lockable types.
   QualType QT = VD->getType();
   if (!QT->isDependentType()) {
     const RecordType *RT = getRecordType(QT);
     if (!RT || !RT->getDecl()->getAttr<LockableAttr>()) {
-      S.Diag(Attr.getLoc(), diag::warn_attribute_decl_not_lockable)
+      S.Diag(Attr.getLoc(), diag::warn_thread_attribute_decl_not_lockable)
               << Attr.getName();
       return;
     }
   }
 
   SmallVector<Expr*, 1> Args;
-  // check that all arguments are lockable objects
-  if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args))
-    return;
-
+  // Check that all arguments are lockable objects.
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args);
   unsigned Size = Args.size();
-  assert(Size == Attr.getNumArgs());
-  Expr **StartArg = Size == 0 ? 0 : &Args[0];
+  if (Size == 0)
+    return;
+  Expr **StartArg = &Args[0];
 
   if (before)
     D->addAttr(::new (S.Context) AcquiredBeforeAttr(Attr.getRange(), S.Context,
@@ -516,11 +559,8 @@
 
   // check that all arguments are lockable objects
   SmallVector<Expr*, 1> Args;
-  if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args, 0, /*ParamIdxOk=*/true))
-    return;
-
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args, 0, /*ParamIdxOk=*/true);
   unsigned Size = Args.size();
-  assert(Size == Attr.getNumArgs());
   Expr **StartArg = Size == 0 ? 0 : &Args[0];
 
   if (exclusive)
@@ -540,7 +580,6 @@
   if (!checkAttributeAtLeastNumArgs(S, Attr, 1))
     return;
 
-
   if (!isa<FunctionDecl>(D) && !isa<FunctionTemplateDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
       << Attr.getName() << ExpectedFunctionOrMethod;
@@ -555,9 +594,7 @@
 
   SmallVector<Expr*, 2> Args;
   // check that all arguments are lockable objects
-  if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args, 1))
-    return;
-
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args, 1);
   unsigned Size = Args.size();
   Expr **StartArg = Size == 0 ? 0 : &Args[0];
 
@@ -588,12 +625,11 @@
 
   // check that all arguments are lockable objects
   SmallVector<Expr*, 1> Args;
-  if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args))
-    return;
-
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args);
   unsigned Size = Args.size();
-  assert(Size == Attr.getNumArgs());
-  Expr **StartArg = Size == 0 ? 0 : &Args[0];
+  if (Size == 0)
+    return;
+  Expr **StartArg = &Args[0];
 
   if (exclusive)
     D->addAttr(::new (S.Context) ExclusiveLocksRequiredAttr(Attr.getRange(),
@@ -619,11 +655,8 @@
 
   // check that all arguments are lockable objects
   SmallVector<Expr*, 1> Args;
-  if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args, 0, /*ParamIdxOk=*/true))
-    return;
-
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args, 0, /*ParamIdxOk=*/true);
   unsigned Size = Args.size();
-  assert(Size == Attr.getNumArgs());
   Expr **StartArg = Size == 0 ? 0 : &Args[0];
 
   D->addAttr(::new (S.Context) UnlockFunctionAttr(Attr.getRange(), S.Context,
@@ -668,12 +701,11 @@
 
   // check that all arguments are lockable objects
   SmallVector<Expr*, 1> Args;
-  if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args))
-    return;
-
+  checkAttrArgsAreLockableObjs(S, D, Attr, Args);
   unsigned Size = Args.size();
-  assert(Size == Attr.getNumArgs());
-  Expr **StartArg = Size == 0 ? 0 : &Args[0];
+  if (Size == 0)
+    return;
+  Expr **StartArg = &Args[0];
 
   D->addAttr(::new (S.Context) LocksExcludedAttr(Attr.getRange(), S.Context,
                                                  StartArg, Size));
@@ -3336,8 +3368,8 @@
 
   ObjCMethodDecl *method = dyn_cast<ObjCMethodDecl>(D);
 
-  if (!isa<ObjCMethodDecl>(method)) {
-    S.Diag(method->getLocStart(), diag::err_attribute_wrong_decl_type)
+  if (!method) {
+    S.Diag(D->getLocStart(), diag::err_attribute_wrong_decl_type)
       << SourceRange(loc, loc) << attr.getName() << ExpectedMethod;
     return;
   }
@@ -4157,9 +4189,13 @@
   // Otherwise, don't warn if our current context is deprecated.
   if (isDeclDeprecated(cast<Decl>(getCurLexicalContext())))
     return;
-  if (!Message.empty())
+  if (!Message.empty()) {
     Diag(Loc, diag::warn_deprecated_message) << D->getDeclName() 
                                              << Message;
+    Diag(D->getLocation(), 
+         isa<ObjCMethodDecl>(D) ? diag::note_method_declared_at 
+                                : diag::note_previous_decl) << D->getDeclName();
+  }
   else {
     if (!UnknownObjCClass)
       Diag(Loc, diag::warn_deprecated) << D->getDeclName();

Modified: cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp Wed Apr 25 07:05:17 2012
@@ -7317,15 +7317,42 @@
   }
 }
 
+/// \brief Perform any semantic analysis which needs to be delayed until all
+/// pending class member declarations have been parsed.
+void Sema::ActOnFinishCXXMemberDecls() {
+  // Now we have parsed all exception specifications, determine the implicit
+  // exception specifications for destructors.
+  for (unsigned i = 0, e = DelayedDestructorExceptionSpecs.size();
+       i != e; ++i) {
+    CXXDestructorDecl *Dtor = DelayedDestructorExceptionSpecs[i];
+    AdjustDestructorExceptionSpec(Dtor->getParent(), Dtor, true);
+  }
+  DelayedDestructorExceptionSpecs.clear();
+
+  // Perform any deferred checking of exception specifications for virtual
+  // destructors.
+  for (unsigned i = 0, e = DelayedDestructorExceptionSpecChecks.size();
+       i != e; ++i) {
+    const CXXDestructorDecl *Dtor =
+        DelayedDestructorExceptionSpecChecks[i].first;
+    assert(!Dtor->getParent()->isDependentType() &&
+           "Should not ever add destructors of templates into the list.");
+    CheckOverridingFunctionExceptionSpec(Dtor,
+        DelayedDestructorExceptionSpecChecks[i].second);
+  }
+  DelayedDestructorExceptionSpecChecks.clear();
+}
+
 void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *classDecl,
-                                         CXXDestructorDecl *destructor) {
+                                         CXXDestructorDecl *destructor,
+                                         bool WasDelayed) {
   // C++11 [class.dtor]p3:
   //   A declaration of a destructor that does not have an exception-
   //   specification is implicitly considered to have the same exception-
   //   specification as an implicit declaration.
   const FunctionProtoType *dtorType = destructor->getType()->
                                         getAs<FunctionProtoType>();
-  if (dtorType->hasExceptionSpec())
+  if (!WasDelayed && dtorType->hasExceptionSpec())
     return;
 
   ImplicitExceptionSpecification exceptSpec =
@@ -7342,6 +7369,14 @@
 
   destructor->setType(ty);
 
+  // If we can't compute the exception specification for this destructor yet
+  // (because it depends on an exception specification which we have not parsed
+  // yet), make a note that we need to try again when the class is complete.
+  if (epi.ExceptionSpecType == EST_Delayed) {
+    assert(!WasDelayed && "couldn't compute destructor exception spec");
+    DelayedDestructorExceptionSpecs.push_back(destructor);
+  }
+
   // FIXME: If the destructor has a body that could throw, and the newly created
   // spec doesn't allow exceptions, we should emit a warning, because this
   // change in behavior can break conforming C++03 programs at runtime.
@@ -7577,8 +7612,9 @@
     assert(!Base->getType()->isDependentType() &&
            "Cannot generate implicit members for class with dependent bases.");
     CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl();
-    LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0,
-                            &HasConstCopyAssignment);
+    HasConstCopyAssignment &=
+      (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const,
+                                    false, 0);
   }
 
   // In C++11, the above citation has "or virtual" added
@@ -7589,8 +7625,9 @@
       assert(!Base->getType()->isDependentType() &&
              "Cannot generate implicit members for class with dependent bases.");
       CXXRecordDecl *BaseClassDecl = Base->getType()->getAsCXXRecordDecl();
-      LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const, false, 0,
-                              &HasConstCopyAssignment);
+      HasConstCopyAssignment &=
+        (bool)LookupCopyingAssignment(BaseClassDecl, Qualifiers::Const,
+                                      false, 0);
     }
   }
   
@@ -7604,8 +7641,9 @@
        ++Field) {
     QualType FieldType = Context.getBaseElementType((*Field)->getType());
     if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
-      LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const, false, 0,
-                              &HasConstCopyAssignment);
+      HasConstCopyAssignment &=
+        (bool)LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const,
+                                      false, 0);
     }
   }
   
@@ -8608,8 +8646,8 @@
     
     CXXRecordDecl *BaseClassDecl
       = cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
-    LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const,
-                             &HasConstCopyConstructor);
+    HasConstCopyConstructor &=
+      (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const);
   }
 
   for (CXXRecordDecl::base_class_iterator Base = ClassDecl->vbases_begin(),
@@ -8618,8 +8656,8 @@
        ++Base) {
     CXXRecordDecl *BaseClassDecl
       = cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
-    LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const,
-                             &HasConstCopyConstructor);
+    HasConstCopyConstructor &=
+      (bool)LookupCopyingConstructor(BaseClassDecl, Qualifiers::Const);
   }
   
   //     -- for all the nonstatic data members of X that are of a
@@ -8632,8 +8670,8 @@
        ++Field) {
     QualType FieldType = Context.getBaseElementType((*Field)->getType());
     if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
-      LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const,
-                               &HasConstCopyConstructor);
+      HasConstCopyConstructor &=
+        (bool)LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const);
     }
   }
   //   Otherwise, the implicitly declared copy constructor will have
@@ -11091,7 +11129,7 @@
   //   static member function (although its type and value category are defined
   //   within a static member function as they are within a non-static member
   //   function). [ Note: this is because declaration matching does not occur
-  //  until the complete declarator is known. — end note ] 
+  //  until the complete declarator is known. - end note ]
   const FunctionProtoType *Proto = ProtoTL->getTypePtr();
   FindCXXThisExpr Finder(*this);
   
@@ -11277,11 +11315,9 @@
   if (!Method)
     return;
   
-  // Dig out the prototype. This should never fail.
+  // Dig out the prototype, looking through only parens. This should never fail.
   const FunctionProtoType *Proto
-    = dyn_cast<FunctionProtoType>(Method->getType());
-  if (!Proto)
-    return;
+    = cast<FunctionProtoType>(Method->getType().IgnoreParens());
   
   // Check the exception specification.
   llvm::SmallVector<QualType, 4> Exceptions;
@@ -11294,6 +11330,12 @@
                                        Proto->arg_type_begin(),
                                        Proto->getNumArgs(),
                                        EPI);
+
+  // Rebuild any parens around the function type.
+  for (const ParenType *PT = dyn_cast<ParenType>(Method->getType()); PT;
+       PT = dyn_cast<ParenType>(PT->getInnerType()))
+    T = Context.getParenType(T);
+
   if (TypeSourceInfo *TSInfo = Method->getTypeSourceInfo()) {
     // FIXME: When we get proper type location information for exceptions,
     // we'll also have to rebuild the TypeSourceInfo. For now, we just patch

Modified: cfe/branches/tooling/lib/Sema/SemaExprMember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprMember.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprMember.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprMember.cpp Wed Apr 25 07:05:17 2012
@@ -436,8 +436,8 @@
     if (PT && (!getLangOpts().ObjC1 ||
                PT->getPointeeType()->isRecordType())) {
       assert(BaseExpr && "cannot happen with implicit member accesses");
-      Diag(NameInfo.getLoc(), diag::err_typecheck_member_reference_struct_union)
-        << BaseType << BaseExpr->getSourceRange();
+      Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
+        << BaseType << BaseExpr->getSourceRange() << NameInfo.getSourceRange();
       return ExprError();
     }
   }
@@ -1418,8 +1418,8 @@
                             ObjCImpDecl, HasTemplateArgs);
   }
 
-  Diag(MemberLoc, diag::err_typecheck_member_reference_struct_union)
-    << BaseType << BaseExpr.get()->getSourceRange();
+  Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
+    << BaseType << BaseExpr.get()->getSourceRange() << MemberLoc;
 
   return ExprError();
 }

Modified: cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp Wed Apr 25 07:05:17 2012
@@ -1323,6 +1323,50 @@
   return 0;
 }
 
+static void DiagnoseARCUseOfWeakReceiver(Sema &S, Expr *Receiver) {
+  if (!Receiver)
+    return;
+  
+  Expr *RExpr = Receiver->IgnoreParenImpCasts();
+  SourceLocation Loc = RExpr->getLocStart();
+  QualType T = RExpr->getType();
+  ObjCPropertyDecl *PDecl = 0;
+  ObjCMethodDecl *GDecl = 0;
+  if (PseudoObjectExpr *POE = dyn_cast<PseudoObjectExpr>(RExpr)) {
+    RExpr = POE->getSyntacticForm();
+    if (ObjCPropertyRefExpr *PRE = dyn_cast<ObjCPropertyRefExpr>(RExpr)) {
+      if (PRE->isImplicitProperty()) {
+        GDecl = PRE->getImplicitPropertyGetter();
+        if (GDecl) {
+          T = GDecl->getResultType();
+        }
+      }
+      else {
+        PDecl = PRE->getExplicitProperty();
+        if (PDecl) {
+          T = PDecl->getType();
+        }
+      }
+    }
+  }
+  
+  if (T.getObjCLifetime() == Qualifiers::OCL_Weak) {
+    S.Diag(Loc, diag::warn_receiver_is_weak) 
+      << ((!PDecl && !GDecl) ? 0 : (PDecl ? 1 : 2));
+    if (PDecl)
+      S.Diag(PDecl->getLocation(), diag::note_property_declare);
+    else if (GDecl)
+      S.Diag(GDecl->getLocation(), diag::note_method_declared_at) << GDecl;
+    return;
+  }
+  
+  if (PDecl && 
+      (PDecl->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak)) {
+    S.Diag(Loc, diag::warn_receiver_is_weak) << 1;
+    S.Diag(PDecl->getLocation(), diag::note_property_declare);
+  }
+}
+
 /// HandleExprPropertyRefExpr - Handle foo.bar where foo is a pointer to an
 /// objective C interface.  This is a property reference expression.
 ExprResult Sema::
@@ -1354,7 +1398,6 @@
     // Check whether we can reference this property.
     if (DiagnoseUseOfDecl(PD, MemberLoc))
       return ExprError();
-             
     if (Super)
       return Owned(new (Context) ObjCPropertyRefExpr(PD, Context.PseudoObjectTy,
                                                      VK_LValue, OK_ObjCProperty,
@@ -1372,7 +1415,7 @@
       // Check whether we can reference this property.
       if (DiagnoseUseOfDecl(PD, MemberLoc))
         return ExprError();
-      
+
       if (Super)
         return Owned(new (Context) ObjCPropertyRefExpr(PD,
                                                        Context.PseudoObjectTy,
@@ -2379,10 +2422,7 @@
   }
 
   if (getLangOpts().ObjCAutoRefCount) {
-    if (Receiver &&
-        (Receiver->IgnoreParenImpCasts()->getType().getObjCLifetime() 
-          == Qualifiers::OCL_Weak))
-      Diag(Receiver->getLocStart(), diag::warn_receiver_is_weak);
+    DiagnoseARCUseOfWeakReceiver(*this, Receiver);
     
     // In ARC, annotate delegate init calls.
     if (Result->getMethodFamily() == OMF_init &&

Modified: cfe/branches/tooling/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaLookup.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaLookup.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaLookup.cpp Wed Apr 25 07:05:17 2012
@@ -2277,7 +2277,7 @@
     Result->setMethod(DD);
     Result->setKind(DD->isDeleted() ?
                     SpecialMemberOverloadResult::NoMemberOrDeleted :
-                    SpecialMemberOverloadResult::SuccessNonConst);
+                    SpecialMemberOverloadResult::Success);
     return Result;
   }
 
@@ -2288,6 +2288,9 @@
   Expr *Arg = 0;
   unsigned NumArgs;
 
+  QualType ArgType = CanTy;
+  ExprValueKind VK = VK_LValue;
+
   if (SM == CXXDefaultConstructor) {
     Name = Context.DeclarationNames.getCXXConstructorName(CanTy);
     NumArgs = 0;
@@ -2308,7 +2311,6 @@
         DeclareImplicitMoveAssignment(RD);
     }
 
-    QualType ArgType = CanTy;
     if (ConstArg)
       ArgType.addConst();
     if (VolatileArg)
@@ -2321,14 +2323,17 @@
     // Possibly an XValue is actually correct in the case of move, but
     // there is no semantic difference for class types in this restricted
     // case.
-    ExprValueKind VK;
     if (SM == CXXCopyConstructor || SM == CXXCopyAssignment)
       VK = VK_LValue;
     else
       VK = VK_RValue;
+  }
 
+  OpaqueValueExpr FakeArg(SourceLocation(), ArgType, VK);
+
+  if (SM != CXXDefaultConstructor) {
     NumArgs = 1;
-    Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType, VK);
+    Arg = &FakeArg;
   }
 
   // Create the object argument
@@ -2338,17 +2343,14 @@
   if (VolatileThis)
     ThisTy.addVolatile();
   Expr::Classification Classification =
-    (new (Context) OpaqueValueExpr(SourceLocation(), ThisTy,
-                                   RValueThis ? VK_RValue : VK_LValue))->
-        Classify(Context);
+    OpaqueValueExpr(SourceLocation(), ThisTy,
+                    RValueThis ? VK_RValue : VK_LValue).Classify(Context);
 
   // Now we perform lookup on the name we computed earlier and do overload
   // resolution. Lookup is only performed directly into the class since there
   // will always be a (possibly implicit) declaration to shadow any others.
   OverloadCandidateSet OCS((SourceLocation()));
   DeclContext::lookup_iterator I, E;
-  SpecialMemberOverloadResult::Kind SuccessKind =
-      SpecialMemberOverloadResult::SuccessNonConst;
 
   llvm::tie(I, E) = RD->lookup(Name);
   assert((I != E) &&
@@ -2378,17 +2380,6 @@
       else
         AddOverloadCandidate(M, DeclAccessPair::make(M, AS_public),
                              llvm::makeArrayRef(&Arg, NumArgs), OCS, true);
-
-      // Here we're looking for a const parameter to speed up creation of
-      // implicit copy methods.
-      if ((SM == CXXCopyAssignment && M->isCopyAssignmentOperator()) ||
-          (SM == CXXCopyConstructor &&
-            cast<CXXConstructorDecl>(M)->isCopyConstructor())) {
-        QualType ArgType = M->getType()->getAs<FunctionProtoType>()->getArgType(0);
-        if (!ArgType->isReferenceType() ||
-            ArgType->getPointeeType().isConstQualified())
-          SuccessKind = SpecialMemberOverloadResult::SuccessConst;
-      }
     } else if (FunctionTemplateDecl *Tmpl =
                  dyn_cast<FunctionTemplateDecl>(Cand)) {
       if (SM == CXXCopyAssignment || SM == CXXMoveAssignment)
@@ -2409,7 +2400,7 @@
   switch (OCS.BestViableFunction(*this, SourceLocation(), Best)) {
     case OR_Success:
       Result->setMethod(cast<CXXMethodDecl>(Best->Function));
-      Result->setKind(SuccessKind);
+      Result->setKind(SpecialMemberOverloadResult::Success);
       break;
 
     case OR_Deleted:
@@ -2442,17 +2433,13 @@
 
 /// \brief Look up the copying constructor for the given class.
 CXXConstructorDecl *Sema::LookupCopyingConstructor(CXXRecordDecl *Class,
-                                                   unsigned Quals,
-                                                   bool *ConstParamMatch) {
+                                                   unsigned Quals) {
   assert(!(Quals & ~(Qualifiers::Const | Qualifiers::Volatile)) &&
          "non-const, non-volatile qualifiers for copy ctor arg");
   SpecialMemberOverloadResult *Result =
     LookupSpecialMember(Class, CXXCopyConstructor, Quals & Qualifiers::Const,
                         Quals & Qualifiers::Volatile, false, false, false);
 
-  if (ConstParamMatch)
-    *ConstParamMatch = Result->hasConstParamMatch();
-
   return cast_or_null<CXXConstructorDecl>(Result->getMethod());
 }
 
@@ -2485,8 +2472,7 @@
 /// \brief Look up the copying assignment operator for the given class.
 CXXMethodDecl *Sema::LookupCopyingAssignment(CXXRecordDecl *Class,
                                              unsigned Quals, bool RValueThis,
-                                             unsigned ThisQuals,
-                                             bool *ConstParamMatch) {
+                                             unsigned ThisQuals) {
   assert(!(Quals & ~(Qualifiers::Const | Qualifiers::Volatile)) &&
          "non-const, non-volatile qualifiers for copy assignment arg");
   assert(!(ThisQuals & ~(Qualifiers::Const | Qualifiers::Volatile)) &&
@@ -2497,9 +2483,6 @@
                         ThisQuals & Qualifiers::Const,
                         ThisQuals & Qualifiers::Volatile);
 
-  if (ConstParamMatch)
-    *ConstParamMatch = Result->hasConstParamMatch();
-
   return Result->getMethod();
 }
 

Modified: cfe/branches/tooling/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaOverload.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaOverload.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaOverload.cpp Wed Apr 25 07:05:17 2012
@@ -6426,7 +6426,7 @@
     enum PromotedType {
                   Flt,  Dbl, LDbl,   SI,   SL,  SLL,   UI,   UL,  ULL, Dep=-1
     };
-    static PromotedType ConversionsTable[LastPromotedArithmeticType]
+    static const PromotedType ConversionsTable[LastPromotedArithmeticType]
                                         [LastPromotedArithmeticType] = {
       /* Flt*/ {  Flt,  Dbl, LDbl,  Flt,  Flt,  Flt,  Flt,  Flt,  Flt },
       /* Dbl*/ {  Dbl,  Dbl, LDbl,  Dbl,  Dbl,  Dbl,  Dbl,  Dbl,  Dbl },

Modified: cfe/branches/tooling/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplate.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplate.cpp Wed Apr 25 07:05:17 2012
@@ -865,9 +865,13 @@
     return true;
   }
 
-  // Find any previous declaration with this name.
+  // Find any previous declaration with this name. For a friend with no
+  // scope explicitly specified, we only look for tag declarations (per
+  // C++11 [basic.lookup.elab]p2).
   DeclContext *SemanticContext;
-  LookupResult Previous(*this, Name, NameLoc, LookupOrdinaryName,
+  LookupResult Previous(*this, Name, NameLoc,
+                        (SS.isEmpty() && TUK == TUK_Friend)
+                          ? LookupTagName : LookupOrdinaryName,
                         ForRedeclaration);
   if (SS.isNotEmpty() && !SS.isInvalid()) {
     SemanticContext = computeDeclContext(SS, true);
@@ -893,7 +897,7 @@
         Invalid = true;
     } else if (TUK != TUK_Friend && TUK != TUK_Reference)
       diagnoseQualifiedDeclaration(SS, SemanticContext, Name, NameLoc);
-        
+
     LookupQualifiedName(Previous, SemanticContext);
   } else {
     SemanticContext = CurContext;
@@ -948,22 +952,32 @@
         // declaration.
         PrevDecl = PrevClassTemplate = 0;
         SemanticContext = OutermostContext;
-      }
-    }
 
-    if (CurContext->isDependentContext()) {
-      // If this is a dependent context, we don't want to link the friend
-      // class template to the template in scope, because that would perform
-      // checking of the template parameter lists that can't be performed
-      // until the outer context is instantiated.
-      PrevDecl = PrevClassTemplate = 0;
+        // Check that the chosen semantic context doesn't already contain a
+        // declaration of this name as a non-tag type.
+        LookupResult Previous(*this, Name, NameLoc, LookupOrdinaryName,
+                              ForRedeclaration);
+        DeclContext *LookupContext = SemanticContext;
+        while (LookupContext->isTransparentContext())
+          LookupContext = LookupContext->getLookupParent();
+        LookupQualifiedName(Previous, LookupContext);
+
+        if (Previous.isAmbiguous())
+          return true;
+
+        if (Previous.begin() != Previous.end())
+          PrevDecl = (*Previous.begin())->getUnderlyingDecl();
+      }
     }
   } else if (PrevDecl && !isDeclInScope(PrevDecl, SemanticContext, S))
     PrevDecl = PrevClassTemplate = 0;
 
   if (PrevClassTemplate) {
-    // Ensure that the template parameter lists are compatible.
-    if (!TemplateParameterListsAreEqual(TemplateParams,
+    // Ensure that the template parameter lists are compatible. Skip this check
+    // for a friend in a dependent context: the template parameter list itself
+    // could be dependent.
+    if (!(TUK == TUK_Friend && CurContext->isDependentContext()) &&
+        !TemplateParameterListsAreEqual(TemplateParams,
                                    PrevClassTemplate->getTemplateParameters(),
                                         /*Complain=*/true,
                                         TPL_TemplateMatch))
@@ -1012,8 +1026,10 @@
 
   // Check the template parameter list of this declaration, possibly
   // merging in the template parameter list from the previous class
-  // template declaration.
-  if (CheckTemplateParameterList(TemplateParams,
+  // template declaration. Skip this check for a friend in a dependent
+  // context, because the template parameter list might be dependent.
+  if (!(TUK == TUK_Friend && CurContext->isDependentContext()) &&
+      CheckTemplateParameterList(TemplateParams,
             PrevClassTemplate? PrevClassTemplate->getTemplateParameters() : 0,
                                  (SS.isSet() && SemanticContext &&
                                   SemanticContext->isRecord() &&
@@ -1025,9 +1041,9 @@
   if (SS.isSet()) {
     // If the name of the template was qualified, we must be defining the
     // template out-of-line.
-    if (!SS.isInvalid() && !Invalid && !PrevClassTemplate &&
-        !(TUK == TUK_Friend && CurContext->isDependentContext())) {
-      Diag(NameLoc, diag::err_member_def_does_not_match)
+    if (!SS.isInvalid() && !Invalid && !PrevClassTemplate) {
+      Diag(NameLoc, TUK == TUK_Friend ? diag::err_friend_decl_does_not_match
+                                      : diag::err_member_def_does_not_match)
         << Name << SemanticContext << SS.getRange();
       Invalid = true;
     }

Modified: cfe/branches/tooling/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaType.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaType.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaType.cpp Wed Apr 25 07:05:17 2012
@@ -4195,7 +4195,8 @@
   // class template specialization, or an array with known size of such,
   // try to instantiate it.
   QualType MaybeTemplate = T;
-  if (const ConstantArrayType *Array = Context.getAsConstantArrayType(T))
+  while (const ConstantArrayType *Array
+           = Context.getAsConstantArrayType(MaybeTemplate))
     MaybeTemplate = Array->getElementType();
   if (const RecordType *Record = MaybeTemplate->getAs<RecordType>()) {
     if (ClassTemplateSpecializationDecl *ClassTemplateSpec

Modified: cfe/branches/tooling/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Serialization/ASTReader.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Serialization/ASTReader.cpp (original)
+++ cfe/branches/tooling/lib/Serialization/ASTReader.cpp Wed Apr 25 07:05:17 2012
@@ -3866,6 +3866,9 @@
       EPI.Exceptions = Exceptions.data();
     } else if (EST == EST_ComputedNoexcept) {
       EPI.NoexceptExpr = ReadExpr(*Loc.F);
+    } else if (EST == EST_Uninstantiated) {
+      EPI.ExceptionSpecDecl = ReadDeclAs<FunctionDecl>(*Loc.F, Record, Idx);
+      EPI.ExceptionSpecTemplate = ReadDeclAs<FunctionDecl>(*Loc.F, Record, Idx);
     }
     return Context.getFunctionType(ResultType, ParamTypes.data(), NumParams,
                                     EPI);

Modified: cfe/branches/tooling/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Serialization/ASTWriter.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/branches/tooling/lib/Serialization/ASTWriter.cpp Wed Apr 25 07:05:17 2012
@@ -195,6 +195,9 @@
       Writer.AddTypeRef(T->getExceptionType(I), Record);
   } else if (T->getExceptionSpecType() == EST_ComputedNoexcept) {
     Writer.AddStmt(T->getNoexceptExpr());
+  } else if (T->getExceptionSpecType() == EST_Uninstantiated) {
+    Writer.AddDeclRef(T->getExceptionSpecDecl(), Record);
+    Writer.AddDeclRef(T->getExceptionSpecTemplate(), Record);
   }
   Code = TYPE_FUNCTION_PROTO;
 }

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/BugReporter.cpp Wed Apr 25 07:05:17 2012
@@ -427,7 +427,7 @@
 
     ProgramPoint P = N->getLocation();
     
-    if (const CallExit *CE = dyn_cast<CallExit>(&P)) {
+    if (const CallExitEnd *CE = dyn_cast<CallExitEnd>(&P)) {
       PathDiagnosticCallPiece *C =
         PathDiagnosticCallPiece::construct(N, *CE, SMgr);
       PD.getActivePath().push_front(C);
@@ -440,7 +440,7 @@
       PD.popActivePath();
       // The current active path should never be empty.  Either we
       // just added a bunch of stuff to the top-level path, or
-      // we have a previous CallExit.  If the front of the active
+      // we have a previous CallExitEnd.  If the front of the active
       // path is not a PathDiagnosticCallPiece, it means that the
       // path terminated within a function call.  We must then take the
       // current contents of the active path and place it within
@@ -1066,10 +1066,10 @@
     ProgramPoint P = N->getLocation();
 
     do {
-      if (const CallExit *CE = dyn_cast<CallExit>(&P)) {
+      if (const CallExitEnd *CE = dyn_cast<CallExitEnd>(&P)) {
         const StackFrameContext *LCtx =
         CE->getLocationContext()->getCurrentStackFrame();
-        PathDiagnosticLocation Loc(LCtx->getCallSite(),
+        PathDiagnosticLocation Loc(CE->getStmt(),
                                    PDB.getSourceManager(),
                                    LCtx);
         EB.addEdge(Loc, true);
@@ -1099,7 +1099,7 @@
 
         // The current active path should never be empty.  Either we
         // just added a bunch of stuff to the top-level path, or
-        // we have a previous CallExit.  If the front of the active
+        // we have a previous CallExitEnd.  If the front of the active
         // path is not a PathDiagnosticCallPiece, it means that the
         // path terminated within a function call.  We must then take the
         // current contents of the active path and place it within

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerManager.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerManager.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/CheckerManager.cpp Wed Apr 25 07:05:17 2012
@@ -381,21 +381,25 @@
     SymbolReaper &SR;
     const Stmt *S;
     ExprEngine &Eng;
+    ProgramPoint::Kind ProgarmPointKind;
 
     CheckersTy::const_iterator checkers_begin() { return Checkers.begin(); }
     CheckersTy::const_iterator checkers_end() { return Checkers.end(); }
 
     CheckDeadSymbolsContext(const CheckersTy &checkers, SymbolReaper &sr,
-                            const Stmt *s, ExprEngine &eng)
-      : Checkers(checkers), SR(sr), S(s), Eng(eng) { }
+                            const Stmt *s, ExprEngine &eng,
+                            ProgramPoint::Kind K)
+      : Checkers(checkers), SR(sr), S(s), Eng(eng), ProgarmPointKind(K) { }
 
     void runChecker(CheckerManager::CheckDeadSymbolsFunc checkFn,
                     NodeBuilder &Bldr, ExplodedNode *Pred) {
-      ProgramPoint::Kind K = ProgramPoint::PostPurgeDeadSymbolsKind;
-      const ProgramPoint &L = ProgramPoint::getProgramPoint(S, K,
+      const ProgramPoint &L = ProgramPoint::getProgramPoint(S, ProgarmPointKind,
                                 Pred->getLocationContext(), checkFn.Checker);
       CheckerContext C(Bldr, Eng, Pred, L);
 
+      // Note, do not pass the statement to the checkers without letting them
+      // differentiate if we ran remove dead bindings before or after the
+      // statement.
       checkFn(SR, C);
     }
   };
@@ -406,8 +410,9 @@
                                                const ExplodedNodeSet &Src,
                                                SymbolReaper &SymReaper,
                                                const Stmt *S,
-                                               ExprEngine &Eng) {
-  CheckDeadSymbolsContext C(DeadSymbolsCheckers, SymReaper, S, Eng);
+                                               ExprEngine &Eng,
+                                               ProgramPoint::Kind K) {
+  CheckDeadSymbolsContext C(DeadSymbolsCheckers, SymReaper, S, Eng, K);
   expandGraphWithCheckers(C, Dst, Src);
 }
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/CoreEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/CoreEngine.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/CoreEngine.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/CoreEngine.cpp Wed Apr 25 07:05:17 2012
@@ -248,7 +248,7 @@
       break;
     }
 
-    case ProgramPoint::CallExitKind:
+    case ProgramPoint::CallExitBeginKind:
       SubEng.processCallExit(Pred);
       break;
 
@@ -531,14 +531,14 @@
     WList->enqueue(Succ, Block, Idx+1);
 }
 
-ExplodedNode *CoreEngine::generateCallExitNode(ExplodedNode *N) {
-  // Create a CallExit node and enqueue it.
+ExplodedNode *CoreEngine::generateCallExitBeginNode(ExplodedNode *N) {
+  // Create a CallExitBegin node and enqueue it.
   const StackFrameContext *LocCtx
                          = cast<StackFrameContext>(N->getLocationContext());
   const Stmt *CE = LocCtx->getCallSite();
 
   // Use the the callee location context.
-  CallExit Loc(CE, LocCtx);
+  CallExitBegin Loc(CE, LocCtx);
 
   bool isNew;
   ExplodedNode *Node = G->getNode(Loc, N->getState(), false, &isNew);
@@ -565,12 +565,13 @@
 void CoreEngine::enqueueEndOfFunction(ExplodedNodeSet &Set) {
   for (ExplodedNodeSet::iterator I = Set.begin(), E = Set.end(); I != E; ++I) {
     ExplodedNode *N = *I;
-    // If we are in an inlined call, generate CallExit node.
+    // If we are in an inlined call, generate CallExitBegin node.
     if (N->getLocationContext()->getParent()) {
-      N = generateCallExitNode(N);
+      N = generateCallExitBeginNode(N);
       if (N)
         WList->enqueue(N);
     } else {
+      // TODO: We should run remove dead bindings here.
       G->addEndOfPath(N);
       NumPathsExplored++;
     }

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ExplodedGraph.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ExplodedGraph.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ExplodedGraph.cpp Wed Apr 25 07:05:17 2012
@@ -57,7 +57,7 @@
 //===----------------------------------------------------------------------===//
 
 bool ExplodedGraph::shouldCollect(const ExplodedNode *node) {
-  // Reclaimn all nodes that match *all* the following criteria:
+  // Reclaim all nodes that match *all* the following criteria:
   //
   // (1) 1 predecessor (that has one successor)
   // (2) 1 successor (that has one predecessor)
@@ -83,7 +83,8 @@
   // Condition 3.
   ProgramPoint progPoint = node->getLocation();
   if (!isa<PostStmt>(progPoint) ||
-      (isa<CallEnter>(progPoint) || isa<CallExit>(progPoint)))
+      (isa<CallEnter>(progPoint) ||
+       isa<CallExitBegin>(progPoint) || isa<CallExitEnd>(progPoint)))
     return false;
 
   // Condition 4.

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp Wed Apr 25 07:05:17 2012
@@ -42,8 +42,6 @@
 
 STATISTIC(NumRemoveDeadBindings,
             "The # of times RemoveDeadBindings is called");
-STATISTIC(NumRemoveDeadBindingsSkipped,
-            "The # of times RemoveDeadBindings is skipped");
 STATISTIC(NumMaxBlockCountReached,
             "The # of aborted paths due to reaching the maximum block count in "
             "a top level function");
@@ -231,6 +229,7 @@
       ProcessImplicitDtor(*E.getAs<CFGImplicitDtor>(), Pred);
       return;
   }
+  currentBuilderContext = 0;
 }
 
 static bool shouldRemoveDeadBindings(AnalysisManager &AMgr,
@@ -260,62 +259,47 @@
   return !PM.isConsumedExpr(cast<Expr>(S.getStmt()));
 }
 
-void ExprEngine::ProcessStmt(const CFGStmt S,
-                             ExplodedNode *Pred) {
-  // Reclaim any unnecessary nodes in the ExplodedGraph.
-  G.reclaimRecentlyAllocatedNodes();
-  
-  currentStmt = S.getStmt();
-  PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
-                                currentStmt->getLocStart(),
-                                "Error evaluating statement");
-
-  EntryNode = Pred;
-
-  ProgramStateRef EntryState = EntryNode->getState();
-  CleanedState = EntryState;
-
-  // Create the cleaned state.
-  const LocationContext *LC = EntryNode->getLocationContext();
-  SymbolReaper SymReaper(LC, currentStmt, SymMgr, getStoreManager());
-
-  if (shouldRemoveDeadBindings(AMgr, S, Pred, LC)) {
-    NumRemoveDeadBindings++;
-    getCheckerManager().runCheckersForLiveSymbols(CleanedState, SymReaper);
-
-    const StackFrameContext *SFC = LC->getCurrentStackFrame();
-
-    // Create a state in which dead bindings are removed from the environment
-    // and the store. TODO: The function should just return new env and store,
-    // not a new state.
-    CleanedState = StateMgr.removeDeadBindings(CleanedState, SFC, SymReaper);
-  } else {
-    NumRemoveDeadBindingsSkipped++;
-  }
+void ExprEngine::removeDead(ExplodedNode *Pred, ExplodedNodeSet &Out,
+                            const Stmt *ReferenceStmt,
+                            const LocationContext *LC,
+                            const Stmt *DiagnosticStmt,
+                            ProgramPoint::Kind K) {
+  assert((K == ProgramPoint::PreStmtPurgeDeadSymbolsKind ||
+          ReferenceStmt == 0) && "PreStmt is not generally supported by "
+                                 "the SymbolReaper yet");
+  NumRemoveDeadBindings++;
+  CleanedState = Pred->getState();
+  SymbolReaper SymReaper(LC, ReferenceStmt, SymMgr, getStoreManager());
+
+  getCheckerManager().runCheckersForLiveSymbols(CleanedState, SymReaper);
+
+  // Create a state in which dead bindings are removed from the environment
+  // and the store. TODO: The function should just return new env and store,
+  // not a new state.
+  const StackFrameContext *SFC = LC->getCurrentStackFrame();
+  CleanedState = StateMgr.removeDeadBindings(CleanedState, SFC, SymReaper);
 
   // Process any special transfer function for dead symbols.
-  ExplodedNodeSet Tmp;
   // A tag to track convenience transitions, which can be removed at cleanup.
   static SimpleProgramPointTag cleanupTag("ExprEngine : Clean Node");
-
   if (!SymReaper.hasDeadSymbols()) {
     // Generate a CleanedNode that has the environment and store cleaned
     // up. Since no symbols are dead, we can optimize and not clean out
     // the constraint manager.
-    StmtNodeBuilder Bldr(Pred, Tmp, *currentBuilderContext);
-    Bldr.generateNode(currentStmt, EntryNode, CleanedState, false, &cleanupTag);
+    StmtNodeBuilder Bldr(Pred, Out, *currentBuilderContext);
+    Bldr.generateNode(DiagnosticStmt, Pred, CleanedState, false, &cleanupTag,K);
 
   } else {
     // Call checkers with the non-cleaned state so that they could query the
     // values of the soon to be dead symbols.
     ExplodedNodeSet CheckedSet;
-    getCheckerManager().runCheckersForDeadSymbols(CheckedSet, EntryNode,
-                                                 SymReaper, currentStmt, *this);
+    getCheckerManager().runCheckersForDeadSymbols(CheckedSet, Pred, SymReaper,
+                                                  DiagnosticStmt, *this, K);
 
     // For each node in CheckedSet, generate CleanedNodes that have the
     // environment, the store, and the constraints cleaned up but have the
     // user-supplied states as the predecessors.
-    StmtNodeBuilder Bldr(CheckedSet, Tmp, *currentBuilderContext);
+    StmtNodeBuilder Bldr(CheckedSet, Out, *currentBuilderContext);
     for (ExplodedNodeSet::const_iterator
           I = CheckedSet.begin(), E = CheckedSet.end(); I != E; ++I) {
       ProgramStateRef CheckerState = (*I)->getState();
@@ -324,10 +308,10 @@
       CheckerState = getConstraintManager().removeDeadBindings(CheckerState,
                                                                SymReaper);
 
-      assert(StateMgr.haveEqualEnvironments(CheckerState, EntryState) &&
+      assert(StateMgr.haveEqualEnvironments(CheckerState, Pred->getState()) &&
         "Checkers are not allowed to modify the Environment as a part of "
         "checkDeadSymbols processing.");
-      assert(StateMgr.haveEqualStores(CheckerState, EntryState) &&
+      assert(StateMgr.haveEqualStores(CheckerState, Pred->getState()) &&
         "Checkers are not allowed to modify the Store as a part of "
         "checkDeadSymbols processing.");
 
@@ -335,13 +319,35 @@
       // generate a transition to that state.
       ProgramStateRef CleanedCheckerSt =
         StateMgr.getPersistentStateWithGDM(CleanedState, CheckerState);
-      Bldr.generateNode(currentStmt, *I, CleanedCheckerSt, false, &cleanupTag,
-                        ProgramPoint::PostPurgeDeadSymbolsKind);
+      Bldr.generateNode(DiagnosticStmt, *I, CleanedCheckerSt, false,
+                        &cleanupTag, K);
     }
   }
+}
 
+void ExprEngine::ProcessStmt(const CFGStmt S,
+                             ExplodedNode *Pred) {
+  // Reclaim any unnecessary nodes in the ExplodedGraph.
+  G.reclaimRecentlyAllocatedNodes();
+
+  currentStmt = S.getStmt();
+  PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
+                                currentStmt->getLocStart(),
+                                "Error evaluating statement");
+
+  // Remove dead bindings and symbols.
+  EntryNode = Pred;
+  ExplodedNodeSet CleanedStates;
+  if (shouldRemoveDeadBindings(AMgr, S, Pred, EntryNode->getLocationContext())){
+    removeDead(EntryNode, CleanedStates, currentStmt,
+               Pred->getLocationContext(), currentStmt);
+  } else
+    CleanedStates.Add(EntryNode);
+
+  // Visit the statement.
   ExplodedNodeSet Dst;
-  for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
+  for (ExplodedNodeSet::iterator I = CleanedStates.begin(),
+                                 E = CleanedStates.end(); I != E; ++I) {
     ExplodedNodeSet DstI;
     // Visit the statement.
     Visit(currentStmt, *I, DstI);
@@ -994,7 +1000,7 @@
       continue;
     // We reached the caller. Find the node right before we started
     // processing the CallExpr.
-    if (isa<PostPurgeDeadSymbols>(L))
+    if (L.isPurgeKind())
       continue;
     if (const StmtPoint *SP = dyn_cast<StmtPoint>(&L))
       if (SP->getStmt() == CalleeSF->getCallSite())
@@ -1861,10 +1867,17 @@
     ProgramPoint Loc = N->getLocation();
 
     switch (Loc.getKind()) {
-      case ProgramPoint::BlockEntranceKind:
+      case ProgramPoint::BlockEntranceKind: {
         Out << "Block Entrance: B"
             << cast<BlockEntrance>(Loc).getBlock()->getBlockID();
+        if (const NamedDecl *ND =
+                    dyn_cast<NamedDecl>(Loc.getLocationContext()->getDecl())) {
+          Out << " (";
+          ND->printName(Out);
+          Out << ")";
+        }
         break;
+      }
 
       case ProgramPoint::BlockExitKind:
         assert (false);
@@ -1874,8 +1887,20 @@
         Out << "CallEnter";
         break;
 
-      case ProgramPoint::CallExitKind:
-        Out << "CallExit";
+      case ProgramPoint::CallExitBeginKind:
+        Out << "CallExitBegin";
+        break;
+
+      case ProgramPoint::CallExitEndKind:
+        Out << "CallExitEnd";
+        break;
+
+      case ProgramPoint::PostStmtPurgeDeadSymbolsKind:
+        Out << "PostStmtPurgeDeadSymbols";
+        break;
+
+      case ProgramPoint::PreStmtPurgeDeadSymbolsKind:
+        Out << "PreStmtPurgeDeadSymbols";
         break;
 
       case ProgramPoint::EpsilonKind:

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp Wed Apr 25 07:05:17 2012
@@ -51,71 +51,140 @@
     Engine.getWorkList()->enqueue(Node);
 }
 
-static const ReturnStmt *getReturnStmt(const ExplodedNode *Node) {
+// Find the last statement on the path to the exploded node and the
+// corresponding Block.
+static std::pair<const Stmt*,
+                 const CFGBlock*> getLastStmt(const ExplodedNode *Node) {
+  const Stmt *S = 0;
+  const CFGBlock *Blk = 0;
+  const StackFrameContext *SF =
+          Node->getLocation().getLocationContext()->getCurrentStackFrame();
   while (Node) {
     const ProgramPoint &PP = Node->getLocation();
-    // Skip any BlockEdges.
-    if (isa<BlockEdge>(PP) || isa<CallExit>(PP)) {
+    // Skip any BlockEdges, empty blocks, and the CallExitBegin node.
+    if (isa<BlockEdge>(PP) || isa<CallExitBegin>(PP) || isa<BlockEntrance>(PP)){
       assert(Node->pred_size() == 1);
       Node = *Node->pred_begin();
       continue;
-    } 
+    }
+    // If we reached the CallEnter, the function has no statements.
+    if (isa<CallEnter>(PP))
+      break;
     if (const StmtPoint *SP = dyn_cast<StmtPoint>(&PP)) {
-      const Stmt *S = SP->getStmt();
-      return dyn_cast<ReturnStmt>(S);
+      S = SP->getStmt();
+      // Now, get the enclosing basic block.
+      while (Node && Node->pred_size() >=1 ) {
+        const ProgramPoint &PP = Node->getLocation();
+        if (isa<BlockEdge>(PP) &&
+            (PP.getLocationContext()->getCurrentStackFrame() == SF)) {
+          BlockEdge &EPP = cast<BlockEdge>(PP);
+          Blk = EPP.getDst();
+          break;
+        }
+        Node = *Node->pred_begin();
+      }
+      break;
     }
     break;
   }
-  return 0;
+  return std::pair<const Stmt*, const CFGBlock*>(S, Blk);
 }
 
-void ExprEngine::processCallExit(ExplodedNode *Pred) {
-  ProgramStateRef state = Pred->getState();
-  const StackFrameContext *calleeCtx = 
-    Pred->getLocationContext()->getCurrentStackFrame();
+/// The call exit is simulated with a sequence of nodes, which occur between 
+/// CallExitBegin and CallExitEnd. The following operations occur between the 
+/// two program points:
+/// 1. CallExitBegin (triggers the start of call exit sequence)
+/// 2. Bind the return value
+/// 3. Run Remove dead bindings to clean up the dead symbols from the callee.
+/// 4. CallExitEnd (switch to the caller context)
+/// 5. PostStmt<CallExpr>
+void ExprEngine::processCallExit(ExplodedNode *CEBNode) {
+  // Step 1 CEBNode was generated before the call.
+
+  const StackFrameContext *calleeCtx =
+      CEBNode->getLocationContext()->getCurrentStackFrame();
   const LocationContext *callerCtx = calleeCtx->getParent();
   const Stmt *CE = calleeCtx->getCallSite();
-  
+  ProgramStateRef state = CEBNode->getState();
+  // Find the last statement in the function and the corresponding basic block.
+  const Stmt *LastSt = 0;
+  const CFGBlock *Blk = 0;
+  llvm::tie(LastSt, Blk) = getLastStmt(CEBNode);
+
+  // Step 2: generate node with binded return value: CEBNode -> BindedRetNode.
+
   // If the callee returns an expression, bind its value to CallExpr.
-  if (const ReturnStmt *RS = getReturnStmt(Pred)) {
-    const LocationContext *LCtx = Pred->getLocationContext();
+  if (const ReturnStmt *RS = dyn_cast_or_null<ReturnStmt>(LastSt)) {
+    const LocationContext *LCtx = CEBNode->getLocationContext();
     SVal V = state->getSVal(RS, LCtx);
     state = state->BindExpr(CE, callerCtx, V);
   }
-  
+
   // Bind the constructed object value to CXXConstructExpr.
   if (const CXXConstructExpr *CCE = dyn_cast<CXXConstructExpr>(CE)) {
     const CXXThisRegion *ThisR =
-    getCXXThisRegion(CCE->getConstructor()->getParent(), calleeCtx);
-    
+        getCXXThisRegion(CCE->getConstructor()->getParent(), calleeCtx);
+
     SVal ThisV = state->getSVal(ThisR);
     // Always bind the region to the CXXConstructExpr.
-    state = state->BindExpr(CCE, Pred->getLocationContext(), ThisV);
+    state = state->BindExpr(CCE, CEBNode->getLocationContext(), ThisV);
   }
-  
-  static SimpleProgramPointTag returnTag("ExprEngine : Call Return");
-  PostStmt Loc(CE, callerCtx, &returnTag);
+
+  static SimpleProgramPointTag retValBindTag("ExprEngine : Bind Return Value");
+  PostStmt Loc(LastSt, calleeCtx, &retValBindTag);
   bool isNew;
-  ExplodedNode *N = G.getNode(Loc, state, false, &isNew);
-  N->addPredecessor(Pred, G);
+  ExplodedNode *BindedRetNode = G.getNode(Loc, state, false, &isNew);
+  BindedRetNode->addPredecessor(CEBNode, G);
   if (!isNew)
     return;
-  
-  // Perform the post-condition check of the CallExpr.
-  ExplodedNodeSet Dst;
-  NodeBuilderContext Ctx(Engine, calleeCtx->getCallSiteBlock(), N);
-  SaveAndRestore<const NodeBuilderContext*> NBCSave(currentBuilderContext,
-                                                    &Ctx);
-  SaveAndRestore<unsigned> CBISave(currentStmtIdx, calleeCtx->getIndex());
-  
-  getCheckerManager().runCheckersForPostStmt(Dst, N, CE, *this,
-                                             /* wasInlined */ true);
-  
-  // Enqueue the next element in the block.
-  for (ExplodedNodeSet::iterator I = Dst.begin(), E = Dst.end(); I != E; ++I) {
-    Engine.getWorkList()->enqueue(*I,
-                                  calleeCtx->getCallSiteBlock(),
-                                  calleeCtx->getIndex()+1);
+
+  // Step 3: BindedRetNode -> CleanedNodes
+  // If we can find a statement and a block in the inlined function, run remove
+  // dead bindings before returning from the call. This is important to ensure
+  // that we report the issues such as leaks in the stack contexts in which
+  // they occurred.
+  ExplodedNodeSet CleanedNodes;
+  if (LastSt && Blk) {
+    NodeBuilderContext Ctx(getCoreEngine(), Blk, BindedRetNode);
+    currentBuilderContext = &Ctx;
+    // Here, we call the Symbol Reaper with 0 statement and caller location
+    // context, telling it to clean up everything in the callee's context
+    // (and it's children). We use LastStmt as a diagnostic statement, which
+    // which the PreStmtPurge Dead point will be associated.
+    removeDead(BindedRetNode, CleanedNodes, 0, callerCtx, LastSt,
+               ProgramPoint::PostStmtPurgeDeadSymbolsKind);
+    currentBuilderContext = 0;
+  }
+
+  for (ExplodedNodeSet::iterator I = CleanedNodes.begin(),
+                                 E = CleanedNodes.end(); I != E; ++I) {
+
+    // Step 4: Generate the CallExit and leave the callee's context.
+    // CleanedNodes -> CEENode
+    CallExitEnd Loc(CE, callerCtx);
+    bool isNew;
+    ExplodedNode *CEENode = G.getNode(Loc, (*I)->getState(), false, &isNew);
+    CEENode->addPredecessor(*I, G);
+    if (!isNew)
+      return;
+
+    // Step 5: Perform the post-condition check of the CallExpr and enqueue the
+    // result onto the work list.
+    // CEENode -> Dst -> WorkList
+    ExplodedNodeSet Dst;
+    NodeBuilderContext Ctx(Engine, calleeCtx->getCallSiteBlock(), CEENode);
+    SaveAndRestore<const NodeBuilderContext*> NBCSave(currentBuilderContext,
+        &Ctx);
+    SaveAndRestore<unsigned> CBISave(currentStmtIdx, calleeCtx->getIndex());
+
+    getCheckerManager().runCheckersForPostStmt(Dst, CEENode, CE, *this, true);
+
+    // Enqueue the next element in the block.
+    for (ExplodedNodeSet::iterator PSI = Dst.begin(), PSE = Dst.end();
+                                   PSI != PSE; ++PSI) {
+      Engine.getWorkList()->enqueue(*PSI, calleeCtx->getCallSiteBlock(),
+                                    calleeCtx->getIndex()+1);
+    }
   }
 }
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Wed Apr 25 07:05:17 2012
@@ -510,9 +510,9 @@
 
 PathDiagnosticCallPiece *
 PathDiagnosticCallPiece::construct(const ExplodedNode *N,
-                                   const CallExit &CE,
+                                   const CallExitEnd &CE,
                                    const SourceManager &SM) {
-  const Decl *caller = CE.getLocationContext()->getParent()->getDecl();
+  const Decl *caller = CE.getLocationContext()->getDecl();
   PathDiagnosticLocation pos = getLastStmtLoc(N, SM);
   return new PathDiagnosticCallPiece(caller, pos);
 }
@@ -667,16 +667,13 @@
 
 std::string StackHintGeneratorForSymbol::getMessage(const ExplodedNode *N){
   ProgramPoint P = N->getLocation();
-  const CallExit *CExit = dyn_cast<CallExit>(&P);
-  assert(CExit && "Stack Hints should be constructed at CallExit points.");
+  const CallExitEnd *CExit = dyn_cast<CallExitEnd>(&P);
+  assert(CExit && "Stack Hints should be constructed at CallExitEnd points.");
 
   const CallExpr *CE = dyn_cast_or_null<CallExpr>(CExit->getStmt());
   if (!CE)
     return "";
 
-  // Get the successor node to make sure the return statement is evaluated and
-  // CE is set to the result value.
-  N = *N->succ_begin();
   if (!N)
     return getMessageForSymbolNotFound();
 

Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/SymbolManager.cpp Wed Apr 25 07:05:17 2012
@@ -501,6 +501,9 @@
       return false;
     return true;
   }
+  // If no statement is provided, everything is this and parent contexts is live.
+  if (!Loc)
+    return true;
 
   return LCtx->getAnalysis<RelaxedLiveVariables>()->isLive(Loc, ExprVal);
 }
@@ -510,6 +513,10 @@
   const StackFrameContext *CurrentContext = LCtx->getCurrentStackFrame();
 
   if (VarContext == CurrentContext) {
+    // If no statemetnt is provided, everything is live.
+    if (!Loc)
+      return true;
+
     if (LCtx->getAnalysis<RelaxedLiveVariables>()->isLive(Loc, VR->getDecl()))
       return true;
 

Modified: cfe/branches/tooling/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Tooling/Tooling.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Tooling/Tooling.cpp (original)
+++ cfe/branches/tooling/lib/Tooling/Tooling.cpp Wed Apr 25 07:05:17 2012
@@ -29,6 +29,9 @@
 namespace clang {
 namespace tooling {
 
+// Exists solely for the purpose of lookup of the resource path.
+static int StaticSymbol;
+
 FrontendActionFactory::~FrontendActionFactory() {}
 
 // FIXME: This file contains structural duplication with other parts of the
@@ -39,9 +42,20 @@
 static clang::driver::Driver *newDriver(clang::DiagnosticsEngine *Diagnostics,
                                         const char *BinaryName) {
   const std::string DefaultOutputName = "a.out";
+  // This just needs to be some symbol in the binary.
+  void *const SymbolAddr = &StaticSymbol;
+  // The driver detects the builtin header path based on the path of
+  // the executable.
+  // FIXME: On linux, GetMainExecutable is independent of the content
+  // of BinaryName, thus allowing ClangTool and runToolOnCode to just
+  // pass in made-up names here (in the case of ClangTool this being
+  // the original compiler invocation). Make sure this works on other
+  // platforms.
+  llvm::sys::Path MainExecutable =
+    llvm::sys::Path::GetMainExecutable(BinaryName, SymbolAddr);
   clang::driver::Driver *CompilerDriver = new clang::driver::Driver(
-      BinaryName, llvm::sys::getDefaultTargetTriple(),
-      DefaultOutputName, false, *Diagnostics);
+    MainExecutable.str(), llvm::sys::getDefaultTargetTriple(),
+    DefaultOutputName, false, *Diagnostics);
   CompilerDriver->setTitle("clang_based_tool");
   return CompilerDriver;
 }
@@ -171,9 +185,6 @@
                        Invocation.take(), *CC1Args, ToolAction.take());
 }
 
-// Exists solely for the purpose of lookup of the resource path.
-static int StaticSymbol;
-
 bool ToolInvocation::runInvocation(
     const char *BinaryName,
     clang::driver::Compilation *Compilation,

Modified: cfe/branches/tooling/test/Analysis/malloc-plist.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/malloc-plist.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/malloc-plist.c (original)
+++ cfe/branches/tooling/test/Analysis/malloc-plist.c Wed Apr 25 07:05:17 2012
@@ -97,2718 +97,4503 @@
     in++;
 }
 
-// CHECK: <?xml version="1.0" encoding="UTF-8"?>
-// CHECK: <plist version="1.0">
-// CHECK: <dict>
-// CHECK:  <key>files</key>
-// CHECK:  <array>
-// CHECK:  </array>
-// CHECK:  <key>diagnostics</key>
-// CHECK:  <array>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>10</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>27</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>11</integer>
-// CHECK:       <key>col</key><integer>18</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>11</integer>
-// CHECK:          <key>col</key><integer>18</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>11</integer>
-// CHECK:          <key>col</key><integer>27</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>11</integer>
-// CHECK:            <key>col</key><integer>27</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>14</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>14</integer>
-// CHECK:            <key>col</key><integer>6</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>14</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>14</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>14</integer>
-// CHECK:          <key>col</key><integer>6</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'p'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'p'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'p'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>diagnosticTest</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>14</integer>
-// CHECK:    <key>col</key><integer>5</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>18</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>18</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>30</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>19</integer>
-// CHECK:       <key>col</key><integer>9</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>19</integer>
-// CHECK:          <key>col</key><integer>9</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>19</integer>
-// CHECK:          <key>col</key><integer>30</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>19</integer>
-// CHECK:            <key>col</key><integer>30</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>21</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>21</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>21</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'A'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'A'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'A'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>myArrayAllocation</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>21</integer>
-// CHECK:    <key>col</key><integer>1</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>24</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>24</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>24</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>24</integer>
-// CHECK:            <key>col</key><integer>28</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>24</integer>
-// CHECK:       <key>col</key><integer>18</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>24</integer>
-// CHECK:          <key>col</key><integer>18</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>24</integer>
-// CHECK:          <key>col</key><integer>28</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>24</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>24</integer>
-// CHECK:            <key>col</key><integer>28</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>40</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>26</integer>
-// CHECK:       <key>col</key><integer>18</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>26</integer>
-// CHECK:          <key>col</key><integer>18</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>26</integer>
-// CHECK:          <key>col</key><integer>40</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Attempt to reallocate memory</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Attempt to reallocate memory</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>26</integer>
-// CHECK:            <key>col</key><integer>40</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>12</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>27</integer>
-// CHECK:       <key>col</key><integer>9</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>27</integer>
-// CHECK:          <key>col</key><integer>9</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>27</integer>
-// CHECK:          <key>col</key><integer>12</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Assuming 'tmp' is null</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Assuming 'tmp' is null</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>12</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>6</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>27</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>27</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>27</integer>
-// CHECK:          <key>col</key><integer>6</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Reallocation failed</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Reallocation failed</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>27</integer>
-// CHECK:            <key>col</key><integer>6</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>28</integer>
-// CHECK:            <key>col</key><integer>14</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>28</integer>
-// CHECK:       <key>col</key><integer>9</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>28</integer>
-// CHECK:          <key>col</key><integer>9</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>28</integer>
-// CHECK:          <key>col</key><integer>14</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>reallocDiagnostics</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>28</integer>
-// CHECK:    <key>col</key><integer>9</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>43</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>43</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>43</integer>
-// CHECK:            <key>col</key><integer>15</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>43</integer>
-// CHECK:            <key>col</key><integer>15</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>43</integer>
-// CHECK:       <key>col</key><integer>15</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>43</integer>
-// CHECK:          <key>col</key><integer>15</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>43</integer>
-// CHECK:          <key>col</key><integer>23</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Calling 'wrapper'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Calling 'wrapper'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>34</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call from 'test_wrapper'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Entered call from 'test_wrapper'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>34</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>34</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>13</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>23</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>35</integer>
-// CHECK:       <key>col</key><integer>13</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>35</integer>
-// CHECK:          <key>col</key><integer>13</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>35</integer>
-// CHECK:          <key>col</key><integer>23</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>13</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>35</integer>
-// CHECK:            <key>col</key><integer>23</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>3</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>37</integer>
-// CHECK:       <key>col</key><integer>7</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>37</integer>
-// CHECK:          <key>col</key><integer>7</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>37</integer>
-// CHECK:          <key>col</key><integer>7</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Assuming 'x' is non-null</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Assuming 'x' is non-null</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>37</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>38</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>38</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>43</integer>
-// CHECK:       <key>col</key><integer>15</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>43</integer>
-// CHECK:          <key>col</key><integer>15</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>43</integer>
-// CHECK:          <key>col</key><integer>23</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Returned allocated memory</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Returned allocated memory</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>43</integer>
-// CHECK:            <key>col</key><integer>15</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>43</integer>
-// CHECK:            <key>col</key><integer>23</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>45</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>45</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>45</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>test_wrapper</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>45</integer>
-// CHECK:    <key>col</key><integer>1</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>59</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>59</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>60</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>60</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>60</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>60</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>60</integer>
-// CHECK:          <key>col</key><integer>28</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Calling 'my_malloc_and_free'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Calling 'my_malloc_and_free'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>52</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call from 'test_double_action_call'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Entered call from 'test_double_action_call'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>52</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>52</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>10</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>20</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>53</integer>
-// CHECK:       <key>col</key><integer>10</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>53</integer>
-// CHECK:          <key>col</key><integer>10</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>53</integer>
-// CHECK:          <key>col</key><integer>20</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>10</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>53</integer>
-// CHECK:            <key>col</key><integer>20</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>54</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>54</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>54</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>54</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>55</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>55</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>55</integer>
-// CHECK:       <key>col</key><integer>7</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>55</integer>
-// CHECK:          <key>col</key><integer>7</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>55</integer>
-// CHECK:          <key>col</key><integer>17</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Calling 'my_free'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Calling 'my_free'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>49</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>2</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call from 'my_malloc_and_free'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Entered call from 'my_malloc_and_free'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>49</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>49</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>50</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>50</integer>
-// CHECK:            <key>col</key><integer>11</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>50</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>50</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>50</integer>
-// CHECK:          <key>col</key><integer>11</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>2</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is released</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is released</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>55</integer>
-// CHECK:       <key>col</key><integer>7</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>55</integer>
-// CHECK:          <key>col</key><integer>7</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>55</integer>
-// CHECK:          <key>col</key><integer>17</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>2</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Returned released memory via 1st parameter</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Returned released memory via 1st parameter</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>55</integer>
-// CHECK:            <key>col</key><integer>7</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>55</integer>
-// CHECK:            <key>col</key><integer>17</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>56</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>56</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>60</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>60</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>60</integer>
-// CHECK:          <key>col</key><integer>28</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Returned released memory via 1st parameter</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Returned released memory via 1st parameter</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>60</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>60</integer>
-// CHECK:            <key>col</key><integer>28</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>61</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>61</integer>
-// CHECK:            <key>col</key><integer>14</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>61</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>61</integer>
-// CHECK:          <key>col</key><integer>12</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>61</integer>
-// CHECK:          <key>col</key><integer>14</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Use of memory after it is freed</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Use of memory after it is freed</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Use of memory after it is freed</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Use-after-free</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>test_double_action_call</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>61</integer>
-// CHECK:    <key>col</key><integer>5</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>74</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>74</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>74</integer>
-// CHECK:            <key>col</key><integer>25</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>74</integer>
-// CHECK:            <key>col</key><integer>35</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>74</integer>
-// CHECK:       <key>col</key><integer>25</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>74</integer>
-// CHECK:          <key>col</key><integer>25</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>74</integer>
-// CHECK:          <key>col</key><integer>35</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>74</integer>
-// CHECK:            <key>col</key><integer>25</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>74</integer>
-// CHECK:            <key>col</key><integer>35</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>75</integer>
-// CHECK:            <key>col</key><integer>11</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>75</integer>
-// CHECK:            <key>col</key><integer>11</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>75</integer>
-// CHECK:       <key>col</key><integer>11</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>75</integer>
-// CHECK:          <key>col</key><integer>11</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>75</integer>
-// CHECK:          <key>col</key><integer>25</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Calling 'my_realloc'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Calling 'my_realloc'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>65</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call from 'reallocIntra'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Entered call from 'reallocIntra'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>65</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>65</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>66</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>66</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>66</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>66</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>40</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>67</integer>
-// CHECK:       <key>col</key><integer>18</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>67</integer>
-// CHECK:          <key>col</key><integer>18</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>67</integer>
-// CHECK:          <key>col</key><integer>40</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Attempt to reallocate memory</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Attempt to reallocate memory</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>18</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>67</integer>
-// CHECK:            <key>col</key><integer>40</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>12</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>68</integer>
-// CHECK:       <key>col</key><integer>9</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>68</integer>
-// CHECK:          <key>col</key><integer>9</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>68</integer>
-// CHECK:          <key>col</key><integer>12</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Assuming 'tmp' is null</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Assuming 'tmp' is null</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>12</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>6</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>68</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>68</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>68</integer>
-// CHECK:          <key>col</key><integer>6</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Reallocation failed</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Reallocation failed</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>68</integer>
-// CHECK:            <key>col</key><integer>6</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>69</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>69</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>75</integer>
-// CHECK:       <key>col</key><integer>11</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>75</integer>
-// CHECK:          <key>col</key><integer>11</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>75</integer>
-// CHECK:          <key>col</key><integer>25</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Reallocation of 1st parameter failed</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Reallocation of 1st parameter failed</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>75</integer>
-// CHECK:            <key>col</key><integer>11</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>75</integer>
-// CHECK:            <key>col</key><integer>25</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>76</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>76</integer>
-// CHECK:            <key>col</key><integer>13</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>76</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>76</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>76</integer>
-// CHECK:          <key>col</key><integer>13</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>reallocIntra</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>76</integer>
-// CHECK:    <key>col</key><integer>5</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>84</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>84</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>85</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>85</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>85</integer>
-// CHECK:       <key>col</key><integer>9</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>85</integer>
-// CHECK:          <key>col</key><integer>9</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>85</integer>
-// CHECK:          <key>col</key><integer>28</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Calling 'malloc_wrapper_ret'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Calling 'malloc_wrapper_ret'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>80</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Entered call from 'use_ret'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Entered call from 'use_ret'</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>80</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>80</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>81</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>81</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>81</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>81</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>81</integer>
-// CHECK:            <key>col</key><integer>19</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>81</integer>
-// CHECK:            <key>col</key><integer>28</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>81</integer>
-// CHECK:       <key>col</key><integer>19</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>81</integer>
-// CHECK:          <key>col</key><integer>19</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>81</integer>
-// CHECK:          <key>col</key><integer>28</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>85</integer>
-// CHECK:       <key>col</key><integer>9</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>85</integer>
-// CHECK:          <key>col</key><integer>9</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>85</integer>
-// CHECK:          <key>col</key><integer>28</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>1</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Returned allocated memory</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Returned allocated memory</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>85</integer>
-// CHECK:            <key>col</key><integer>9</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>85</integer>
-// CHECK:            <key>col</key><integer>28</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>86</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>86</integer>
-// CHECK:            <key>col</key><integer>1</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>86</integer>
-// CHECK:       <key>col</key><integer>1</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'v'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'v'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'v'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>use_ret</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>86</integer>
-// CHECK:    <key>col</key><integer>1</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:   <dict>
-// CHECK:    <key>path</key>
-// CHECK:    <array>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>90</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>90</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>15</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>24</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>92</integer>
-// CHECK:       <key>col</key><integer>15</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>92</integer>
-// CHECK:          <key>col</key><integer>15</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>92</integer>
-// CHECK:          <key>col</key><integer>24</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is allocated</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is allocated</string>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>control</string>
-// CHECK:      <key>edges</key>
-// CHECK:       <array>
-// CHECK:        <dict>
-// CHECK:         <key>start</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>15</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>92</integer>
-// CHECK:            <key>col</key><integer>24</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:         <key>end</key>
-// CHECK:          <array>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>97</integer>
-// CHECK:            <key>col</key><integer>5</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:           <dict>
-// CHECK:            <key>line</key><integer>97</integer>
-// CHECK:            <key>col</key><integer>8</integer>
-// CHECK:            <key>file</key><integer>0</integer>
-// CHECK:           </dict>
-// CHECK:          </array>
-// CHECK:        </dict>
-// CHECK:       </array>
-// CHECK:     </dict>
-// CHECK:     <dict>
-// CHECK:      <key>kind</key><string>event</string>
-// CHECK:      <key>location</key>
-// CHECK:      <dict>
-// CHECK:       <key>line</key><integer>97</integer>
-// CHECK:       <key>col</key><integer>5</integer>
-// CHECK:       <key>file</key><integer>0</integer>
-// CHECK:      </dict>
-// CHECK:      <key>ranges</key>
-// CHECK:      <array>
-// CHECK:        <array>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>97</integer>
-// CHECK:          <key>col</key><integer>5</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:         <dict>
-// CHECK:          <key>line</key><integer>97</integer>
-// CHECK:          <key>col</key><integer>8</integer>
-// CHECK:          <key>file</key><integer>0</integer>
-// CHECK:         </dict>
-// CHECK:        </array>
-// CHECK:      </array>
-// CHECK:      <key>depth</key><integer>0</integer>
-// CHECK:      <key>extended_message</key>
-// CHECK:      <string>Memory is never released; potential leak of memory pointed to by 'm'</string>
-// CHECK:      <key>message</key>
-// CHECK: <string>Memory is never released; potential leak of memory pointed to by 'm'</string>
-// CHECK:     </dict>
-// CHECK:    </array>
-// CHECK:    <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'm'</string>
-// CHECK:    <key>category</key><string>Memory Error</string>
-// CHECK:    <key>type</key><string>Memory leak</string>
-// CHECK:   <key>issue_context_kind</key><string>function</string>
-// CHECK:   <key>issue_context</key><string>LeakedSymbol</string>
-// CHECK:   <key>location</key>
-// CHECK:   <dict>
-// CHECK:    <key>line</key><integer>97</integer>
-// CHECK:    <key>col</key><integer>5</integer>
-// CHECK:    <key>file</key><integer>0</integer>
-// CHECK:   </dict>
-// CHECK:   </dict>
-// CHECK:  </array>
-// CHECK: </dict>
-// CHECK: </plist>
+// Tests that exercise running remove dead bindings at Call exit.
+static void function_with_leak1() {
+    char *x = (char*)malloc(12);
+}
+void use_function_with_leak1() {
+    function_with_leak1();
+    int y = 0;
+}
+
+static void function_with_leak2() {
+    char *x = (char*)malloc(12);
+    int m = 0;
+}
+void use_function_with_leak2() {
+    function_with_leak2();
+}
+
+static void function_with_leak3(int y) {
+    char *x = (char*)malloc(12);
+    if (y)
+        y++;
+}
+void use_function_with_leak3(int y) {
+    function_with_leak3(y);
+}
+
+static void function_with_leak4(int y) {
+    char *x = (char*)malloc(12);
+    if (y)
+        y++;
+    else
+        y--;
+}
+void use_function_with_leak4(int y) {
+    function_with_leak4(y);
+}
+
+int anotherFunction5() {
+    return 5;
+}
+static int function_with_leak5() {
+    char *x = (char*)malloc(12);
+    return anotherFunction5();
+}
+void use_function_with_leak5() {
+    function_with_leak5();
+}
+
+void anotherFunction6(int m) {
+    m++;
+}
+static void function_with_leak6() {
+    char *x = (char*)malloc(12);
+    anotherFunction6(3);
+}
+void use_function_with_leak6() {
+    function_with_leak6();
+}
+
+static void empty_function(){
+}
+void use_empty_function() {
+    empty_function();
+}
+static char *function_with_leak7() {
+    return (char*)malloc(12);
+}
+void use_function_with_leak7() {
+    function_with_leak7();
+}
 
+//CHECK:  <dict>
+//CHECK:   <key>files</key>
+//CHECK:   <array>
+//CHECK:   </array>
+//CHECK:   <key>diagnostics</key>
+//CHECK:   <array>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>10</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>10</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>10</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>10</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>10</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>10</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>27</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>11</integer>
+//CHECK:        <key>col</key><integer>18</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>11</integer>
+//CHECK:           <key>col</key><integer>18</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>11</integer>
+//CHECK:           <key>col</key><integer>27</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>11</integer>
+//CHECK:             <key>col</key><integer>27</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>14</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>14</integer>
+//CHECK:             <key>col</key><integer>6</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>14</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>14</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>14</integer>
+//CHECK:           <key>col</key><integer>6</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'p'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'p'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'p'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>diagnosticTest</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>14</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>18</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>18</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>30</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>19</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>19</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>19</integer>
+//CHECK:           <key>col</key><integer>30</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>19</integer>
+//CHECK:             <key>col</key><integer>30</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>21</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>21</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>21</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'A'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'A'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'A'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>myArrayAllocation</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>21</integer>
+//CHECK:     <key>col</key><integer>1</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>24</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>24</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>24</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>24</integer>
+//CHECK:             <key>col</key><integer>28</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>24</integer>
+//CHECK:        <key>col</key><integer>18</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>24</integer>
+//CHECK:           <key>col</key><integer>18</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>24</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>24</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>24</integer>
+//CHECK:             <key>col</key><integer>28</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>40</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>26</integer>
+//CHECK:        <key>col</key><integer>18</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>26</integer>
+//CHECK:           <key>col</key><integer>18</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>26</integer>
+//CHECK:           <key>col</key><integer>40</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Attempt to reallocate memory</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Attempt to reallocate memory</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>26</integer>
+//CHECK:             <key>col</key><integer>40</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>12</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>27</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>27</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>27</integer>
+//CHECK:           <key>col</key><integer>12</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Assuming 'tmp' is null</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Assuming 'tmp' is null</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>12</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>6</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>27</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>27</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>27</integer>
+//CHECK:           <key>col</key><integer>6</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Reallocation failed</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Reallocation failed</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>27</integer>
+//CHECK:             <key>col</key><integer>6</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>28</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>28</integer>
+//CHECK:             <key>col</key><integer>14</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>28</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>28</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>28</integer>
+//CHECK:           <key>col</key><integer>14</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>reallocDiagnostics</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>28</integer>
+//CHECK:     <key>col</key><integer>9</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>43</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>43</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>43</integer>
+//CHECK:             <key>col</key><integer>15</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>43</integer>
+//CHECK:             <key>col</key><integer>15</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>43</integer>
+//CHECK:        <key>col</key><integer>15</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>43</integer>
+//CHECK:           <key>col</key><integer>15</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>43</integer>
+//CHECK:           <key>col</key><integer>23</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'wrapper'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'wrapper'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>34</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'test_wrapper'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'test_wrapper'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>34</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>34</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>13</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>23</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>35</integer>
+//CHECK:        <key>col</key><integer>13</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>35</integer>
+//CHECK:           <key>col</key><integer>13</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>35</integer>
+//CHECK:           <key>col</key><integer>23</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>13</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>35</integer>
+//CHECK:             <key>col</key><integer>23</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>3</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>37</integer>
+//CHECK:        <key>col</key><integer>7</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>37</integer>
+//CHECK:           <key>col</key><integer>7</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>37</integer>
+//CHECK:           <key>col</key><integer>7</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Assuming 'x' is non-null</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Assuming 'x' is non-null</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>37</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>38</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>38</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>43</integer>
+//CHECK:        <key>col</key><integer>15</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>43</integer>
+//CHECK:           <key>col</key><integer>15</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>43</integer>
+//CHECK:           <key>col</key><integer>23</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Returned allocated memory</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Returned allocated memory</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>43</integer>
+//CHECK:             <key>col</key><integer>15</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>43</integer>
+//CHECK:             <key>col</key><integer>23</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>45</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>45</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>45</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>test_wrapper</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>45</integer>
+//CHECK:     <key>col</key><integer>1</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>59</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>59</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>60</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>60</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>60</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>60</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>60</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'my_malloc_and_free'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'my_malloc_and_free'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>52</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'test_double_action_call'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'test_double_action_call'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>52</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>52</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>10</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>20</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>53</integer>
+//CHECK:        <key>col</key><integer>10</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>53</integer>
+//CHECK:           <key>col</key><integer>10</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>53</integer>
+//CHECK:           <key>col</key><integer>20</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>10</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>53</integer>
+//CHECK:             <key>col</key><integer>20</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>54</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>54</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>54</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>54</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>55</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>55</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>55</integer>
+//CHECK:        <key>col</key><integer>7</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>55</integer>
+//CHECK:           <key>col</key><integer>7</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>55</integer>
+//CHECK:           <key>col</key><integer>17</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'my_free'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'my_free'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>49</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>2</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'my_malloc_and_free'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'my_malloc_and_free'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>49</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>49</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>50</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>50</integer>
+//CHECK:             <key>col</key><integer>11</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>50</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>50</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>50</integer>
+//CHECK:           <key>col</key><integer>11</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>2</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is released</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is released</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>55</integer>
+//CHECK:        <key>col</key><integer>7</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>55</integer>
+//CHECK:           <key>col</key><integer>7</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>55</integer>
+//CHECK:           <key>col</key><integer>17</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>2</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Returned released memory via 1st parameter</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Returned released memory via 1st parameter</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>55</integer>
+//CHECK:             <key>col</key><integer>7</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>55</integer>
+//CHECK:             <key>col</key><integer>17</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>56</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>56</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>60</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>60</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>60</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Returned released memory via 1st parameter</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Returned released memory via 1st parameter</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>60</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>60</integer>
+//CHECK:             <key>col</key><integer>28</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>61</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>61</integer>
+//CHECK:             <key>col</key><integer>14</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>61</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>61</integer>
+//CHECK:           <key>col</key><integer>12</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>61</integer>
+//CHECK:           <key>col</key><integer>14</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Use of memory after it is freed</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Use of memory after it is freed</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Use of memory after it is freed</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Use-after-free</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>test_double_action_call</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>61</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>74</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>74</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>74</integer>
+//CHECK:             <key>col</key><integer>25</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>74</integer>
+//CHECK:             <key>col</key><integer>35</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>74</integer>
+//CHECK:        <key>col</key><integer>25</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>74</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>74</integer>
+//CHECK:           <key>col</key><integer>35</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>74</integer>
+//CHECK:             <key>col</key><integer>25</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>74</integer>
+//CHECK:             <key>col</key><integer>35</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>75</integer>
+//CHECK:             <key>col</key><integer>11</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>75</integer>
+//CHECK:             <key>col</key><integer>11</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>75</integer>
+//CHECK:        <key>col</key><integer>11</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>75</integer>
+//CHECK:           <key>col</key><integer>11</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>75</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'my_realloc'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'my_realloc'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>65</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'reallocIntra'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'reallocIntra'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>65</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>65</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>66</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>66</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>66</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>66</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>40</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>67</integer>
+//CHECK:        <key>col</key><integer>18</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>67</integer>
+//CHECK:           <key>col</key><integer>18</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>67</integer>
+//CHECK:           <key>col</key><integer>40</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Attempt to reallocate memory</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Attempt to reallocate memory</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>18</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>67</integer>
+//CHECK:             <key>col</key><integer>40</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>12</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>68</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>68</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>68</integer>
+//CHECK:           <key>col</key><integer>12</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Assuming 'tmp' is null</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Assuming 'tmp' is null</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>12</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>6</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>68</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>68</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>68</integer>
+//CHECK:           <key>col</key><integer>6</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Reallocation failed</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Reallocation failed</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>68</integer>
+//CHECK:             <key>col</key><integer>6</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>69</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>69</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>75</integer>
+//CHECK:        <key>col</key><integer>11</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>75</integer>
+//CHECK:           <key>col</key><integer>11</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>75</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Reallocation of 1st parameter failed</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Reallocation of 1st parameter failed</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>75</integer>
+//CHECK:             <key>col</key><integer>11</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>75</integer>
+//CHECK:             <key>col</key><integer>25</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>76</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>76</integer>
+//CHECK:             <key>col</key><integer>13</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>76</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>76</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>76</integer>
+//CHECK:           <key>col</key><integer>13</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>reallocIntra</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>76</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>84</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>84</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>85</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>85</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>85</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>85</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>85</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'malloc_wrapper_ret'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'malloc_wrapper_ret'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>80</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_ret'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_ret'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>80</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>80</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>81</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>81</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>81</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>81</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>81</integer>
+//CHECK:             <key>col</key><integer>19</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>81</integer>
+//CHECK:             <key>col</key><integer>28</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>81</integer>
+//CHECK:        <key>col</key><integer>19</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>81</integer>
+//CHECK:           <key>col</key><integer>19</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>81</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>85</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>85</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>85</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Returned allocated memory</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Returned allocated memory</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>85</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>85</integer>
+//CHECK:             <key>col</key><integer>28</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>86</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>86</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>86</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'v'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'v'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'v'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>use_ret</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>86</integer>
+//CHECK:     <key>col</key><integer>1</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>90</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>90</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>15</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>24</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>92</integer>
+//CHECK:        <key>col</key><integer>15</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>92</integer>
+//CHECK:           <key>col</key><integer>15</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>92</integer>
+//CHECK:           <key>col</key><integer>24</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>15</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>92</integer>
+//CHECK:             <key>col</key><integer>24</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>97</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>97</integer>
+//CHECK:             <key>col</key><integer>8</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>97</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>97</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>97</integer>
+//CHECK:           <key>col</key><integer>8</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'm'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'm'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'm'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>LeakedSymbol</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>97</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>105</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>105</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>105</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak1'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak1'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>101</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak1'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak1'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>101</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>101</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>102</integer>
+//CHECK:        <key>col</key><integer>22</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>102</integer>
+//CHECK:           <key>col</key><integer>22</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>102</integer>
+//CHECK:           <key>col</key><integer>31</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>102</integer>
+//CHECK:             <key>col</key><integer>11</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>102</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>102</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>102</integer>
+//CHECK:           <key>col</key><integer>11</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>function_with_leak1</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>102</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>114</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>114</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>114</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak2'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak2'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>109</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak2'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak2'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>109</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>109</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>110</integer>
+//CHECK:        <key>col</key><integer>22</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>110</integer>
+//CHECK:           <key>col</key><integer>22</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>110</integer>
+//CHECK:           <key>col</key><integer>31</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>110</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>111</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>111</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>111</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>111</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>111</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>function_with_leak2</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>111</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>123</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>123</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>123</integer>
+//CHECK:           <key>col</key><integer>26</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak3'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak3'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>117</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak3'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak3'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>117</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>117</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>118</integer>
+//CHECK:        <key>col</key><integer>22</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>118</integer>
+//CHECK:           <key>col</key><integer>22</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>118</integer>
+//CHECK:           <key>col</key><integer>31</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>118</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>119</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>120</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>120</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>120</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>120</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>120</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>function_with_leak3</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>120</integer>
+//CHECK:     <key>col</key><integer>9</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>134</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>134</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>134</integer>
+//CHECK:           <key>col</key><integer>26</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak4'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak4'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>126</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak4'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak4'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>126</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>126</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>127</integer>
+//CHECK:        <key>col</key><integer>22</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>127</integer>
+//CHECK:           <key>col</key><integer>22</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>127</integer>
+//CHECK:           <key>col</key><integer>31</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>127</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>128</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>131</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>131</integer>
+//CHECK:             <key>col</key><integer>9</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>131</integer>
+//CHECK:        <key>col</key><integer>9</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>131</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>131</integer>
+//CHECK:           <key>col</key><integer>9</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>function_with_leak4</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>131</integer>
+//CHECK:     <key>col</key><integer>9</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>145</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>145</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>145</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak5'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak5'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>140</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak5'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak5'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>140</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>140</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>141</integer>
+//CHECK:        <key>col</key><integer>22</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>141</integer>
+//CHECK:           <key>col</key><integer>22</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>141</integer>
+//CHECK:           <key>col</key><integer>31</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>141</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>142</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>142</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>142</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>142</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>142</integer>
+//CHECK:             <key>col</key><integer>12</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>142</integer>
+//CHECK:             <key>col</key><integer>29</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>142</integer>
+//CHECK:        <key>col</key><integer>12</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>142</integer>
+//CHECK:           <key>col</key><integer>12</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>142</integer>
+//CHECK:           <key>col</key><integer>29</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>function_with_leak5</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>142</integer>
+//CHECK:     <key>col</key><integer>12</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>156</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>156</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>156</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak6'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak6'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>151</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak6'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak6'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>151</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>151</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>152</integer>
+//CHECK:        <key>col</key><integer>22</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>152</integer>
+//CHECK:           <key>col</key><integer>22</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>152</integer>
+//CHECK:           <key>col</key><integer>31</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>22</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>152</integer>
+//CHECK:             <key>col</key><integer>31</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>153</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>153</integer>
+//CHECK:             <key>col</key><integer>23</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>153</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>153</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>153</integer>
+//CHECK:           <key>col</key><integer>23</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak of memory pointed to by 'x'</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>function_with_leak6</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>153</integer>
+//CHECK:     <key>col</key><integer>5</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:    <dict>
+//CHECK:     <key>path</key>
+//CHECK:     <array>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>168</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>168</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>168</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Calling 'function_with_leak7'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Calling 'function_with_leak7'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>164</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Entered call from 'use_function_with_leak7'</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Entered call from 'use_function_with_leak7'</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>164</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>164</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>165</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>165</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>165</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>165</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>165</integer>
+//CHECK:             <key>col</key><integer>19</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>165</integer>
+//CHECK:             <key>col</key><integer>28</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>165</integer>
+//CHECK:        <key>col</key><integer>19</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>165</integer>
+//CHECK:           <key>col</key><integer>19</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>165</integer>
+//CHECK:           <key>col</key><integer>28</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is allocated</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is allocated</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>168</integer>
+//CHECK:        <key>col</key><integer>5</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>ranges</key>
+//CHECK:       <array>
+//CHECK:         <array>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>168</integer>
+//CHECK:           <key>col</key><integer>5</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:          <dict>
+//CHECK:           <key>line</key><integer>168</integer>
+//CHECK:           <key>col</key><integer>25</integer>
+//CHECK:           <key>file</key><integer>0</integer>
+//CHECK:          </dict>
+//CHECK:         </array>
+//CHECK:       </array>
+//CHECK:       <key>depth</key><integer>1</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Returned allocated memory</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Returned allocated memory</string>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>control</string>
+//CHECK:       <key>edges</key>
+//CHECK:        <array>
+//CHECK:         <dict>
+//CHECK:          <key>start</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>168</integer>
+//CHECK:             <key>col</key><integer>5</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>168</integer>
+//CHECK:             <key>col</key><integer>25</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:          <key>end</key>
+//CHECK:           <array>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>169</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:            <dict>
+//CHECK:             <key>line</key><integer>169</integer>
+//CHECK:             <key>col</key><integer>1</integer>
+//CHECK:             <key>file</key><integer>0</integer>
+//CHECK:            </dict>
+//CHECK:           </array>
+//CHECK:         </dict>
+//CHECK:        </array>
+//CHECK:      </dict>
+//CHECK:      <dict>
+//CHECK:       <key>kind</key><string>event</string>
+//CHECK:       <key>location</key>
+//CHECK:       <dict>
+//CHECK:        <key>line</key><integer>169</integer>
+//CHECK:        <key>col</key><integer>1</integer>
+//CHECK:        <key>file</key><integer>0</integer>
+//CHECK:       </dict>
+//CHECK:       <key>depth</key><integer>0</integer>
+//CHECK:       <key>extended_message</key>
+//CHECK:       <string>Memory is never released; potential leak</string>
+//CHECK:       <key>message</key>
+//CHECK:  <string>Memory is never released; potential leak</string>
+//CHECK:      </dict>
+//CHECK:     </array>
+//CHECK:     <key>description</key><string>Memory is never released; potential leak</string>
+//CHECK:     <key>category</key><string>Memory Error</string>
+//CHECK:     <key>type</key><string>Memory leak</string>
+//CHECK:    <key>issue_context_kind</key><string>function</string>
+//CHECK:    <key>issue_context</key><string>use_function_with_leak7</string>
+//CHECK:    <key>location</key>
+//CHECK:    <dict>
+//CHECK:     <key>line</key><integer>169</integer>
+//CHECK:     <key>col</key><integer>1</integer>
+//CHECK:     <key>file</key><integer>0</integer>
+//CHECK:    </dict>
+//CHECK:    </dict>
+//CHECK:   </array>
+//CHECK:  </dict>
+//CHECK:  </plist>

Modified: cfe/branches/tooling/test/Analysis/self-init.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/self-init.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/self-init.m (original)
+++ cfe/branches/tooling/test/Analysis/self-init.m Wed Apr 25 07:05:17 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fobjc-default-synthesize-properties %s -verify
+// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fobjc-default-synthesize-properties -fno-builtin %s -verify
 
 @class NSZone, NSCoder;
 @protocol NSObject- (id)self;

Modified: cfe/branches/tooling/test/CXX/class/class.mem/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/class.mem/p2.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/class.mem/p2.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/class.mem/p2.cpp Wed Apr 25 07:05:17 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s 
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
 
 // C++11 [class.mem]p2:
 //   A class is considered a completely-defined object type (or
@@ -56,3 +56,20 @@
 
   template struct A2<int>;
 }
+
+namespace PR12629 {
+  struct S {
+    static int (f)() throw();
+    static int ((((((g))))() throw(U)));
+    int (*h)() noexcept(false);
+    static int (&i)() noexcept(true);
+    static int (*j)() throw(U); // expected-error {{type name}} \
+    // expected-error {{expected ')'}} expected-note {{to match}}
+
+    struct U {};
+  };
+  static_assert(noexcept(S::f()), "");
+  static_assert(!noexcept(S::g()), "");
+  static_assert(!noexcept(S().h()), "");
+  static_assert(noexcept(S::i()), "");
+}

Modified: cfe/branches/tooling/test/CXX/special/class.copy/implicit-move.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/special/class.copy/implicit-move.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/special/class.copy/implicit-move.cpp (original)
+++ cfe/branches/tooling/test/CXX/special/class.copy/implicit-move.cpp Wed Apr 25 07:05:17 2012
@@ -198,15 +198,15 @@
   struct NoMove4 : NonTrivialCopyAssign {}; // expected-note 2{{'const DR1402::NoMove4 &'}}
   struct NoMove5 : virtual NonTrivialCopyCtor {}; // expected-note 2{{'const DR1402::NoMove5 &'}}
   struct NoMove6 : virtual NonTrivialCopyAssign {}; // expected-note 2{{'const DR1402::NoMove6 &'}}
-  struct NoMove7 : NonTrivialCopyCtorVBase {}; // expected-note 2{{'DR1402::NoMove7 &'}}
-  struct NoMove8 : NonTrivialCopyAssignVBase {}; // expected-note 2{{'DR1402::NoMove8 &'}}
+  struct NoMove7 : NonTrivialCopyCtorVBase {}; // expected-note 2{{'const DR1402::NoMove7 &'}}
+  struct NoMove8 : NonTrivialCopyAssignVBase {}; // expected-note 2{{'const DR1402::NoMove8 &'}}
 
   // A non-trivially-move-assignable virtual base class inhibits the declaration
   // of a move assignment (which might move-assign the base class multiple
   // times).
   struct NoMove9 : NonTrivialMoveAssign {};
-  struct NoMove10 : virtual NonTrivialMoveAssign {}; // expected-note {{'DR1402::NoMove10 &'}}
-  struct NoMove11 : NonTrivialMoveAssignVBase {}; // expected-note {{'DR1402::NoMove11 &'}}
+  struct NoMove10 : virtual NonTrivialMoveAssign {}; // expected-note {{'const DR1402::NoMove10 &'}}
+  struct NoMove11 : NonTrivialMoveAssignVBase {}; // expected-note {{'const DR1402::NoMove11 &'}}
 
   struct Test {
     friend NoMove1::NoMove1(NoMove1 &&); // expected-error {{no matching function}}

Modified: cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c (original)
+++ cfe/branches/tooling/test/CodeGen/2009-10-20-GlobalDebug.c Wed Apr 25 07:05:17 2012
@@ -6,5 +6,5 @@
   return 0;
 }
 
-// CHECK: !14 = metadata !{i32 {{.*}}, i32 0, metadata !5, metadata !"localstatic", metadata !"localstatic", metadata !"", metadata !6, i32 5, metadata !9, i32 1, i32 1, i32* @main.localstatic} ; [ DW_TAG_variable ]
-// CHECK: !15 = metadata !{i32 {{.*}}, i32 0, null, metadata !"global", metadata !"global", metadata !"", metadata !6, i32 3, metadata !9, i32 0, i32 1, i32* @global} ; [ DW_TAG_variable ]
+// CHECK: metadata !{i32 {{.*}}, i32 0, metadata !5, metadata !"localstatic", metadata !"localstatic", metadata !"", metadata !6, i32 5, metadata !9, i32 1, i32 1, i32* @main.localstatic} ; [ DW_TAG_variable ]
+// CHECK: metadata !{i32 {{.*}}, i32 0, null, metadata !"global", metadata !"global", metadata !"", metadata !6, i32 3, metadata !9, i32 0, i32 1, i32* @global} ; [ DW_TAG_variable ]

Modified: cfe/branches/tooling/test/CodeGen/arm-homogenous.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/arm-homogenous.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/arm-homogenous.c (original)
+++ cfe/branches/tooling/test/CodeGen/arm-homogenous.c Wed Apr 25 07:05:17 2012
@@ -1,5 +1,7 @@
 // RUN: %clang_cc1 -triple armv7---eabi -target-abi aapcs -mfloat-abi hard -emit-llvm %s -o - | FileCheck %s
-#include <stdint.h>
+
+typedef long long int64_t;
+typedef unsigned int uint32_t;
 
 /* This is not a homogenous aggregate - fundamental types are different */
 typedef union {

Modified: cfe/branches/tooling/test/CodeGen/debug-info-line3.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/debug-info-line3.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/debug-info-line3.c (original)
+++ cfe/branches/tooling/test/CodeGen/debug-info-line3.c Wed Apr 25 07:05:17 2012
@@ -12,5 +12,5 @@
   
 }
 
-// CHECK: ret void, !dbg !19
-// CHECK: !19 = metadata !{i32 6,
+// CHECK: ret void, !dbg !17
+// CHECK: !17 = metadata !{i32 6,

Modified: cfe/branches/tooling/test/CodeGen/debug-line-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/debug-line-1.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/debug-line-1.c (original)
+++ cfe/branches/tooling/test/CodeGen/debug-line-1.c Wed Apr 25 07:05:17 2012
@@ -4,7 +4,7 @@
 
 // Check to make sure that we emit the block for the break so that we can count the line.
 // CHECK: sw.bb:                                            ; preds = %entry
-// CHECK: br label %sw.epilog, !dbg !21
+// CHECK: br label %sw.epilog, !dbg !19
   
 extern int atoi(const char *);
 

Modified: cfe/branches/tooling/test/CodeGen/libcalls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/libcalls.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/libcalls.c (original)
+++ cfe/branches/tooling/test/CodeGen/libcalls.c Wed Apr 25 07:05:17 2012
@@ -73,3 +73,48 @@
 // CHECK-NO: declare float @llvm.fma.f32(float, float, float) nounwind readnone
 // CHECK-NO: declare double @llvm.fma.f64(double, double, double) nounwind readnone
 // CHECK-NO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) nounwind readnone
+
+// Just checking to make sure these library functions are marked readnone
+void test_builtins(double d, float f, long double ld) {
+// CHEC-NO: @test_builtins
+// CHEC-YES: @test_builtins
+  double atan_ = atan(d);
+  long double atanl_ = atanl(ld);
+  float atanf_ = atanf(f);
+// CHECK-NO: declare double @atan(double) nounwind readnone
+// CHECK-NO: declare x86_fp80 @atanl(x86_fp80) nounwind readnone
+// CHECK-NO: declare float @atanf(float) nounwind readnone
+// CHECK-YES-NOT: declare double @atan(double) nounwind readnone
+// CHECK-YES-NOT: declare x86_fp80 @atanl(x86_fp80) nounwind readnone
+// CHECK-YES-NOT: declare float @atanf(float) nounwind readnone
+
+  double atan2_ = atan2(d, 2);
+  long double atan2l_ = atan2l(ld, ld);
+  float atan2f_ = atan2f(f, f);
+// CHECK-NO: declare double @atan2(double, double) nounwind readnone
+// CHECK-NO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) nounwind readnone
+// CHECK-NO: declare float @atan2f(float, float) nounwind readnone
+// CHECK-YES-NOT: declare double @atan2(double, double) nounwind readnone
+// CHECK-YES-NOT: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) nounwind readnone
+// CHECK-YES-NOT: declare float @atan2f(float, float) nounwind readnone
+
+  double exp_ = exp(d);
+  long double expl_ = expl(ld);
+  float expf_ = expf(f);
+// CHECK-NO: declare double @exp(double) nounwind readnone
+// CHECK-NO: declare x86_fp80 @expl(x86_fp80) nounwind readnone
+// CHECK-NO: declare float @expf(float) nounwind readnone
+// CHECK-YES-NOT: declare double @exp(double) nounwind readnone
+// CHECK-YES-NOT: declare x86_fp80 @expl(x86_fp80) nounwind readnone
+// CHECK-YES-NOT: declare float @expf(float) nounwind readnone
+
+  double log_ = log(d);
+  long double logl_ = logl(ld);
+  float logf_ = logf(f);
+// CHECK-NO: declare double @log(double) nounwind readnone
+// CHECK-NO: declare x86_fp80 @logl(x86_fp80) nounwind readnone
+// CHECK-NO: declare float @logf(float) nounwind readnone
+// CHECK-YES-NOT: declare double @log(double) nounwind readnone
+// CHECK-YES-NOT: declare x86_fp80 @logl(x86_fp80) nounwind readnone
+// CHECK-YES-NOT: declare float @logf(float) nounwind readnone
+}

Modified: cfe/branches/tooling/test/CodeGen/tbaa-for-vptr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/tbaa-for-vptr.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/tbaa-for-vptr.cpp (original)
+++ cfe/branches/tooling/test/CodeGen/tbaa-for-vptr.cpp Wed Apr 25 07:05:17 2012
@@ -1,5 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm -o - -O0 -fthread-sanitizer %s | FileCheck %s
 // RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -o - -O1  -relaxed-aliasing -fthread-sanitizer %s | FileCheck %s
+//
+// RUN: %clang_cc1 -emit-llvm -o - -O0 %s | FileCheck %s --check-prefix=NOTBAA
+// RUN: %clang_cc1 -emit-llvm -o - -O2  -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA
+//
 // Check that we generate TBAA for vtable pointer loads and stores.
+// When -fthread-sanitizer is used TBAA should be generated at all opt levels
+// even if -relaxed-aliasing is present.
 struct A {
   virtual int foo() const ;
   virtual ~A();
@@ -15,5 +23,5 @@
 
 // CHECK: %{{.*}} = load {{.*}} !tbaa !0
 // CHECK: store {{.*}} !tbaa !0
-// CHECK: !0 = metadata !{metadata !"vtable pointer", metadata !1}
-// CHECK: !1 = metadata !{metadata !"Simple C/C++ TBAA"}
+// CHECK: = metadata !{metadata !"vtable pointer", metadata !{{.*}}}
+// NOTBAA-NOT: = metadata !{metadata !"Simple C/C++ TBAA"}

Modified: cfe/branches/tooling/test/CodeGenCXX/debug-info-artificial-arg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/debug-info-artificial-arg.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/debug-info-artificial-arg.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/debug-info-artificial-arg.cpp Wed Apr 25 07:05:17 2012
@@ -23,8 +23,8 @@
 }
 
 // FIXME: The numbers are truly awful.
-// CHECK: !18 = metadata !{i32 {{.*}}, i32 0, metadata !"", i32 0, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !19} ; [ DW_TAG_pointer_type ]
-// CHECK: !19 = metadata !{i32 {{.*}}, null, metadata !"A", metadata !6, i32 8, i64 128, i64 64, i32 0, i32 0, null, metadata !20, i32 0, metadata !19, null} ; [ DW_TAG_class_type ]
-// CHECK: metadata !19, metadata !"A", metadata !"A", metadata !"", metadata !6, i32 12, metadata !45, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null, i32 0, metadata !47, i32 12} ; [ DW_TAG_subprogram ]
-// CHECK: metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !46, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
-// CHECK: !46 = metadata !{null, metadata !18, metadata !9, metadata !34}
+// CHECK: !16 = metadata !{i32 {{.*}}, i32 0, metadata !"", i32 0, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !17} ; [ DW_TAG_pointer_type ]
+// CHECK: !17 = metadata !{i32 {{.*}}, null, metadata !"A", metadata !6, i32 8, i64 128, i64 64, i32 0, i32 0, null, metadata !18, i32 0, metadata !17, null} ; [ DW_TAG_class_type ]
+// CHECK: metadata !17, metadata !"A", metadata !"A", metadata !"", metadata !6, i32 12, metadata !43, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 false, null, null, i32 0, metadata !45, i32 12} ; [ DW_TAG_subprogram ]
+// CHECK: metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !44, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
+// CHECK: !44 = metadata !{null, metadata !16, metadata !9, metadata !32}

Modified: cfe/branches/tooling/test/CodeGenCXX/debug-info-fwd-ref.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/debug-info-fwd-ref.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/debug-info-fwd-ref.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/debug-info-fwd-ref.cpp Wed Apr 25 07:05:17 2012
@@ -19,8 +19,8 @@
 // Make sure we have two DW_TAG_class_types for baz and bar and no forward
 // references.
 // FIXME: These should be struct types to match the declaration.
-// CHECK: metadata !{i32 {{.*}}, null, metadata !"bar", metadata !6, i32 8, i64 128, i64 64, i32 0, i32 0, null, metadata !20, i32 0, null, null} ; [ DW_TAG_class_type ]
-// CHECK: metadata !{i32 {{.*}}, null, metadata !"baz", metadata !6, i32 3, i64 32, i64 32, i32 0, i32 0, null, metadata !23, i32 0, null, null} ; [ DW_TAG_class_type ]
-// CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"bar", metadata !6, i32 9, i64 0, i64 0, i32 0, i32 4, i32 0, null, i32 0, i32 0} ; [ DW_TAG_class_type ]
+// CHECK: metadata !{i32 {{.*}}, null, metadata !"bar", metadata !6, i32 8, i64 128, i64 64, i32 0, i32 0, null, metadata !18, i32 0, null, null} ; [ DW_TAG_class_type ]
+// CHECK: metadata !{i32 {{.*}}, null, metadata !"baz", metadata !6, i32 3, i64 32, i64 32, i32 0, i32 0, null, metadata !21, i32 0, null, null} ; [ DW_TAG_class_type ]
+// CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"bar", metadata !6, i32 8, i64 0, i64 0, i32 0, i32 4, i32 0, null, i32 0, i32 0} ; [ DW_TAG_class_type ]
 // CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"baz", metadata !6, i32 3, i64 0, i64 0, i32 0, i32 4, null, null, i32 0, null, null} ; [ DW_TAG_class_type ]
 

Modified: cfe/branches/tooling/test/CodeGenCXX/debug-info-nullptr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/debug-info-nullptr.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/debug-info-nullptr.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/debug-info-nullptr.cpp Wed Apr 25 07:05:17 2012
@@ -4,4 +4,4 @@
   decltype(nullptr) t = 0;
 }
 
-// CHECK: !13 = metadata !{i32 {{.*}}, null, metadata !"nullptr_t", null, i32 0, i64 0, i64 0, i64 0, i32 0, i32 0} ; [ DW_TAG_unspecified_type ]
+// CHECK: metadata !{i32 {{.*}}, null, metadata !"nullptr_t", null, i32 0, i64 0, i64 0, i64 0, i32 0, i32 0} ; [ DW_TAG_unspecified_type ]

Modified: cfe/branches/tooling/test/CodeGenCXX/debug-info-static-fns.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/debug-info-static-fns.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/debug-info-static-fns.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/debug-info-static-fns.cpp Wed Apr 25 07:05:17 2012
@@ -7,4 +7,4 @@
 }
 
 // Verify that a is present and mangled.
-// CHECK: metadata !{i32 786478, i32 0, metadata !6, metadata !"a", metadata !"a", metadata !"_ZN1AL1aEi", metadata !7, i32 4, metadata !8, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @_ZN1AL1aEi, null, null, metadata !14, i32 4} ; [ DW_TAG_subprogram ]
+// CHECK: metadata !{i32 {{.*}}, i32 0, metadata !6, metadata !"a", metadata !"a", metadata !"_ZN1AL1aEi", metadata !7, i32 4, metadata !8, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @_ZN1AL1aEi, null, null, metadata !1, i32 4} ; [ DW_TAG_subprogram ]

Modified: cfe/branches/tooling/test/CodeGenCXX/global-array-destruction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/global-array-destruction.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/global-array-destruction.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/global-array-destruction.cpp Wed Apr 25 07:05:17 2012
@@ -1,6 +1,4 @@
-// REQUIRES: x86-64-registered-target
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - | FileCheck %s
 
 extern "C" int printf(...);
 
@@ -24,11 +22,24 @@
 S s2;
 S arr3[3];
 
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
-// CHECK-LP64: callq    ___cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: call {{.*}} @__cxa_atexit
+
+struct T {
+  double d;
+  int n;
+  ~T();
+};
+T t[2][3] = { 1.0, 2, 3.0, 4, 5.0, 6, 7.0, 8, 9.0, 10, 11.0, 12 };
+
+// CHECK: call {{.*}} @__cxa_atexit
+// CHECK: getelementptr inbounds ({{.*}} bitcast {{.*}}* @t to %struct.T*), i64 6
+// CHECK: call void @_ZN1TD1Ev
+// CHECK: icmp eq {{.*}} @t
+// CHECK: br i1 {{.*}}

Modified: cfe/branches/tooling/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/visibility.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/visibility.cpp Wed Apr 25 07:05:17 2012
@@ -5,6 +5,20 @@
 #define PROTECTED __attribute__((visibility("protected")))
 #define DEFAULT __attribute__((visibility("default")))
 
+namespace test30 {
+  // When H is hidden, it should make X hidden, even if the template argument
+  // is not.
+  struct H {
+  };
+  template<H *T>
+  struct X {
+  };
+  H DEFAULT a;
+  X<&a> b;
+  // CHECK: _ZN6test301bE = global
+  // CHECK-HIDDEN: _ZN6test301bE = hidden global
+}
+
 namespace test25 {
   template<typename T>
   struct X {
@@ -522,7 +536,9 @@
   };
   template class foo::bar<zed>;
   // CHECK: define weak_odr void @_ZN7PR101133foo3barINS_3zedEE3zedEv
-  // CHECK-HIDDEN: define weak_odr hidden void @_ZN7PR101133foo3barINS_3zedEE3zedEv
+
+  // FIXME: This should be hidden as zed is hidden.
+  // CHECK-HIDDEN: define weak_odr void @_ZN7PR101133foo3barINS_3zedEE3zedEv
 }
 
 namespace PR11690 {
@@ -553,7 +569,9 @@
   };
   template class foo::zed<baz>;
   // CHECK: define weak_odr void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
-  // CHECK-HIDDEN: define weak_odr hidden void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
+
+  // FIXME: This should be hidden as baz is hidden.
+  // CHECK-HIDDEN: define weak_odr void @_ZN9PR11690_23foo3zedINS_3bazENS0_3barEE3barEv
 }
 
 namespace test23 {
@@ -617,3 +635,80 @@
   // CHECK: define void @_ZN6test261CIiE1fEv
   // CHECK-HIDDEN: define void @_ZN6test261CIiE1fEv
 }
+
+namespace test31 {
+  struct A {
+    struct HIDDEN B {
+      static void DEFAULT baz();
+    };
+  };
+  void f() {
+    A::B::baz();
+  }
+  // CHECK: declare void @_ZN6test311A1B3bazEv()
+  // CHECK-HIDDEN: declare void @_ZN6test311A1B3bazEv()
+}
+
+namespace test32 {
+  struct HIDDEN A {
+    struct DEFAULT B {
+      void DEFAULT baz();
+    };
+  };
+  void A::B::baz() {
+  }
+  // CHECK: define void @_ZN6test321A1B3bazEv
+  // CHECK-HIDDEN: define void @_ZN6test321A1B3bazEv
+}
+
+namespace test33 {
+  template<typename T>
+  class foo {
+    void bar() {}
+  };
+  struct HIDDEN zed {
+  };
+  template class DEFAULT foo<zed>;
+  // CHECK: define weak_odr void @_ZN6test333fooINS_3zedEE3barEv
+  // CHECK-HIDDEN: define weak_odr void @_ZN6test333fooINS_3zedEE3barEv
+}
+
+namespace test34 {
+  struct foo {
+  };
+  template<class T>
+  void bar() {}
+  template DEFAULT void bar<foo>();
+  // CHECK: define weak_odr void @_ZN6test343barINS_3fooEEEvv
+  // CHECK-HIDDEN: define weak_odr void @_ZN6test343barINS_3fooEEEvv
+}
+
+namespace test35 {
+  // This is a really ugly testcase. GCC propagates the DEFAULT in zed's
+  // definition. What we do instead is be conservative about merging
+  // implicit visibilities.
+  // FIXME: Maybe the best thing to do here is error? The test at least
+  // makes sure we don't produce a hidden symbol for foo<zed>::bar.
+  template<typename T>
+  struct DEFAULT foo {
+    void bar() {}
+  };
+  class zed;
+  template class foo<zed>;
+  class DEFAULT zed {
+  };
+  // CHECK: define weak_odr void @_ZN6test353fooINS_3zedEE3barEv
+  // CHECK-HIDDEN: define weak_odr void @_ZN6test353fooINS_3zedEE3barEv
+}
+
+namespace test36 {
+  template<typename T1, typename T2>
+  class foo {
+    void bar() {}
+  };
+  class DEFAULT S1 {};
+  struct HIDDEN S2 {};
+  template class foo<S1, S2>;
+  // CHECK: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
+  // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
+}

Modified: cfe/branches/tooling/test/CodeGenObjC/debug-info-block-helper.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjC/debug-info-block-helper.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjC/debug-info-block-helper.m (original)
+++ cfe/branches/tooling/test/CodeGenObjC/debug-info-block-helper.m Wed Apr 25 07:05:17 2012
@@ -2,7 +2,7 @@
 // RUN: %clang_cc1 -emit-llvm -fblocks -g -triple x86_64-apple-darwin10 -fobjc-fragile-abi %s -o - | FileCheck %s
 extern void foo(void(^)(void));
 
-// CHECK: metadata !{i32 786478, i32 0, metadata !27, metadata !"__destroy_helper_block_", metadata !"__destroy_helper_block_", metadata !"", metadata !27, i32 24, metadata !43, i1 true, i1 true, i32 0, i32 0, null, i32 0, i1 false, void (i8*)* @__destroy_helper_block_, null, null, metadata !45, i32 24} ; [ DW_TAG_subprogram ]
+// CHECK: metadata !{i32 786478, i32 0, metadata !27, metadata !"__destroy_helper_block_", metadata !"__destroy_helper_block_", metadata !"", metadata !27, i32 24, metadata !37, i1 true, i1 true, i32 0, i32 0, null, i32 0, i1 false, void (i8*)* @__destroy_helper_block_, null, null, metadata !5, i32 24} ; [ DW_TAG_subprogram ]
 
 @interface NSObject {
   struct objc_object *isa;

Modified: cfe/branches/tooling/test/CodeGenObjC/debug-info-synthesis.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjC/debug-info-synthesis.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjC/debug-info-synthesis.m (original)
+++ cfe/branches/tooling/test/CodeGenObjC/debug-info-synthesis.m Wed Apr 25 07:05:17 2012
@@ -31,4 +31,4 @@
 }
 
 // CHECK: !7 = metadata !{i32 {{.*}}, metadata !"./foo.h"
-// CHECK: !31 = metadata !{i32 {{.*}}, i32 0, metadata !7, metadata !"-[Foo dict]", metadata !"-[Foo dict]", metadata !"", metadata !7, i32 8, metadata !32, i1 true, i1 true, i32 0, i32 0, null, i32 320, i1 false, %1* (%0*, i8*)* @"\01-[Foo dict]", null, null, metadata !34, i32 8} ; [ DW_TAG_subprogram ]
+// CHECK: !29 = metadata !{i32 {{.*}}, i32 0, metadata !7, metadata !"-[Foo dict]", metadata !"-[Foo dict]", metadata !"", metadata !7, i32 8, metadata !30, i1 true, i1 true, i32 0, i32 0, null, i32 320, i1 false, %1* (%0*, i8*)* @"\01-[Foo dict]", null, null, metadata !1, i32 8} ; [ DW_TAG_subprogram ]

Modified: cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m (original)
+++ cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m Wed Apr 25 07:05:17 2012
@@ -24,6 +24,8 @@
   b = @(__objc_yes);
   b = @(__objc_no);
   b = @("hello");
+#else
+#error "boxed expressions not supported"
 #endif
 }
 

Modified: cfe/branches/tooling/test/Driver/arclite-link.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/arclite-link.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/arclite-link.c (original)
+++ cfe/branches/tooling/test/Driver/arclite-link.c Wed Apr 25 07:05:17 2012
@@ -4,5 +4,7 @@
 // RUN: %clang -### -target i386-apple-darwin10 -fobjc-link-runtime -mmacosx-version-min=10.7 %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOARCLITE %s
 
 // CHECK-ARCLITE-OSX: libarclite_macosx.a
+// CHECK-ARCLITE-OSX: -framework
+// CHECK-ARCLITE-OSX: Foundation
 // CHECK-ARCLITE-OSX: -lobjc
 // CHECK-NOARCLITE-NOT: libarclite

Modified: cfe/branches/tooling/test/Driver/clang-translation.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/clang-translation.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/clang-translation.c (original)
+++ cfe/branches/tooling/test/Driver/clang-translation.c Wed Apr 25 07:05:17 2012
@@ -44,3 +44,10 @@
 // ARMV7_HARDFLOAT: "-mfloat-abi" "hard"
 // ARMV7_HARDFLOAT-NOT: "-msoft-float"
 // ARMV7_HARDFLOAT: "-x" "c"
+
+// RUN: %clang -target arm-linux -### -S %s 2> %t.log \
+// RUN:   -march=armv5e
+// RUN: FileCheck -check-prefix=ARMV5E %s < %t.log
+// ARMV5E: clang
+// ARMV5E: "-cc1"
+// ARMV5E: "-target-cpu" "arm1022e"

Modified: cfe/branches/tooling/test/Driver/linux-as.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/linux-as.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/linux-as.c (original)
+++ cfe/branches/tooling/test/Driver/linux-as.c Wed Apr 25 07:05:17 2012
@@ -3,29 +3,54 @@
 // RUN: %clang -target arm-linux -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=ARM %s
-// CHECK-ARM: as{{(.exe)?}}"
+// CHECK-ARM: as{{(.exe)?}}" "-mfloat-abi=soft"
 //
 // RUN: %clang -target arm-linux -mcpu=cortex-a8 -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=ARM-MCPU %s
-// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mcpu=cortex-a8"
+// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mcpu=cortex-a8"
 //
 // RUN: %clang -target arm-linux -mfpu=neon -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=ARM-MFPU %s
-// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfpu=neon"
+// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfloat-abi=soft" "-mfpu=neon"
 //
 // RUN: %clang -target arm-linux -march=armv7-a -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=ARM-MARCH %s
-// CHECK-ARM-MARCH: as{{(.exe)?}}" "-march=armv7-a"
+// CHECK-ARM-MARCH: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a"
 //
 // RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon -march=armv7-a -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=ARM-ALL %s
-// CHECK-ARM-ALL: as{{(.exe)?}}" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
+// CHECK-ARM-ALL: as{{(.exe)?}}" "-mfloat-abi=soft" "-march=armv7-a" "-mcpu=cortex-a8" "-mfpu=neon"
 //
 // RUN: %clang -target armv7-linux -mcpu=cortex-a8 -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=ARM-TARGET %s
-// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mcpu=cortex-a8"
+// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mfloat-abi=soft" "-mcpu=cortex-a8"
+//
+// RUN: %clang -target arm-linux -mfloat-abi=hard -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=ARM-MFLOAT-ABI %s
+// CHECK-ARM-MFLOAT-ABI: as{{(.exe)?}}" "-mfloat-abi=hard"
+//
+// RUN: %clang -target arm-linux-androideabi -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=ARM-ANDROID %s
+// CHECK-ARM-ANDROID: as{{(.exe)?}}" "-mfloat-abi=soft"
+//
+// RUN: %clang -target arm-linux-androideabi -march=armv7-a -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=ARM-ANDROID-SOFTFP %s
+// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "-mfloat-abi=softfp" "-march=armv7-a"
+//
+// RUN: %clang -target arm-linux-eabi -mhard-float -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=ARM-HARDFP %s
+// CHECK-ARM-HARDFP: as{{(.exe)?}}" "-mfloat-abi=hard"
+//
+// RUN: %clang -target ppc-linux -mcpu=invalid-cpu -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=PPC-NO-MCPU %s
+// CHECK-PPC-NO-MCPU-NOT: as{{.*}} "-mcpu=invalid-cpu"

Modified: cfe/branches/tooling/test/Driver/linux-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Driver/linux-ld.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Driver/linux-ld.c (original)
+++ cfe/branches/tooling/test/Driver/linux-ld.c Wed Apr 25 07:05:17 2012
@@ -268,3 +268,39 @@
 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/lib"
 // CHECK-DEBIAN-PPC64: "-L[[SYSROOT]]/usr/lib"
 //
+// Test linker invocation on Android.
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     -target arm-linux-androideabi \
+// RUN:     --sysroot=%S/Inputs/basic_android_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-ANDROID %s
+// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-ANDROID: "{{.*}}/crtbegin_dynamic.o"
+// CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
+// CHECK-ANDROID-NOT: "gcc_s"
+// CHECK-ANDROID: "-lgcc"
+// CHECK-ANDROID-NOT: "gcc_s"
+// CHECK-ANDROID: "{{.*}}/crtend_android.o"
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     -target arm-linux-androideabi \
+// RUN:     --sysroot=%S/Inputs/basic_android_tree \
+// RUN:     -shared \
+// RUN:   | FileCheck --check-prefix=CHECK-ANDROID-SO %s
+// CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-ANDROID-SO: "{{.*}}/crtbegin_so.o"
+// CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
+// CHECK-ANDROID-SO-NOT: "gcc_s"
+// CHECK-ANDROID-SO: "-lgcc"
+// CHECK-ANDROID-SO-NOT: "gcc_s"
+// CHECK-ANDROID-SO: "{{.*}}/crtend_so.o"
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:     -target arm-linux-androideabi \
+// RUN:     --sysroot=%S/Inputs/basic_android_tree \
+// RUN:     -static \
+// RUN:   | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
+// CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-ANDROID-STATIC: "{{.*}}/crtbegin_static.o"
+// CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
+// CHECK-ANDROID-STATIC-NOT: "gcc_s"
+// CHECK-ANDROID-STATIC: "-lgcc"
+// CHECK-ANDROID-STATIC-NOT: "gcc_s"
+// CHECK-ANDROID-STATIC: "{{.*}}/crtend_android.o"

Modified: cfe/branches/tooling/test/FixIt/fixit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/FixIt/fixit.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/FixIt/fixit.cpp (original)
+++ cfe/branches/tooling/test/FixIt/fixit.cpp Wed Apr 25 07:05:17 2012
@@ -204,3 +204,16 @@
          template<typename> typename Bar, // expected-error {{template template parameter requires 'class' after the parameter list}}
          template<typename> struct Baz> // expected-error {{template template parameter requires 'class' after the parameter list}}
 void func();
+
+
+namespace ShadowedTagType {
+class Foo {
+ public:
+  enum Bar { X, Y };
+  void SetBar(Bar bar);
+  Bar Bar();
+ private:
+  Bar bar_; // expected-error {{must use 'enum' tag to refer to type 'Bar' in this scope}}
+};
+void Foo::SetBar(Bar bar) { bar_ = bar; } // expected-error {{must use 'enum' tag to refer to type 'Bar' in this scope}}
+}

Modified: cfe/branches/tooling/test/PCH/cxx-friends.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/cxx-friends.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/cxx-friends.cpp (original)
+++ cfe/branches/tooling/test/PCH/cxx-friends.cpp Wed Apr 25 07:05:17 2012
@@ -11,3 +11,11 @@
     a->x = 0;
   }
 };
+
+template<typename T> class PR12585::future_base::setter {
+public:
+  int f() {
+    return promise<T*>().k;
+  }
+};
+int k = PR12585::future_base::setter<int>().f();

Modified: cfe/branches/tooling/test/PCH/cxx-friends.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/cxx-friends.h?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/cxx-friends.h (original)
+++ cfe/branches/tooling/test/PCH/cxx-friends.h Wed Apr 25 07:05:17 2012
@@ -4,3 +4,15 @@
   int x;
   friend class F;
 };
+
+namespace PR12585 {
+  struct future_base {
+    template<typename> class setter;
+  };
+  template<typename> class promise {
+    // We used to inject this into future_base with no access specifier,
+    // then crash during AST writing.
+    template<typename> friend class future_base::setter;
+    int k;
+  };
+}

Modified: cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm (original)
+++ cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm Wed Apr 25 07:05:17 2012
@@ -1,7 +1,11 @@
 // RUN: %clang_cc1 -E %s -o %t.mm
 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o %t-rw.cpp
-// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp -Wno-attributes -Werror
+// RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp -Wno-attributes
+
+// FIXME: It is incompatible to mingw due to __declspec.
+// See also r155278
+// XFAIL: mingw32
 
 extern char *strdup(const char *str);
 extern "C" void *sel_registerName(const char *);

Modified: cfe/branches/tooling/test/Rewriter/rewrite-modern-block.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Rewriter/rewrite-modern-block.mm?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Rewriter/rewrite-modern-block.mm (original)
+++ cfe/branches/tooling/test/Rewriter/rewrite-modern-block.mm Wed Apr 25 07:05:17 2012
@@ -21,3 +21,25 @@
 int foo() {
     __block int hello;
 }
+
+// rdar://7547630
+// rewriting multiple __block decls on wintin same decl stmt.
+int radar7547630() {
+  __block int BI1, BI2;
+
+  __block float FLOAT1, FT2, FFFFFFFF3,
+   FFFXXX4;
+
+  __block void (^B)(), (^BB)();
+}
+
+// rewriting multiple __block decls on wintin same decl stmt
+// with initializers.
+void  rdar7547630(const char *keybuf, const char *valuebuf) {
+  __block int BI1 = 1, BI2 = 2;
+
+  double __block BYREFVAR = 1.34, BYREFVAR_NO_INIT, BYREFVAR2 = 1.37;
+
+  __block const char *keys = keybuf, *values = valuebuf, *novalues;
+}
+

Modified: cfe/branches/tooling/test/Rewriter/rewrite-modern-extern-c-func-decl.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Rewriter/rewrite-modern-extern-c-func-decl.mm?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Rewriter/rewrite-modern-extern-c-func-decl.mm (original)
+++ cfe/branches/tooling/test/Rewriter/rewrite-modern-extern-c-func-decl.mm Wed Apr 25 07:05:17 2012
@@ -2,6 +2,9 @@
 // RUN: %clang_cc1 -fsyntax-only -Werror -Wno-address-of-temporary -Wno-attributes -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
 // rdar://11131490
 
+// XFAIL: mingw
+// FIXME: __declspec(X) is predefined on mingw.
+
 extern "C" __declspec(dllexport) void BreakTheRewriter(void) {
         __block int aBlockVariable = 0;
         void (^aBlock)(void) = ^ {
@@ -49,8 +52,19 @@
 char CFStringGetTypeID();
 void x(void (^)());
 
-static void initStatics() {
+static void initStatics(int arg, ...) {
+    x(^{
+        stringtype = CFStringGetTypeID();
+    });
+}
+static void initStatics1(...) {
     x(^{
         stringtype = CFStringGetTypeID();
     });
 }
+static void initStatics2() {
+    x(^{
+        stringtype = CFStringGetTypeID();
+    });
+}
+

Modified: cfe/branches/tooling/test/Sema/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/MicrosoftExtensions.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/MicrosoftExtensions.c (original)
+++ cfe/branches/tooling/test/Sema/MicrosoftExtensions.c Wed Apr 25 07:05:17 2012
@@ -87,11 +87,11 @@
   AA; // expected-warning {{anonymous structs are a Microsoft extension}}
 } BB;
 
-__declspec(deprecated("This is deprecated")) enum DE1 { one, two } e1;
+__declspec(deprecated("This is deprecated")) enum DE1 { one, two } e1; // expected-note {{'e1' declared here}}
 struct __declspec(deprecated) DS1 { int i; float f; };
 
 #define MY_TEXT		"This is also deprecated"
-__declspec(deprecated(MY_TEXT)) void Dfunc1( void ) {}
+__declspec(deprecated(MY_TEXT)) void Dfunc1( void ) {} // expected-note {{'Dfunc1' declared here}}
 
 void test( void ) {
 	e1 = one;	// expected-warning {{'e1' is deprecated: This is deprecated}}

Modified: cfe/branches/tooling/test/Sema/attr-availability-ios.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-availability-ios.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-availability-ios.c (original)
+++ cfe/branches/tooling/test/Sema/attr-availability-ios.c Wed Apr 25 07:05:17 2012
@@ -1,14 +1,14 @@
 // RUN: %clang_cc1 "-triple" "x86_64-apple-ios3.0" -fsyntax-only -verify %s
 
-void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1)));
+void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); // expected-note {{'f0' declared here}}
 void f1(int) __attribute__((availability(ios,introduced=2.1)));
-void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0)));
+void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{'f2' declared here}}
 void f3(int) __attribute__((availability(ios,introduced=3.0)));
 void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}}
 
-void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0)));
+void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); // expected-note {{'f5' declared here}}
 void f6(int) __attribute__((availability(ios,deprecated=3.0)));
-void f6(int) __attribute__((availability(ios,introduced=2.0)));
+void f6(int) __attribute__((availability(ios,introduced=2.0))); // expected-note {{'f6' declared here}}
 
 void test() {
   f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}}

Modified: cfe/branches/tooling/test/Sema/attr-availability-macosx.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-availability-macosx.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-availability-macosx.c (original)
+++ cfe/branches/tooling/test/Sema/attr-availability-macosx.c Wed Apr 25 07:05:17 2012
@@ -2,7 +2,7 @@
 
 void f0(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6)));
 void f1(int) __attribute__((availability(macosx,introduced=10.5)));
-void f2(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5)));
+void f2(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5))); // expected-note {{'f2' declared here}}
 void f3(int) __attribute__((availability(macosx,introduced=10.6)));
 void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=3.0))); // expected-note{{explicitly marked unavailable}}
 void f5(int) __attribute__((availability(ios,introduced=3.2), availability(macosx,unavailable))); // expected-note{{function has been explicitly marked unavailable here}}

Modified: cfe/branches/tooling/test/Sema/attr-availability.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-availability.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-availability.c (original)
+++ cfe/branches/tooling/test/Sema/attr-availability.c Wed Apr 25 07:05:17 2012
@@ -8,7 +8,7 @@
 
 // rdar://10095131
 extern void 
-ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName")));
+ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName"))); // expected-note {{'ATSFontGetName' declared here}}
 
 extern void
 ATSFontGetPostScriptName(int flags) __attribute__((availability(macosx,introduced=8.0,obsoleted=9.0, message="use ATSFontGetFullPostScriptName"))); // expected-note {{function has been explicitly marked unavailable here}}

Modified: cfe/branches/tooling/test/Sema/attr-deprecated-message.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-deprecated-message.c?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-deprecated-message.c (original)
+++ cfe/branches/tooling/test/Sema/attr-deprecated-message.c Wed Apr 25 07:05:17 2012
@@ -21,7 +21,7 @@
 Color c1; // expected-warning {{'Color' is deprecated: Please avoid Color}}
 
 int g1;
-int g2 __attribute__ ((deprecated("Please avoid g2")));
+int g2 __attribute__ ((deprecated("Please avoid g2"))); // expected-note {{'g2' declared here}}
 
 int func1()
 {

Modified: cfe/branches/tooling/test/SemaCXX/implicit-exception-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/implicit-exception-spec.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/implicit-exception-spec.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/implicit-exception-spec.cpp Wed Apr 25 07:05:17 2012
@@ -54,3 +54,33 @@
     } t; // expected-note {{has no default constructor}}
   };
 }
+
+namespace ImplicitDtorExceptionSpec {
+  struct A {
+    virtual ~A();
+
+    struct Inner {
+      ~Inner() throw();
+    };
+    Inner inner;
+  };
+
+  struct B {
+    virtual ~B() {} // expected-note {{here}}
+  };
+
+  struct C : B {
+    virtual ~C() {}
+    A a;
+  };
+
+  struct D : B {
+    ~D(); // expected-error {{more lax than base}}
+    struct E {
+      ~E();
+      struct F {
+        ~F() throw(A);
+      } f;
+    } e;
+  };
+}

Modified: cfe/branches/tooling/test/SemaCXX/member-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/member-expr.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/member-expr.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/member-expr.cpp Wed Apr 25 07:05:17 2012
@@ -157,3 +157,13 @@
   Vec fun3(int x = 0);
   int test3() { return fun3.size(); } // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments}}
 }
+
+namespace DotForSemiTypo {
+void f(int i) {
+  // If the programmer typo'd '.' for ';', make sure we point at the '.' rather
+  // than the "field name" (whatever the first token on the next line happens to
+  // be).
+  int j = i. // expected-error {{member reference base type 'int' is not a structure or union}}
+  j = 0;
+}
+}

Modified: cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-thread-safety-parsing.cpp Wed Apr 25 07:05:17 2012
@@ -22,7 +22,7 @@
 #define NO_THREAD_SAFETY_ANALYSIS  __attribute__ ((no_thread_safety_analysis))
 
 
-class __attribute__((lockable)) Mu {
+class LOCKABLE Mutex {
   public:
   void Lock();
 };
@@ -32,11 +32,11 @@
 
 class MuWrapper {
   public:
-  Mu mu;
-  Mu getMu() {
+  Mutex mu;
+  Mutex getMu() {
     return mu;
   }
-  Mu * getMuPointer() {
+  Mutex * getMuPointer() {
     return μ
   }
 };
@@ -50,32 +50,32 @@
   }
 };
 
-Mu mu1;
+Mutex mu1;
 UnlockableMu umu;
-Mu mu2;
+Mutex mu2;
 MuWrapper muWrapper;
 MuDoubleWrapper muDoubleWrapper;
-Mu* muPointer;
-Mu ** muDoublePointer = & muPointer;
-Mu& muRef = mu1;
+Mutex* muPointer;
+Mutex** muDoublePointer = & muPointer;
+Mutex& muRef = mu1;
 
 //---------------------------------------//
 // Scoping tests
 //--------------------------------------//
 
 class Foo {
-  Mu foomu;    
-  void needLock() __attribute__((exclusive_lock_function(foomu)));
+  Mutex foomu;
+  void needLock() EXCLUSIVE_LOCK_FUNCTION(foomu);
 };
 
 class Foo2 {
-  void needLock() __attribute__((exclusive_lock_function(foomu)));
-  Mu foomu;    
+  void needLock() EXCLUSIVE_LOCK_FUNCTION(foomu);
+  Mutex foomu;
 };
 
 class Bar {
- Mu barmu;
- Mu barmu2 __attribute__((acquired_after(barmu)));
+ Mutex barmu;
+ Mutex barmu2 ACQUIRED_AFTER(barmu);
 };
 
 
@@ -90,34 +90,34 @@
 #error "Should support no_thread_safety_analysis attribute"
 #endif
 
-void noanal_fun() __attribute__((no_thread_safety_analysis));
+void noanal_fun() NO_THREAD_SAFETY_ANALYSIS;
 
 void noanal_fun_args() __attribute__((no_thread_safety_analysis(1))); // \
   // expected-error {{attribute takes no arguments}}
 
-int noanal_testfn(int y) __attribute__((no_thread_safety_analysis));
+int noanal_testfn(int y) NO_THREAD_SAFETY_ANALYSIS;
 
 int noanal_testfn(int y) {
-  int x __attribute__((no_thread_safety_analysis)) = y; // \
+  int x NO_THREAD_SAFETY_ANALYSIS = y; // \
     // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
   return x;
 };
 
-int noanal_test_var __attribute__((no_thread_safety_analysis)); // \
+int noanal_test_var NO_THREAD_SAFETY_ANALYSIS; // \
   // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
 
 class NoanalFoo {
  private:
-  int test_field __attribute__((no_thread_safety_analysis)); // \
+  int test_field NO_THREAD_SAFETY_ANALYSIS; // \
     // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
-  void test_method() __attribute__((no_thread_safety_analysis));
+  void test_method() NO_THREAD_SAFETY_ANALYSIS;
 };
 
-class __attribute__((no_thread_safety_analysis)) NoanalTestClass { // \
+class NO_THREAD_SAFETY_ANALYSIS NoanalTestClass { // \
   // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
 };
 
-void noanal_fun_params(int lvar __attribute__((no_thread_safety_analysis))); // \
+void noanal_fun_params(int lvar NO_THREAD_SAFETY_ANALYSIS); // \
   // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
 
 
@@ -129,30 +129,30 @@
 #error "Should support guarded_var attribute"
 #endif
 
-int gv_var_noargs __attribute__((guarded_var));
+int gv_var_noargs GUARDED_VAR;
 
 int gv_var_args __attribute__((guarded_var(1))); // \
   // expected-error {{attribute takes no arguments}}
 
 class GVFoo {
  private:
-  int gv_field_noargs __attribute__((guarded_var));
+  int gv_field_noargs GUARDED_VAR;
   int gv_field_args __attribute__((guarded_var(1))); // \
     // expected-error {{attribute takes no arguments}}
 };
 
-class __attribute__((guarded_var)) GV { // \
+class GUARDED_VAR GV { // \
   // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
 };
 
-void gv_function() __attribute__((guarded_var)); // \
+void gv_function() GUARDED_VAR; // \
   // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
 
-void gv_function_params(int gv_lvar __attribute__((guarded_var))); // \
+void gv_function_params(int gv_lvar GUARDED_VAR); // \
   // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
 
 int gv_testfn(int y){
-  int x __attribute__((guarded_var)) = y; // \
+  int x GUARDED_VAR = y; // \
     // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
   return x;
 }
@@ -167,21 +167,21 @@
 #error "Should support pt_guarded_var attribute"
 #endif
 
-int *pgv_pt_var_noargs __attribute__((pt_guarded_var));
+int *pgv_pt_var_noargs PT_GUARDED_VAR;
 
-int pgv_var_noargs __attribute__((pt_guarded_var)); // \
+int pgv_var_noargs PT_GUARDED_VAR; // \
     // expected-warning {{'pt_guarded_var' only applies to pointer types; type here is 'int'}}
 
 class PGVFoo {
  private:
-  int *pt_field_noargs __attribute__((pt_guarded_var));
-  int field_noargs __attribute__((pt_guarded_var)); // \
+  int *pt_field_noargs PT_GUARDED_VAR;
+  int field_noargs PT_GUARDED_VAR; // \
     // expected-warning {{'pt_guarded_var' only applies to pointer types; type here is 'int'}}
   int *gv_field_args __attribute__((pt_guarded_var(1))); // \
     // expected-error {{attribute takes no arguments}}
 };
 
-class __attribute__((pt_guarded_var)) PGV { // \
+class PT_GUARDED_VAR PGV { // \
   // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
 };
 
@@ -189,14 +189,14 @@
   // expected-error {{attribute takes no arguments}}
 
 
-void pgv_function() __attribute__((pt_guarded_var)); // \
+void pgv_function() PT_GUARDED_VAR; // \
   // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
 
-void pgv_function_params(int *gv_lvar __attribute__((pt_guarded_var))); // \
+void pgv_function_params(int *gv_lvar PT_GUARDED_VAR); // \
   // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
 
 void pgv_testfn(int y){
-  int *x __attribute__((pt_guarded_var)) = new int(0); // \
+  int *x PT_GUARDED_VAR = new int(0); // \
     // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
   delete x;
 }
@@ -211,35 +211,35 @@
 #error "Should support lockable attribute"
 #endif
 
-class __attribute__((lockable)) LTestClass {
+class LOCKABLE LTestClass {
 };
 
 class __attribute__((lockable (1))) LTestClass_args { // \
     // expected-error {{attribute takes no arguments}}
 };
 
-void l_test_function() __attribute__((lockable));  // \
+void l_test_function() LOCKABLE;  // \
   // expected-warning {{'lockable' attribute only applies to classes}}
 
 int l_testfn(int y) {
-  int x __attribute__((lockable)) = y; // \
+  int x LOCKABLE = y; // \
     // expected-warning {{'lockable' attribute only applies to classes}}
   return x;
 }
 
-int l_test_var __attribute__((lockable)); // \
+int l_test_var LOCKABLE; // \
   // expected-warning {{'lockable' attribute only applies to classes}}
 
 class LFoo {
  private:
-  int test_field __attribute__((lockable)); // \
+  int test_field LOCKABLE; // \
     // expected-warning {{'lockable' attribute only applies to classes}}
-  void test_method() __attribute__((lockable)); // \
+  void test_method() LOCKABLE; // \
     // expected-warning {{'lockable' attribute only applies to classes}}
 };
 
 
-void l_function_params(int lvar __attribute__((lockable))); // \
+void l_function_params(int lvar LOCKABLE); // \
   // expected-warning {{'lockable' attribute only applies to classes}}
 
 
@@ -251,35 +251,35 @@
 #error "Should support scoped_lockable attribute"
 #endif
 
-class __attribute__((scoped_lockable)) SLTestClass {
+class SCOPED_LOCKABLE SLTestClass {
 };
 
 class __attribute__((scoped_lockable (1))) SLTestClass_args { // \
   // expected-error {{attribute takes no arguments}}
 };
 
-void sl_test_function() __attribute__((scoped_lockable));  // \
+void sl_test_function() SCOPED_LOCKABLE;  // \
   // expected-warning {{'scoped_lockable' attribute only applies to classes}}
 
 int sl_testfn(int y) {
-  int x __attribute__((scoped_lockable)) = y; // \
+  int x SCOPED_LOCKABLE = y; // \
     // expected-warning {{'scoped_lockable' attribute only applies to classes}}
   return x;
 }
 
-int sl_test_var __attribute__((scoped_lockable)); // \
+int sl_test_var SCOPED_LOCKABLE; // \
   // expected-warning {{'scoped_lockable' attribute only applies to classes}}
 
 class SLFoo {
  private:
-  int test_field __attribute__((scoped_lockable)); // \
+  int test_field SCOPED_LOCKABLE; // \
     // expected-warning {{'scoped_lockable' attribute only applies to classes}}
-  void test_method() __attribute__((scoped_lockable)); // \
+  void test_method() SCOPED_LOCKABLE; // \
     // expected-warning {{'scoped_lockable' attribute only applies to classes}}
 };
 
 
-void sl_function_params(int lvar __attribute__((scoped_lockable))); // \
+void sl_function_params(int lvar SCOPED_LOCKABLE); // \
   // expected-warning {{'scoped_lockable' attribute only applies to classes}}
 
 
@@ -295,7 +295,7 @@
 
 //1. Check applied to the right types & argument number
 
-int gb_var_arg __attribute__((guarded_by(mu1)));
+int gb_var_arg GUARDED_BY(mu1);
 
 int gb_var_args __attribute__((guarded_by(mu1, mu2))); // \
   // expected-error {{attribute takes one argument}}
@@ -307,21 +307,21 @@
  private:
   int gb_field_noargs __attribute__((guarded_by)); // \
     // expected-error {{attribute takes one argument}}
-  int gb_field_args __attribute__((guarded_by(mu1)));
+  int gb_field_args GUARDED_BY(mu1);
 };
 
-class __attribute__((guarded_by(mu1))) GB { // \
+class GUARDED_BY(mu1) GB { // \
   // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
 };
 
-void gb_function() __attribute__((guarded_by(mu1))); // \
+void gb_function() GUARDED_BY(mu1); // \
   // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
 
-void gb_function_params(int gv_lvar __attribute__((guarded_by(mu1)))); // \
+void gb_function_params(int gv_lvar GUARDED_BY(mu1)); // \
   // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
 
 int gb_testfn(int y){
-  int x __attribute__((guarded_by(mu1))) = y; // \
+  int x GUARDED_BY(mu1) = y; // \
     // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
   return x;
 }
@@ -329,24 +329,24 @@
 //2. Check argument parsing.
 
 // legal attribute arguments
-int gb_var_arg_1 __attribute__((guarded_by(muWrapper.mu)));
-int gb_var_arg_2 __attribute__((guarded_by(muDoubleWrapper.muWrapper->mu)));
-int gb_var_arg_3 __attribute__((guarded_by(muWrapper.getMu())));
-int gb_var_arg_4 __attribute__((guarded_by(*muWrapper.getMuPointer())));
-int gb_var_arg_5 __attribute__((guarded_by(&mu1)));
-int gb_var_arg_6 __attribute__((guarded_by(muRef)));
-int gb_var_arg_7 __attribute__((guarded_by(muDoubleWrapper.getWrapper()->getMu())));
-int gb_var_arg_8 __attribute__((guarded_by(muPointer)));
+int gb_var_arg_1 GUARDED_BY(muWrapper.mu);
+int gb_var_arg_2 GUARDED_BY(muDoubleWrapper.muWrapper->mu);
+int gb_var_arg_3 GUARDED_BY(muWrapper.getMu());
+int gb_var_arg_4 GUARDED_BY(*muWrapper.getMuPointer());
+int gb_var_arg_5 GUARDED_BY(&mu1);
+int gb_var_arg_6 GUARDED_BY(muRef);
+int gb_var_arg_7 GUARDED_BY(muDoubleWrapper.getWrapper()->getMu());
+int gb_var_arg_8 GUARDED_BY(muPointer);
 
 
 // illegal attribute arguments
-int gb_var_arg_bad_1 __attribute__((guarded_by(1))); // \
+int gb_var_arg_bad_1 GUARDED_BY(1); // \
   // expected-warning {{'guarded_by' attribute requires arguments that are class type or point to class type; type here is 'int'}}
-int gb_var_arg_bad_2 __attribute__((guarded_by("mu"))); // \
-  // expected-warning {{'guarded_by' attribute requires arguments that are class type or point to class type; type here is 'const char [3]'}}
-int gb_var_arg_bad_3 __attribute__((guarded_by(muDoublePointer))); // \
-  // expected-warning {{'guarded_by' attribute requires arguments that are class type or point to class type; type here is 'class Mu **'}}
-int gb_var_arg_bad_4 __attribute__((guarded_by(umu))); // \
+int gb_var_arg_bad_2 GUARDED_BY("mu"); // \
+  // expected-warning {{ignoring 'guarded_by' attribute because its argument is invalid}}
+int gb_var_arg_bad_3 GUARDED_BY(muDoublePointer); // \
+  // expected-warning {{'guarded_by' attribute requires arguments that are class type or point to class type; type here is 'class Mutex **'}}
+int gb_var_arg_bad_4 GUARDED_BY(umu); // \
   // expected-warning {{'guarded_by' attribute requires arguments whose type is annotated with 'lockable' attribute; type here is 'class UnlockableMu'}}
 
 //3.
@@ -366,33 +366,33 @@
 int *pgb_var_noargs __attribute__((pt_guarded_by)); // \
   // expected-error {{attribute takes one argument}}
 
-int *pgb_ptr_var_arg __attribute__((pt_guarded_by(mu1)));
+int *pgb_ptr_var_arg PT_GUARDED_BY(mu1);
 
-int *pgb_ptr_var_args __attribute__((guarded_by(mu1, mu2))); // \
+int *pgb_ptr_var_args __attribute__((pt_guarded_by(mu1, mu2))); // \
   // expected-error {{attribute takes one argument}}
 
-int pgb_var_args __attribute__((pt_guarded_by(mu1))); // \
+int pgb_var_args PT_GUARDED_BY(mu1); // \
   // expected-warning {{'pt_guarded_by' only applies to pointer types; type here is 'int'}}
 
 class PGBFoo {
  private:
   int *pgb_field_noargs __attribute__((pt_guarded_by)); // \
     // expected-error {{attribute takes one argument}}
-  int *pgb_field_args __attribute__((pt_guarded_by(mu1)));
+  int *pgb_field_args PT_GUARDED_BY(mu1);
 };
 
-class __attribute__((pt_guarded_by(mu1))) PGB { // \
+class PT_GUARDED_BY(mu1) PGB { // \
   // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
 };
 
-void pgb_function() __attribute__((pt_guarded_by(mu1))); // \
+void pgb_function() PT_GUARDED_BY(mu1); // \
   // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
 
-void pgb_function_params(int gv_lvar __attribute__((pt_guarded_by(mu1)))); // \
+void pgb_function_params(int gv_lvar PT_GUARDED_BY(mu1)); // \
   // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
 
 void pgb_testfn(int y){
-  int *x __attribute__((pt_guarded_by(mu1))) = new int(0); // \
+  int *x PT_GUARDED_BY(mu1) = new int(0); // \
     // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
   delete x;
 }
@@ -400,24 +400,24 @@
 //2. Check argument parsing.
 
 // legal attribute arguments
-int * pgb_var_arg_1 __attribute__((pt_guarded_by(muWrapper.mu)));
-int * pgb_var_arg_2 __attribute__((pt_guarded_by(muDoubleWrapper.muWrapper->mu)));
-int * pgb_var_arg_3 __attribute__((pt_guarded_by(muWrapper.getMu())));
-int * pgb_var_arg_4 __attribute__((pt_guarded_by(*muWrapper.getMuPointer())));
-int * pgb_var_arg_5 __attribute__((pt_guarded_by(&mu1)));
-int * pgb_var_arg_6 __attribute__((pt_guarded_by(muRef)));
-int * pgb_var_arg_7 __attribute__((pt_guarded_by(muDoubleWrapper.getWrapper()->getMu())));
-int * pgb_var_arg_8 __attribute__((pt_guarded_by(muPointer)));
+int * pgb_var_arg_1 PT_GUARDED_BY(muWrapper.mu);
+int * pgb_var_arg_2 PT_GUARDED_BY(muDoubleWrapper.muWrapper->mu);
+int * pgb_var_arg_3 PT_GUARDED_BY(muWrapper.getMu());
+int * pgb_var_arg_4 PT_GUARDED_BY(*muWrapper.getMuPointer());
+int * pgb_var_arg_5 PT_GUARDED_BY(&mu1);
+int * pgb_var_arg_6 PT_GUARDED_BY(muRef);
+int * pgb_var_arg_7 PT_GUARDED_BY(muDoubleWrapper.getWrapper()->getMu());
+int * pgb_var_arg_8 PT_GUARDED_BY(muPointer);
 
 
 // illegal attribute arguments
-int * pgb_var_arg_bad_1 __attribute__((pt_guarded_by(1))); // \
+int * pgb_var_arg_bad_1 PT_GUARDED_BY(1); // \
   // expected-warning {{'pt_guarded_by' attribute requires arguments that are class type or point to class type}}
-int * pgb_var_arg_bad_2 __attribute__((pt_guarded_by("mu"))); // \
+int * pgb_var_arg_bad_2 PT_GUARDED_BY("mu"); // \
+  // expected-warning {{ignoring 'pt_guarded_by' attribute because its argument is invalid}}
+int * pgb_var_arg_bad_3 PT_GUARDED_BY(muDoublePointer); // \
   // expected-warning {{'pt_guarded_by' attribute requires arguments that are class type or point to class type}}
-int * pgb_var_arg_bad_3 __attribute__((pt_guarded_by(muDoublePointer))); // \
-  // expected-warning {{'pt_guarded_by' attribute requires arguments that are class type or point to class type}}
-int * pgb_var_arg_bad_4 __attribute__((pt_guarded_by(umu))); // \
+int * pgb_var_arg_bad_4 PT_GUARDED_BY(umu); // \
   // expected-warning {{'pt_guarded_by' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -431,56 +431,56 @@
 #error "Should support acquired_after attribute"
 #endif
 
-Mu mu_aa __attribute__((acquired_after(mu1)));
+Mutex mu_aa ACQUIRED_AFTER(mu1);
 
-Mu aa_var_noargs __attribute__((acquired_after)); // \
+Mutex aa_var_noargs __attribute__((acquired_after)); // \
   // expected-error {{attribute takes at least 1 argument}}
 
 class AAFoo {
  private:
-  Mu aa_field_noargs __attribute__((acquired_after)); // \
+  Mutex aa_field_noargs __attribute__((acquired_after)); // \
     // expected-error {{attribute takes at least 1 argument}}
-  Mu aa_field_args __attribute__((acquired_after(mu1)));
+  Mutex aa_field_args ACQUIRED_AFTER(mu1);
 };
 
-class __attribute__((acquired_after(mu1))) AA { // \
+class ACQUIRED_AFTER(mu1) AA { // \
   // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
 };
 
-void aa_function() __attribute__((acquired_after(mu1))); // \
+void aa_function() ACQUIRED_AFTER(mu1); // \
   // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
 
-void aa_function_params(int gv_lvar __attribute__((acquired_after(mu1)))); // \
+void aa_function_params(int gv_lvar ACQUIRED_AFTER(mu1)); // \
   // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
 
 void aa_testfn(int y){
-  Mu x __attribute__((acquired_after(mu1))) = Mu(); // \
+  Mutex x ACQUIRED_AFTER(mu1) = Mutex(); // \
     // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
 }
 
 //Check argument parsing.
 
 // legal attribute arguments
-Mu aa_var_arg_1 __attribute__((acquired_after(muWrapper.mu)));
-Mu aa_var_arg_2 __attribute__((acquired_after(muDoubleWrapper.muWrapper->mu)));
-Mu aa_var_arg_3 __attribute__((acquired_after(muWrapper.getMu())));
-Mu aa_var_arg_4 __attribute__((acquired_after(*muWrapper.getMuPointer())));
-Mu aa_var_arg_5 __attribute__((acquired_after(&mu1)));
-Mu aa_var_arg_6 __attribute__((acquired_after(muRef)));
-Mu aa_var_arg_7 __attribute__((acquired_after(muDoubleWrapper.getWrapper()->getMu())));
-Mu aa_var_arg_8 __attribute__((acquired_after(muPointer)));
+Mutex aa_var_arg_1 ACQUIRED_AFTER(muWrapper.mu);
+Mutex aa_var_arg_2 ACQUIRED_AFTER(muDoubleWrapper.muWrapper->mu);
+Mutex aa_var_arg_3 ACQUIRED_AFTER(muWrapper.getMu());
+Mutex aa_var_arg_4 ACQUIRED_AFTER(*muWrapper.getMuPointer());
+Mutex aa_var_arg_5 ACQUIRED_AFTER(&mu1);
+Mutex aa_var_arg_6 ACQUIRED_AFTER(muRef);
+Mutex aa_var_arg_7 ACQUIRED_AFTER(muDoubleWrapper.getWrapper()->getMu());
+Mutex aa_var_arg_8 ACQUIRED_AFTER(muPointer);
 
 
 // illegal attribute arguments
-Mu aa_var_arg_bad_1 __attribute__((acquired_after(1))); // \
-  // expected-warning {{'acquired_after' attribute requires arguments that are class type or point to class type}}
-Mu aa_var_arg_bad_2 __attribute__((acquired_after("mu"))); // \
+Mutex aa_var_arg_bad_1 ACQUIRED_AFTER(1); // \
   // expected-warning {{'acquired_after' attribute requires arguments that are class type or point to class type}}
-Mu aa_var_arg_bad_3 __attribute__((acquired_after(muDoublePointer))); // \
+Mutex aa_var_arg_bad_2 ACQUIRED_AFTER("mu"); // \
+  // expected-warning {{ignoring 'acquired_after' attribute because its argument is invalid}}
+Mutex aa_var_arg_bad_3 ACQUIRED_AFTER(muDoublePointer); // \
   // expected-warning {{'acquired_after' attribute requires arguments that are class type or point to class type}}
-Mu aa_var_arg_bad_4 __attribute__((acquired_after(umu))); // \
+Mutex aa_var_arg_bad_4 ACQUIRED_AFTER(umu); // \
   // expected-warning {{'acquired_after' attribute requires arguments whose type is annotated with 'lockable' attribute}}
-UnlockableMu aa_var_arg_bad_5 __attribute__((acquired_after(mu_aa))); // \
+UnlockableMu aa_var_arg_bad_5 ACQUIRED_AFTER(mu_aa); // \
   // expected-warning {{'acquired_after' attribute can only be applied in a context annotated with 'lockable' attribute}}
 
 //-----------------------------------------//
@@ -491,59 +491,59 @@
 #error "Should support acquired_before attribute"
 #endif
 
-Mu mu_ab __attribute__((acquired_before(mu1)));
+Mutex mu_ab ACQUIRED_BEFORE(mu1);
 
-Mu ab_var_noargs __attribute__((acquired_before)); // \
+Mutex ab_var_noargs __attribute__((acquired_before)); // \
   // expected-error {{attribute takes at least 1 argument}}
 
 class ABFoo {
  private:
-  Mu ab_field_noargs __attribute__((acquired_before)); // \
+  Mutex ab_field_noargs __attribute__((acquired_before)); // \
     // expected-error {{attribute takes at least 1 argument}}
-  Mu ab_field_args __attribute__((acquired_before(mu1)));
+  Mutex ab_field_args ACQUIRED_BEFORE(mu1);
 };
 
-class __attribute__((acquired_before(mu1))) AB { // \
+class ACQUIRED_BEFORE(mu1) AB { // \
   // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
 };
 
-void ab_function() __attribute__((acquired_before(mu1))); // \
+void ab_function() ACQUIRED_BEFORE(mu1); // \
   // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
 
-void ab_function_params(int gv_lvar __attribute__((acquired_before(mu1)))); // \
+void ab_function_params(int gv_lvar ACQUIRED_BEFORE(mu1)); // \
   // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
 
 void ab_testfn(int y){
-  Mu x __attribute__((acquired_before(mu1))) = Mu(); // \
+  Mutex x ACQUIRED_BEFORE(mu1) = Mutex(); // \
     // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
 }
 
-// Note: illegal int ab_int __attribute__((acquired_before(mu1))) will
+// Note: illegal int ab_int ACQUIRED_BEFORE(mu1) will
 // be taken care of by warnings that ab__int is not lockable.
 
 //Check argument parsing.
 
 // legal attribute arguments
-Mu ab_var_arg_1 __attribute__((acquired_before(muWrapper.mu)));
-Mu ab_var_arg_2 __attribute__((acquired_before(muDoubleWrapper.muWrapper->mu)));
-Mu ab_var_arg_3 __attribute__((acquired_before(muWrapper.getMu())));
-Mu ab_var_arg_4 __attribute__((acquired_before(*muWrapper.getMuPointer())));
-Mu ab_var_arg_5 __attribute__((acquired_before(&mu1)));
-Mu ab_var_arg_6 __attribute__((acquired_before(muRef)));
-Mu ab_var_arg_7 __attribute__((acquired_before(muDoubleWrapper.getWrapper()->getMu())));
-Mu ab_var_arg_8 __attribute__((acquired_before(muPointer)));
+Mutex ab_var_arg_1 ACQUIRED_BEFORE(muWrapper.mu);
+Mutex ab_var_arg_2 ACQUIRED_BEFORE(muDoubleWrapper.muWrapper->mu);
+Mutex ab_var_arg_3 ACQUIRED_BEFORE(muWrapper.getMu());
+Mutex ab_var_arg_4 ACQUIRED_BEFORE(*muWrapper.getMuPointer());
+Mutex ab_var_arg_5 ACQUIRED_BEFORE(&mu1);
+Mutex ab_var_arg_6 ACQUIRED_BEFORE(muRef);
+Mutex ab_var_arg_7 ACQUIRED_BEFORE(muDoubleWrapper.getWrapper()->getMu());
+Mutex ab_var_arg_8 ACQUIRED_BEFORE(muPointer);
 
 
 // illegal attribute arguments
-Mu ab_var_arg_bad_1 __attribute__((acquired_before(1))); // \
-  // expected-warning {{'acquired_before' attribute requires arguments that are class type or point to class type}}
-Mu ab_var_arg_bad_2 __attribute__((acquired_before("mu"))); // \
+Mutex ab_var_arg_bad_1 ACQUIRED_BEFORE(1); // \
   // expected-warning {{'acquired_before' attribute requires arguments that are class type or point to class type}}
-Mu ab_var_arg_bad_3 __attribute__((acquired_before(muDoublePointer))); // \
+Mutex ab_var_arg_bad_2 ACQUIRED_BEFORE("mu"); // \
+  // expected-warning {{ignoring 'acquired_before' attribute because its argument is invalid}}
+Mutex ab_var_arg_bad_3 ACQUIRED_BEFORE(muDoublePointer); // \
   // expected-warning {{'acquired_before' attribute requires arguments that are class type or point to class type}}
-Mu ab_var_arg_bad_4 __attribute__((acquired_before(umu))); // \
+Mutex ab_var_arg_bad_4 ACQUIRED_BEFORE(umu); // \
   // expected-warning {{'acquired_before' attribute requires arguments whose type is annotated with 'lockable' attribute}}
-UnlockableMu ab_var_arg_bad_5 __attribute__((acquired_before(mu_ab))); // \
+UnlockableMu ab_var_arg_bad_5 ACQUIRED_BEFORE(mu_ab); // \
   // expected-warning {{'acquired_before' attribute can only be applied in a context annotated with 'lockable' attribute}}
 
 
@@ -557,65 +557,65 @@
 
 // takes zero or more arguments, all locks (vars/fields)
 
-void elf_function() __attribute__((exclusive_lock_function));
+void elf_function() EXCLUSIVE_LOCK_FUNCTION();
 
-void elf_function_args() __attribute__((exclusive_lock_function(mu1, mu2)));
+void elf_function_args() EXCLUSIVE_LOCK_FUNCTION(mu1, mu2);
 
-int elf_testfn(int y) __attribute__((exclusive_lock_function));
+int elf_testfn(int y) EXCLUSIVE_LOCK_FUNCTION();
 
 int elf_testfn(int y) {
-  int x __attribute__((exclusive_lock_function)) = y; // \
+  int x EXCLUSIVE_LOCK_FUNCTION() = y; // \
     // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
   return x;
 };
 
-int elf_test_var __attribute__((exclusive_lock_function)); // \
+int elf_test_var EXCLUSIVE_LOCK_FUNCTION(); // \
   // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
 
 class ElfFoo {
  private:
-  int test_field __attribute__((exclusive_lock_function)); // \
+  int test_field EXCLUSIVE_LOCK_FUNCTION(); // \
     // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
-  void test_method() __attribute__((exclusive_lock_function));
+  void test_method() EXCLUSIVE_LOCK_FUNCTION();
 };
 
-class __attribute__((exclusive_lock_function)) ElfTestClass { // \
+class EXCLUSIVE_LOCK_FUNCTION() ElfTestClass { // \
   // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
 };
 
-void elf_fun_params(int lvar __attribute__((exclusive_lock_function))); // \
+void elf_fun_params(int lvar EXCLUSIVE_LOCK_FUNCTION()); // \
   // expected-warning {{'exclusive_lock_function' attribute only applies to functions and methods}}
 
 // Check argument parsing.
 
 // legal attribute arguments
-int elf_function_1() __attribute__((exclusive_lock_function(muWrapper.mu)));
-int elf_function_2() __attribute__((exclusive_lock_function(muDoubleWrapper.muWrapper->mu)));
-int elf_function_3() __attribute__((exclusive_lock_function(muWrapper.getMu())));
-int elf_function_4() __attribute__((exclusive_lock_function(*muWrapper.getMuPointer())));
-int elf_function_5() __attribute__((exclusive_lock_function(&mu1)));
-int elf_function_6() __attribute__((exclusive_lock_function(muRef)));
-int elf_function_7() __attribute__((exclusive_lock_function(muDoubleWrapper.getWrapper()->getMu())));
-int elf_function_8() __attribute__((exclusive_lock_function(muPointer)));
-int elf_function_9(Mu x) __attribute__((exclusive_lock_function(1)));
-int elf_function_9(Mu x, Mu y) __attribute__((exclusive_lock_function(1,2)));
+int elf_function_1() EXCLUSIVE_LOCK_FUNCTION(muWrapper.mu);
+int elf_function_2() EXCLUSIVE_LOCK_FUNCTION(muDoubleWrapper.muWrapper->mu);
+int elf_function_3() EXCLUSIVE_LOCK_FUNCTION(muWrapper.getMu());
+int elf_function_4() EXCLUSIVE_LOCK_FUNCTION(*muWrapper.getMuPointer());
+int elf_function_5() EXCLUSIVE_LOCK_FUNCTION(&mu1);
+int elf_function_6() EXCLUSIVE_LOCK_FUNCTION(muRef);
+int elf_function_7() EXCLUSIVE_LOCK_FUNCTION(muDoubleWrapper.getWrapper()->getMu());
+int elf_function_8() EXCLUSIVE_LOCK_FUNCTION(muPointer);
+int elf_function_9(Mutex x) EXCLUSIVE_LOCK_FUNCTION(1);
+int elf_function_9(Mutex x, Mutex y) EXCLUSIVE_LOCK_FUNCTION(1,2);
 
 
 // illegal attribute arguments
-int elf_function_bad_2() __attribute__((exclusive_lock_function("mu"))); // \
+int elf_function_bad_2() EXCLUSIVE_LOCK_FUNCTION("mu"); // \
+  // expected-warning {{ignoring 'exclusive_lock_function' attribute because its argument is invalid}}
+int elf_function_bad_3() EXCLUSIVE_LOCK_FUNCTION(muDoublePointer); // \
   // expected-warning {{'exclusive_lock_function' attribute requires arguments that are class type or point to class type}}
-int elf_function_bad_3() __attribute__((exclusive_lock_function(muDoublePointer))); // \
-  // expected-warning {{'exclusive_lock_function' attribute requires arguments that are class type or point to class type}}
-int elf_function_bad_4() __attribute__((exclusive_lock_function(umu))); // \
+int elf_function_bad_4() EXCLUSIVE_LOCK_FUNCTION(umu); // \
   // expected-warning {{'exclusive_lock_function' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
-int elf_function_bad_1() __attribute__((exclusive_lock_function(1))); // \
+int elf_function_bad_1() EXCLUSIVE_LOCK_FUNCTION(1); // \
   // expected-error {{'exclusive_lock_function' attribute parameter 1 is out of bounds: no parameters to index into}}
-int elf_function_bad_5(Mu x) __attribute__((exclusive_lock_function(0))); // \
+int elf_function_bad_5(Mutex x) EXCLUSIVE_LOCK_FUNCTION(0); // \
   // expected-error {{'exclusive_lock_function' attribute parameter 1 is out of bounds: can only be 1, since there is one parameter}}
-int elf_function_bad_6(Mu x, Mu y) __attribute__((exclusive_lock_function(0))); // \
+int elf_function_bad_6(Mutex x, Mutex y) EXCLUSIVE_LOCK_FUNCTION(0); // \
   // expected-error {{'exclusive_lock_function' attribute parameter 1 is out of bounds: must be between 1 and 2}}
-int elf_function_bad_7() __attribute__((exclusive_lock_function(0))); // \
+int elf_function_bad_7() EXCLUSIVE_LOCK_FUNCTION(0); // \
   // expected-error {{'exclusive_lock_function' attribute parameter 1 is out of bounds: no parameters to index into}}
 
 
@@ -629,65 +629,65 @@
 
 // takes zero or more arguments, all locks (vars/fields)
 
-void slf_function() __attribute__((shared_lock_function));
+void slf_function() SHARED_LOCK_FUNCTION();
 
-void slf_function_args() __attribute__((shared_lock_function(mu1, mu2)));
+void slf_function_args() SHARED_LOCK_FUNCTION(mu1, mu2);
 
-int slf_testfn(int y) __attribute__((shared_lock_function));
+int slf_testfn(int y) SHARED_LOCK_FUNCTION();
 
 int slf_testfn(int y) {
-  int x __attribute__((shared_lock_function)) = y; // \
+  int x SHARED_LOCK_FUNCTION() = y; // \
     // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
   return x;
 };
 
-int slf_test_var __attribute__((shared_lock_function)); // \
+int slf_test_var SHARED_LOCK_FUNCTION(); // \
   // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
 
-void slf_fun_params(int lvar __attribute__((shared_lock_function))); // \
+void slf_fun_params(int lvar SHARED_LOCK_FUNCTION()); // \
   // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
 
 class SlfFoo {
  private:
-  int test_field __attribute__((shared_lock_function)); // \
+  int test_field SHARED_LOCK_FUNCTION(); // \
     // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
-  void test_method() __attribute__((shared_lock_function));
+  void test_method() SHARED_LOCK_FUNCTION();
 };
 
-class __attribute__((shared_lock_function)) SlfTestClass { // \
+class SHARED_LOCK_FUNCTION() SlfTestClass { // \
   // expected-warning {{'shared_lock_function' attribute only applies to functions and methods}}
 };
 
 // Check argument parsing.
 
 // legal attribute arguments
-int slf_function_1() __attribute__((shared_lock_function(muWrapper.mu)));
-int slf_function_2() __attribute__((shared_lock_function(muDoubleWrapper.muWrapper->mu)));
-int slf_function_3() __attribute__((shared_lock_function(muWrapper.getMu())));
-int slf_function_4() __attribute__((shared_lock_function(*muWrapper.getMuPointer())));
-int slf_function_5() __attribute__((shared_lock_function(&mu1)));
-int slf_function_6() __attribute__((shared_lock_function(muRef)));
-int slf_function_7() __attribute__((shared_lock_function(muDoubleWrapper.getWrapper()->getMu())));
-int slf_function_8() __attribute__((shared_lock_function(muPointer)));
-int slf_function_9(Mu x) __attribute__((shared_lock_function(1)));
-int slf_function_9(Mu x, Mu y) __attribute__((shared_lock_function(1,2)));
+int slf_function_1() SHARED_LOCK_FUNCTION(muWrapper.mu);
+int slf_function_2() SHARED_LOCK_FUNCTION(muDoubleWrapper.muWrapper->mu);
+int slf_function_3() SHARED_LOCK_FUNCTION(muWrapper.getMu());
+int slf_function_4() SHARED_LOCK_FUNCTION(*muWrapper.getMuPointer());
+int slf_function_5() SHARED_LOCK_FUNCTION(&mu1);
+int slf_function_6() SHARED_LOCK_FUNCTION(muRef);
+int slf_function_7() SHARED_LOCK_FUNCTION(muDoubleWrapper.getWrapper()->getMu());
+int slf_function_8() SHARED_LOCK_FUNCTION(muPointer);
+int slf_function_9(Mutex x) SHARED_LOCK_FUNCTION(1);
+int slf_function_9(Mutex x, Mutex y) SHARED_LOCK_FUNCTION(1,2);
 
 
 // illegal attribute arguments
-int slf_function_bad_2() __attribute__((shared_lock_function("mu"))); // \
-  // expected-warning {{'shared_lock_function' attribute requires arguments that are class type or point to class type}}
-int slf_function_bad_3() __attribute__((shared_lock_function(muDoublePointer))); // \
+int slf_function_bad_2() SHARED_LOCK_FUNCTION("mu"); // \
+  // expected-warning {{ignoring 'shared_lock_function' attribute because its argument is invalid}}
+int slf_function_bad_3() SHARED_LOCK_FUNCTION(muDoublePointer); // \
   // expected-warning {{'shared_lock_function' attribute requires arguments that are class type or point to class type}}
-int slf_function_bad_4() __attribute__((shared_lock_function(umu))); // \
+int slf_function_bad_4() SHARED_LOCK_FUNCTION(umu); // \
   // expected-warning {{'shared_lock_function' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
-int slf_function_bad_1() __attribute__((shared_lock_function(1))); // \
+int slf_function_bad_1() SHARED_LOCK_FUNCTION(1); // \
   // expected-error {{'shared_lock_function' attribute parameter 1 is out of bounds: no parameters to index into}}
-int slf_function_bad_5(Mu x) __attribute__((shared_lock_function(0))); // \
+int slf_function_bad_5(Mutex x) SHARED_LOCK_FUNCTION(0); // \
   // expected-error {{'shared_lock_function' attribute parameter 1 is out of bounds: can only be 1, since there is one parameter}}
-int slf_function_bad_6(Mu x, Mu y) __attribute__((shared_lock_function(0))); // \
+int slf_function_bad_6(Mutex x, Mutex y) SHARED_LOCK_FUNCTION(0); // \
   // expected-error {{'shared_lock_function' attribute parameter 1 is out of bounds: must be between 1 and 2}}
-int slf_function_bad_7() __attribute__((shared_lock_function(0))); // \
+int slf_function_bad_7() SHARED_LOCK_FUNCTION(0); // \
   // expected-error {{'shared_lock_function' attribute parameter 1 is out of bounds: no parameters to index into}}
 
 
@@ -705,62 +705,62 @@
 void etf_function() __attribute__((exclusive_trylock_function));  // \
   // expected-error {{attribute takes at least 1 argument}}
 
-void etf_function_args() __attribute__((exclusive_trylock_function(1, mu2)));
+void etf_function_args() EXCLUSIVE_TRYLOCK_FUNCTION(1, mu2);
 
-void etf_function_arg() __attribute__((exclusive_trylock_function(1)));
+void etf_function_arg() EXCLUSIVE_TRYLOCK_FUNCTION(1);
 
-int etf_testfn(int y) __attribute__((exclusive_trylock_function(1)));
+int etf_testfn(int y) EXCLUSIVE_TRYLOCK_FUNCTION(1);
 
 int etf_testfn(int y) {
-  int x __attribute__((exclusive_trylock_function(1))) = y; // \
+  int x EXCLUSIVE_TRYLOCK_FUNCTION(1) = y; // \
     // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
   return x;
 };
 
-int etf_test_var __attribute__((exclusive_trylock_function(1))); // \
+int etf_test_var EXCLUSIVE_TRYLOCK_FUNCTION(1); // \
   // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
 
 class EtfFoo {
  private:
-  int test_field __attribute__((exclusive_trylock_function(1))); // \
+  int test_field EXCLUSIVE_TRYLOCK_FUNCTION(1); // \
     // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
-  void test_method() __attribute__((exclusive_trylock_function(1)));
+  void test_method() EXCLUSIVE_TRYLOCK_FUNCTION(1);
 };
 
-class __attribute__((exclusive_trylock_function(1))) EtfTestClass { // \
+class EXCLUSIVE_TRYLOCK_FUNCTION(1) EtfTestClass { // \
   // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
 };
 
-void etf_fun_params(int lvar __attribute__((exclusive_trylock_function(1)))); // \
+void etf_fun_params(int lvar EXCLUSIVE_TRYLOCK_FUNCTION(1)); // \
   // expected-warning {{'exclusive_trylock_function' attribute only applies to functions and methods}}
 
 // Check argument parsing.
 
 // legal attribute arguments
-int etf_function_1() __attribute__((exclusive_trylock_function(1, muWrapper.mu)));
-int etf_function_2() __attribute__((exclusive_trylock_function(1, muDoubleWrapper.muWrapper->mu)));
-int etf_function_3() __attribute__((exclusive_trylock_function(1, muWrapper.getMu())));
-int etf_function_4() __attribute__((exclusive_trylock_function(1, *muWrapper.getMuPointer())));
-int etf_function_5() __attribute__((exclusive_trylock_function(1, &mu1)));
-int etf_function_6() __attribute__((exclusive_trylock_function(1, muRef)));
-int etf_function_7() __attribute__((exclusive_trylock_function(1, muDoubleWrapper.getWrapper()->getMu())));
-int etf_functetfn_8() __attribute__((exclusive_trylock_function(1, muPointer)));
-int etf_function_9() __attribute__((exclusive_trylock_function(true)));
+int etf_function_1() EXCLUSIVE_TRYLOCK_FUNCTION(1, muWrapper.mu);
+int etf_function_2() EXCLUSIVE_TRYLOCK_FUNCTION(1, muDoubleWrapper.muWrapper->mu);
+int etf_function_3() EXCLUSIVE_TRYLOCK_FUNCTION(1, muWrapper.getMu());
+int etf_function_4() EXCLUSIVE_TRYLOCK_FUNCTION(1, *muWrapper.getMuPointer());
+int etf_function_5() EXCLUSIVE_TRYLOCK_FUNCTION(1, &mu1);
+int etf_function_6() EXCLUSIVE_TRYLOCK_FUNCTION(1, muRef);
+int etf_function_7() EXCLUSIVE_TRYLOCK_FUNCTION(1, muDoubleWrapper.getWrapper()->getMu());
+int etf_functetfn_8() EXCLUSIVE_TRYLOCK_FUNCTION(1, muPointer);
+int etf_function_9() EXCLUSIVE_TRYLOCK_FUNCTION(true);
 
 
 // illegal attribute arguments
-int etf_function_bad_1() __attribute__((exclusive_trylock_function(mu1))); // \
+int etf_function_bad_1() EXCLUSIVE_TRYLOCK_FUNCTION(mu1); // \
   // expected-error {{'exclusive_trylock_function' attribute first argument must be of int or bool type}}
-int etf_function_bad_2() __attribute__((exclusive_trylock_function("mu"))); // \
+int etf_function_bad_2() EXCLUSIVE_TRYLOCK_FUNCTION("mu"); // \
   // expected-error {{'exclusive_trylock_function' attribute first argument must be of int or bool type}}
-int etf_function_bad_3() __attribute__((exclusive_trylock_function(muDoublePointer))); // \
+int etf_function_bad_3() EXCLUSIVE_TRYLOCK_FUNCTION(muDoublePointer); // \
   // expected-error {{'exclusive_trylock_function' attribute first argument must be of int or bool type}}
 
-int etf_function_bad_4() __attribute__((exclusive_trylock_function(1, "mu"))); // \
+int etf_function_bad_4() EXCLUSIVE_TRYLOCK_FUNCTION(1, "mu"); // \
+  // expected-warning {{ignoring 'exclusive_trylock_function' attribute because its argument is invalid}}
+int etf_function_bad_5() EXCLUSIVE_TRYLOCK_FUNCTION(1, muDoublePointer); // \
   // expected-warning {{'exclusive_trylock_function' attribute requires arguments that are class type or point to class type}}
-int etf_function_bad_5() __attribute__((exclusive_trylock_function(1, muDoublePointer))); // \
-  // expected-warning {{'exclusive_trylock_function' attribute requires arguments that are class type or point to class type}}
-int etf_function_bad_6() __attribute__((exclusive_trylock_function(1, umu))); // \
+int etf_function_bad_6() EXCLUSIVE_TRYLOCK_FUNCTION(1, umu); // \
   // expected-warning {{'exclusive_trylock_function' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -778,63 +778,63 @@
 void stf_function() __attribute__((shared_trylock_function));  // \
   // expected-error {{attribute takes at least 1 argument}}
 
-void stf_function_args() __attribute__((shared_trylock_function(1, mu2)));
+void stf_function_args() SHARED_TRYLOCK_FUNCTION(1, mu2);
 
-void stf_function_arg() __attribute__((shared_trylock_function(1)));
+void stf_function_arg() SHARED_TRYLOCK_FUNCTION(1);
 
-int stf_testfn(int y) __attribute__((shared_trylock_function(1)));
+int stf_testfn(int y) SHARED_TRYLOCK_FUNCTION(1);
 
 int stf_testfn(int y) {
-  int x __attribute__((shared_trylock_function(1))) = y; // \
+  int x SHARED_TRYLOCK_FUNCTION(1) = y; // \
     // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
   return x;
 };
 
-int stf_test_var __attribute__((shared_trylock_function(1))); // \
+int stf_test_var SHARED_TRYLOCK_FUNCTION(1); // \
   // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
 
-void stf_fun_params(int lvar __attribute__((shared_trylock_function(1)))); // \
+void stf_fun_params(int lvar SHARED_TRYLOCK_FUNCTION(1)); // \
   // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
 
 
 class StfFoo {
  private:
-  int test_field __attribute__((shared_trylock_function(1))); // \
+  int test_field SHARED_TRYLOCK_FUNCTION(1); // \
     // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
-  void test_method() __attribute__((shared_trylock_function(1)));
+  void test_method() SHARED_TRYLOCK_FUNCTION(1);
 };
 
-class __attribute__((shared_trylock_function(1))) StfTestClass { // \
+class SHARED_TRYLOCK_FUNCTION(1) StfTestClass { // \
     // expected-warning {{'shared_trylock_function' attribute only applies to functions and methods}}
 };
 
 // Check argument parsing.
 
 // legal attribute arguments
-int stf_function_1() __attribute__((shared_trylock_function(1, muWrapper.mu)));
-int stf_function_2() __attribute__((shared_trylock_function(1, muDoubleWrapper.muWrapper->mu)));
-int stf_function_3() __attribute__((shared_trylock_function(1, muWrapper.getMu())));
-int stf_function_4() __attribute__((shared_trylock_function(1, *muWrapper.getMuPointer())));
-int stf_function_5() __attribute__((shared_trylock_function(1, &mu1)));
-int stf_function_6() __attribute__((shared_trylock_function(1, muRef)));
-int stf_function_7() __attribute__((shared_trylock_function(1, muDoubleWrapper.getWrapper()->getMu())));
-int stf_function_8() __attribute__((shared_trylock_function(1, muPointer)));
-int stf_function_9() __attribute__((shared_trylock_function(true)));
+int stf_function_1() SHARED_TRYLOCK_FUNCTION(1, muWrapper.mu);
+int stf_function_2() SHARED_TRYLOCK_FUNCTION(1, muDoubleWrapper.muWrapper->mu);
+int stf_function_3() SHARED_TRYLOCK_FUNCTION(1, muWrapper.getMu());
+int stf_function_4() SHARED_TRYLOCK_FUNCTION(1, *muWrapper.getMuPointer());
+int stf_function_5() SHARED_TRYLOCK_FUNCTION(1, &mu1);
+int stf_function_6() SHARED_TRYLOCK_FUNCTION(1, muRef);
+int stf_function_7() SHARED_TRYLOCK_FUNCTION(1, muDoubleWrapper.getWrapper()->getMu());
+int stf_function_8() SHARED_TRYLOCK_FUNCTION(1, muPointer);
+int stf_function_9() SHARED_TRYLOCK_FUNCTION(true);
 
 
 // illegal attribute arguments
-int stf_function_bad_1() __attribute__((shared_trylock_function(mu1))); // \
+int stf_function_bad_1() SHARED_TRYLOCK_FUNCTION(mu1); // \
   // expected-error {{'shared_trylock_function' attribute first argument must be of int or bool type}}
-int stf_function_bad_2() __attribute__((shared_trylock_function("mu"))); // \
+int stf_function_bad_2() SHARED_TRYLOCK_FUNCTION("mu"); // \
   // expected-error {{'shared_trylock_function' attribute first argument must be of int or bool type}}
-int stf_function_bad_3() __attribute__((shared_trylock_function(muDoublePointer))); // \
+int stf_function_bad_3() SHARED_TRYLOCK_FUNCTION(muDoublePointer); // \
   // expected-error {{'shared_trylock_function' attribute first argument must be of int or bool type}}
 
-int stf_function_bad_4() __attribute__((shared_trylock_function(1, "mu"))); // \
-  // expected-warning {{'shared_trylock_function' attribute requires arguments that are class type or point to class type}}
-int stf_function_bad_5() __attribute__((shared_trylock_function(1, muDoublePointer))); // \
+int stf_function_bad_4() SHARED_TRYLOCK_FUNCTION(1, "mu"); // \
+  // expected-warning {{ignoring 'shared_trylock_function' attribute because its argument is invalid}}
+int stf_function_bad_5() SHARED_TRYLOCK_FUNCTION(1, muDoublePointer); // \
   // expected-warning {{'shared_trylock_function' attribute requires arguments that are class type or point to class type}}
-int stf_function_bad_6() __attribute__((shared_trylock_function(1, umu))); // \
+int stf_function_bad_6() SHARED_TRYLOCK_FUNCTION(1, umu); // \
   // expected-warning {{'shared_trylock_function' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -848,65 +848,65 @@
 
 // takes zero or more arguments, all locks (vars/fields)
 
-void uf_function() __attribute__((unlock_function));
+void uf_function() UNLOCK_FUNCTION();
 
-void uf_function_args() __attribute__((unlock_function(mu1, mu2)));
+void uf_function_args() UNLOCK_FUNCTION(mu1, mu2);
 
-int uf_testfn(int y) __attribute__((unlock_function));
+int uf_testfn(int y) UNLOCK_FUNCTION();
 
 int uf_testfn(int y) {
-  int x __attribute__((unlock_function)) = y; // \
+  int x UNLOCK_FUNCTION() = y; // \
     // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
   return x;
 };
 
-int uf_test_var __attribute__((unlock_function)); // \
+int uf_test_var UNLOCK_FUNCTION(); // \
   // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
 
 class UfFoo {
  private:
-  int test_field __attribute__((unlock_function)); // \
+  int test_field UNLOCK_FUNCTION(); // \
     // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
-  void test_method() __attribute__((unlock_function));
+  void test_method() UNLOCK_FUNCTION();
 };
 
-class __attribute__((no_thread_safety_analysis)) UfTestClass { // \
+class NO_THREAD_SAFETY_ANALYSIS UfTestClass { // \
   // expected-warning {{'no_thread_safety_analysis' attribute only applies to functions and methods}}
 };
 
-void uf_fun_params(int lvar __attribute__((unlock_function))); // \
+void uf_fun_params(int lvar UNLOCK_FUNCTION()); // \
   // expected-warning {{'unlock_function' attribute only applies to functions and methods}}
 
 // Check argument parsing.
 
 // legal attribute arguments
-int uf_function_1() __attribute__((unlock_function(muWrapper.mu)));
-int uf_function_2() __attribute__((unlock_function(muDoubleWrapper.muWrapper->mu)));
-int uf_function_3() __attribute__((unlock_function(muWrapper.getMu())));
-int uf_function_4() __attribute__((unlock_function(*muWrapper.getMuPointer())));
-int uf_function_5() __attribute__((unlock_function(&mu1)));
-int uf_function_6() __attribute__((unlock_function(muRef)));
-int uf_function_7() __attribute__((unlock_function(muDoubleWrapper.getWrapper()->getMu())));
-int uf_function_8() __attribute__((unlock_function(muPointer)));
-int uf_function_9(Mu x) __attribute__((unlock_function(1)));
-int uf_function_9(Mu x, Mu y) __attribute__((unlock_function(1,2)));
+int uf_function_1() UNLOCK_FUNCTION(muWrapper.mu);
+int uf_function_2() UNLOCK_FUNCTION(muDoubleWrapper.muWrapper->mu);
+int uf_function_3() UNLOCK_FUNCTION(muWrapper.getMu());
+int uf_function_4() UNLOCK_FUNCTION(*muWrapper.getMuPointer());
+int uf_function_5() UNLOCK_FUNCTION(&mu1);
+int uf_function_6() UNLOCK_FUNCTION(muRef);
+int uf_function_7() UNLOCK_FUNCTION(muDoubleWrapper.getWrapper()->getMu());
+int uf_function_8() UNLOCK_FUNCTION(muPointer);
+int uf_function_9(Mutex x) UNLOCK_FUNCTION(1);
+int uf_function_9(Mutex x, Mutex y) UNLOCK_FUNCTION(1,2);
 
 
 // illegal attribute arguments
-int uf_function_bad_2() __attribute__((unlock_function("mu"))); // \
+int uf_function_bad_2() UNLOCK_FUNCTION("mu"); // \
+  // expected-warning {{ignoring 'unlock_function' attribute because its argument is invalid}}
+int uf_function_bad_3() UNLOCK_FUNCTION(muDoublePointer); // \
   // expected-warning {{'unlock_function' attribute requires arguments that are class type or point to class type}}
-int uf_function_bad_3() __attribute__((unlock_function(muDoublePointer))); // \
-  // expected-warning {{'unlock_function' attribute requires arguments that are class type or point to class type}}
-int uf_function_bad_4() __attribute__((unlock_function(umu))); // \
+int uf_function_bad_4() UNLOCK_FUNCTION(umu); // \
   // expected-warning {{'unlock_function' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
-int uf_function_bad_1() __attribute__((unlock_function(1))); // \
+int uf_function_bad_1() UNLOCK_FUNCTION(1); // \
   // expected-error {{'unlock_function' attribute parameter 1 is out of bounds: no parameters to index into}}
-int uf_function_bad_5(Mu x) __attribute__((unlock_function(0))); // \
+int uf_function_bad_5(Mutex x) UNLOCK_FUNCTION(0); // \
   // expected-error {{'unlock_function' attribute parameter 1 is out of bounds: can only be 1, since there is one parameter}}
-int uf_function_bad_6(Mu x, Mu y) __attribute__((unlock_function(0))); // \
+int uf_function_bad_6(Mutex x, Mutex y) UNLOCK_FUNCTION(0); // \
   // expected-error {{'unlock_function' attribute parameter 1 is out of bounds: must be between 1 and 2}}
-int uf_function_bad_7() __attribute__((unlock_function(0))); // \
+int uf_function_bad_7() UNLOCK_FUNCTION(0); // \
   // expected-error {{'unlock_function' attribute parameter 1 is out of bounds: no parameters to index into}}
 
 
@@ -923,57 +923,57 @@
 void lr_function() __attribute__((lock_returned)); // \
   // expected-error {{attribute takes one argument}}
 
-void lr_function_arg() __attribute__((lock_returned(mu1)));
+void lr_function_arg() LOCK_RETURNED(mu1);
 
 void lr_function_args() __attribute__((lock_returned(mu1, mu2))); // \
   // expected-error {{attribute takes one argument}}
 
-int lr_testfn(int y) __attribute__((lock_returned(mu1)));
+int lr_testfn(int y) LOCK_RETURNED(mu1);
 
 int lr_testfn(int y) {
-  int x __attribute__((lock_returned(mu1))) = y; // \
+  int x LOCK_RETURNED(mu1) = y; // \
     // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
   return x;
 };
 
-int lr_test_var __attribute__((lock_returned(mu1))); // \
+int lr_test_var LOCK_RETURNED(mu1); // \
   // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
 
-void lr_fun_params(int lvar __attribute__((lock_returned(mu1)))); // \
+void lr_fun_params(int lvar LOCK_RETURNED(mu1)); // \
   // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
 
 class LrFoo {
  private:
-  int test_field __attribute__((lock_returned(mu1))); // \
+  int test_field LOCK_RETURNED(mu1); // \
     // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
-  void test_method() __attribute__((lock_returned(mu1)));
+  void test_method() LOCK_RETURNED(mu1);
 };
 
-class __attribute__((lock_returned(mu1))) LrTestClass { // \
+class LOCK_RETURNED(mu1) LrTestClass { // \
     // expected-warning {{'lock_returned' attribute only applies to functions and methods}}
 };
 
 // Check argument parsing.
 
 // legal attribute arguments
-int lr_function_1() __attribute__((lock_returned(muWrapper.mu)));
-int lr_function_2() __attribute__((lock_returned(muDoubleWrapper.muWrapper->mu)));
-int lr_function_3() __attribute__((lock_returned(muWrapper.getMu())));
-int lr_function_4() __attribute__((lock_returned(*muWrapper.getMuPointer())));
-int lr_function_5() __attribute__((lock_returned(&mu1)));
-int lr_function_6() __attribute__((lock_returned(muRef)));
-int lr_function_7() __attribute__((lock_returned(muDoubleWrapper.getWrapper()->getMu())));
-int lr_function_8() __attribute__((lock_returned(muPointer)));
+int lr_function_1() LOCK_RETURNED(muWrapper.mu);
+int lr_function_2() LOCK_RETURNED(muDoubleWrapper.muWrapper->mu);
+int lr_function_3() LOCK_RETURNED(muWrapper.getMu());
+int lr_function_4() LOCK_RETURNED(*muWrapper.getMuPointer());
+int lr_function_5() LOCK_RETURNED(&mu1);
+int lr_function_6() LOCK_RETURNED(muRef);
+int lr_function_7() LOCK_RETURNED(muDoubleWrapper.getWrapper()->getMu());
+int lr_function_8() LOCK_RETURNED(muPointer);
 
 
 // illegal attribute arguments
-int lr_function_bad_1() __attribute__((lock_returned(1))); // \
+int lr_function_bad_1() LOCK_RETURNED(1); // \
   // expected-warning {{'lock_returned' attribute requires arguments that are class type or point to class type}}
-int lr_function_bad_2() __attribute__((lock_returned("mu"))); // \
+int lr_function_bad_2() LOCK_RETURNED("mu"); // \
   // expected-warning {{'lock_returned' attribute requires arguments that are class type or point to class type}}
-int lr_function_bad_3() __attribute__((lock_returned(muDoublePointer))); // \
+int lr_function_bad_3() LOCK_RETURNED(muDoublePointer); // \
   // expected-warning {{'lock_returned' attribute requires arguments that are class type or point to class type}}
-int lr_function_bad_4() __attribute__((lock_returned(umu))); // \
+int lr_function_bad_4() LOCK_RETURNED(umu); // \
   // expected-warning {{'lock_returned' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -991,56 +991,56 @@
 void le_function() __attribute__((locks_excluded)); // \
   // expected-error {{attribute takes at least 1 argument}}
 
-void le_function_arg() __attribute__((locks_excluded(mu1)));
+void le_function_arg() LOCKS_EXCLUDED(mu1);
 
-void le_function_args() __attribute__((locks_excluded(mu1, mu2)));
+void le_function_args() LOCKS_EXCLUDED(mu1, mu2);
 
-int le_testfn(int y) __attribute__((locks_excluded(mu1)));
+int le_testfn(int y) LOCKS_EXCLUDED(mu1);
 
 int le_testfn(int y) {
-  int x __attribute__((locks_excluded(mu1))) = y; // \
+  int x LOCKS_EXCLUDED(mu1) = y; // \
     // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
   return x;
 };
 
-int le_test_var __attribute__((locks_excluded(mu1))); // \
+int le_test_var LOCKS_EXCLUDED(mu1); // \
   // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
 
-void le_fun_params(int lvar __attribute__((locks_excluded(mu1)))); // \
+void le_fun_params(int lvar LOCKS_EXCLUDED(mu1)); // \
   // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
 
 class LeFoo {
  private:
-  int test_field __attribute__((locks_excluded(mu1))); // \
+  int test_field LOCKS_EXCLUDED(mu1); // \
     // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
-  void test_method() __attribute__((locks_excluded(mu1)));
+  void test_method() LOCKS_EXCLUDED(mu1);
 };
 
-class __attribute__((locks_excluded(mu1))) LeTestClass { // \
+class LOCKS_EXCLUDED(mu1) LeTestClass { // \
   // expected-warning {{'locks_excluded' attribute only applies to functions and methods}}
 };
 
 // Check argument parsing.
 
 // legal attribute arguments
-int le_function_1() __attribute__((locks_excluded(muWrapper.mu)));
-int le_function_2() __attribute__((locks_excluded(muDoubleWrapper.muWrapper->mu)));
-int le_function_3() __attribute__((locks_excluded(muWrapper.getMu())));
-int le_function_4() __attribute__((locks_excluded(*muWrapper.getMuPointer())));
-int le_function_5() __attribute__((locks_excluded(&mu1)));
-int le_function_6() __attribute__((locks_excluded(muRef)));
-int le_function_7() __attribute__((locks_excluded(muDoubleWrapper.getWrapper()->getMu())));
-int le_function_8() __attribute__((locks_excluded(muPointer)));
+int le_function_1() LOCKS_EXCLUDED(muWrapper.mu);
+int le_function_2() LOCKS_EXCLUDED(muDoubleWrapper.muWrapper->mu);
+int le_function_3() LOCKS_EXCLUDED(muWrapper.getMu());
+int le_function_4() LOCKS_EXCLUDED(*muWrapper.getMuPointer());
+int le_function_5() LOCKS_EXCLUDED(&mu1);
+int le_function_6() LOCKS_EXCLUDED(muRef);
+int le_function_7() LOCKS_EXCLUDED(muDoubleWrapper.getWrapper()->getMu());
+int le_function_8() LOCKS_EXCLUDED(muPointer);
 
 
 // illegal attribute arguments
-int le_function_bad_1() __attribute__((locks_excluded(1))); // \
-  // expected-warning {{'locks_excluded' attribute requires arguments that are class type or point to class type}}
-int le_function_bad_2() __attribute__((locks_excluded("mu"))); // \
+int le_function_bad_1() LOCKS_EXCLUDED(1); // \
   // expected-warning {{'locks_excluded' attribute requires arguments that are class type or point to class type}}
-int le_function_bad_3() __attribute__((locks_excluded(muDoublePointer))); // \
+int le_function_bad_2() LOCKS_EXCLUDED("mu"); // \
+  // expected-warning {{ignoring 'locks_excluded' attribute because its argument is invalid}}
+int le_function_bad_3() LOCKS_EXCLUDED(muDoublePointer); // \
   // expected-warning {{'locks_excluded' attribute requires arguments that are class type or point to class type}}
-int le_function_bad_4() __attribute__((locks_excluded(umu))); // \
+int le_function_bad_4() LOCKS_EXCLUDED(umu); // \
   // expected-warning {{'locks_excluded' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -1058,56 +1058,56 @@
 void elr_function() __attribute__((exclusive_locks_required)); // \
   // expected-error {{attribute takes at least 1 argument}}
 
-void elr_function_arg() __attribute__((exclusive_locks_required(mu1)));
+void elr_function_arg() EXCLUSIVE_LOCKS_REQUIRED(mu1);
 
-void elr_function_args() __attribute__((exclusive_locks_required(mu1, mu2)));
+void elr_function_args() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2);
 
-int elr_testfn(int y) __attribute__((exclusive_locks_required(mu1)));
+int elr_testfn(int y) EXCLUSIVE_LOCKS_REQUIRED(mu1);
 
 int elr_testfn(int y) {
-  int x __attribute__((exclusive_locks_required(mu1))) = y; // \
+  int x EXCLUSIVE_LOCKS_REQUIRED(mu1) = y; // \
     // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
   return x;
 };
 
-int elr_test_var __attribute__((exclusive_locks_required(mu1))); // \
+int elr_test_var EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
   // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
 
-void elr_fun_params(int lvar __attribute__((exclusive_locks_required(mu1)))); // \
+void elr_fun_params(int lvar EXCLUSIVE_LOCKS_REQUIRED(mu1)); // \
   // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
 
 class ElrFoo {
  private:
-  int test_field __attribute__((exclusive_locks_required(mu1))); // \
+  int test_field EXCLUSIVE_LOCKS_REQUIRED(mu1); // \
     // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
-  void test_method() __attribute__((exclusive_locks_required(mu1)));
+  void test_method() EXCLUSIVE_LOCKS_REQUIRED(mu1);
 };
 
-class __attribute__((exclusive_locks_required(mu1))) ElrTestClass { // \
+class EXCLUSIVE_LOCKS_REQUIRED(mu1) ElrTestClass { // \
   // expected-warning {{'exclusive_locks_required' attribute only applies to functions and methods}}
 };
 
 // Check argument parsing.
 
 // legal attribute arguments
-int elr_function_1() __attribute__((exclusive_locks_required(muWrapper.mu)));
-int elr_function_2() __attribute__((exclusive_locks_required(muDoubleWrapper.muWrapper->mu)));
-int elr_function_3() __attribute__((exclusive_locks_required(muWrapper.getMu())));
-int elr_function_4() __attribute__((exclusive_locks_required(*muWrapper.getMuPointer())));
-int elr_function_5() __attribute__((exclusive_locks_required(&mu1)));
-int elr_function_6() __attribute__((exclusive_locks_required(muRef)));
-int elr_function_7() __attribute__((exclusive_locks_required(muDoubleWrapper.getWrapper()->getMu())));
-int elr_function_8() __attribute__((exclusive_locks_required(muPointer)));
+int elr_function_1() EXCLUSIVE_LOCKS_REQUIRED(muWrapper.mu);
+int elr_function_2() EXCLUSIVE_LOCKS_REQUIRED(muDoubleWrapper.muWrapper->mu);
+int elr_function_3() EXCLUSIVE_LOCKS_REQUIRED(muWrapper.getMu());
+int elr_function_4() EXCLUSIVE_LOCKS_REQUIRED(*muWrapper.getMuPointer());
+int elr_function_5() EXCLUSIVE_LOCKS_REQUIRED(&mu1);
+int elr_function_6() EXCLUSIVE_LOCKS_REQUIRED(muRef);
+int elr_function_7() EXCLUSIVE_LOCKS_REQUIRED(muDoubleWrapper.getWrapper()->getMu());
+int elr_function_8() EXCLUSIVE_LOCKS_REQUIRED(muPointer);
 
 
 // illegal attribute arguments
-int elr_function_bad_1() __attribute__((exclusive_locks_required(1))); // \
+int elr_function_bad_1() EXCLUSIVE_LOCKS_REQUIRED(1); // \
   // expected-warning {{'exclusive_locks_required' attribute requires arguments that are class type or point to class type}}
-int elr_function_bad_2() __attribute__((exclusive_locks_required("mu"))); // \
+int elr_function_bad_2() EXCLUSIVE_LOCKS_REQUIRED("mu"); // \
+  // expected-warning {{ignoring 'exclusive_locks_required' attribute because its argument is invalid}}
+int elr_function_bad_3() EXCLUSIVE_LOCKS_REQUIRED(muDoublePointer); // \
   // expected-warning {{'exclusive_locks_required' attribute requires arguments that are class type or point to class type}}
-int elr_function_bad_3() __attribute__((exclusive_locks_required(muDoublePointer))); // \
-  // expected-warning {{'exclusive_locks_required' attribute requires arguments that are class type or point to class type}}
-int elr_function_bad_4() __attribute__((exclusive_locks_required(umu))); // \
+int elr_function_bad_4() EXCLUSIVE_LOCKS_REQUIRED(umu); // \
   // expected-warning {{'exclusive_locks_required' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -1126,56 +1126,56 @@
 void slr_function() __attribute__((shared_locks_required)); // \
   // expected-error {{attribute takes at least 1 argument}}
 
-void slr_function_arg() __attribute__((shared_locks_required(mu1)));
+void slr_function_arg() SHARED_LOCKS_REQUIRED(mu1);
 
-void slr_function_args() __attribute__((shared_locks_required(mu1, mu2)));
+void slr_function_args() SHARED_LOCKS_REQUIRED(mu1, mu2);
 
-int slr_testfn(int y) __attribute__((shared_locks_required(mu1)));
+int slr_testfn(int y) SHARED_LOCKS_REQUIRED(mu1);
 
 int slr_testfn(int y) {
-  int x __attribute__((shared_locks_required(mu1))) = y; // \
+  int x SHARED_LOCKS_REQUIRED(mu1) = y; // \
     // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
   return x;
 };
 
-int slr_test_var __attribute__((shared_locks_required(mu1))); // \
+int slr_test_var SHARED_LOCKS_REQUIRED(mu1); // \
   // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
 
-void slr_fun_params(int lvar __attribute__((shared_locks_required(mu1)))); // \
+void slr_fun_params(int lvar SHARED_LOCKS_REQUIRED(mu1)); // \
   // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
 
 class SlrFoo {
  private:
-  int test_field __attribute__((shared_locks_required(mu1))); // \
+  int test_field SHARED_LOCKS_REQUIRED(mu1); // \
     // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
-  void test_method() __attribute__((shared_locks_required(mu1)));
+  void test_method() SHARED_LOCKS_REQUIRED(mu1);
 };
 
-class __attribute__((shared_locks_required(mu1))) SlrTestClass { // \
+class SHARED_LOCKS_REQUIRED(mu1) SlrTestClass { // \
   // expected-warning {{'shared_locks_required' attribute only applies to functions and methods}}
 };
 
 // Check argument parsing.
 
 // legal attribute arguments
-int slr_function_1() __attribute__((shared_locks_required(muWrapper.mu)));
-int slr_function_2() __attribute__((shared_locks_required(muDoubleWrapper.muWrapper->mu)));
-int slr_function_3() __attribute__((shared_locks_required(muWrapper.getMu())));
-int slr_function_4() __attribute__((shared_locks_required(*muWrapper.getMuPointer())));
-int slr_function_5() __attribute__((shared_locks_required(&mu1)));
-int slr_function_6() __attribute__((shared_locks_required(muRef)));
-int slr_function_7() __attribute__((shared_locks_required(muDoubleWrapper.getWrapper()->getMu())));
-int slr_function_8() __attribute__((shared_locks_required(muPointer)));
+int slr_function_1() SHARED_LOCKS_REQUIRED(muWrapper.mu);
+int slr_function_2() SHARED_LOCKS_REQUIRED(muDoubleWrapper.muWrapper->mu);
+int slr_function_3() SHARED_LOCKS_REQUIRED(muWrapper.getMu());
+int slr_function_4() SHARED_LOCKS_REQUIRED(*muWrapper.getMuPointer());
+int slr_function_5() SHARED_LOCKS_REQUIRED(&mu1);
+int slr_function_6() SHARED_LOCKS_REQUIRED(muRef);
+int slr_function_7() SHARED_LOCKS_REQUIRED(muDoubleWrapper.getWrapper()->getMu());
+int slr_function_8() SHARED_LOCKS_REQUIRED(muPointer);
 
 
 // illegal attribute arguments
-int slr_function_bad_1() __attribute__((shared_locks_required(1))); // \
-  // expected-warning {{'shared_locks_required' attribute requires arguments that are class type or point to class type}}
-int slr_function_bad_2() __attribute__((shared_locks_required("mu"))); // \
+int slr_function_bad_1() SHARED_LOCKS_REQUIRED(1); // \
   // expected-warning {{'shared_locks_required' attribute requires arguments that are class type or point to class type}}
-int slr_function_bad_3() __attribute__((shared_locks_required(muDoublePointer))); // \
+int slr_function_bad_2() SHARED_LOCKS_REQUIRED("mu"); // \
+  // expected-warning {{ignoring 'shared_locks_required' attribute because its argument is invalid}}
+int slr_function_bad_3() SHARED_LOCKS_REQUIRED(muDoublePointer); // \
   // expected-warning {{'shared_locks_required' attribute requires arguments that are class type or point to class type}}
-int slr_function_bad_4() __attribute__((shared_locks_required(umu))); // \
+int slr_function_bad_4() SHARED_LOCKS_REQUIRED(umu); // \
   // expected-warning {{'shared_locks_required' attribute requires arguments whose type is annotated with 'lockable' attribute}}
 
 
@@ -1240,43 +1240,43 @@
 // Parsing of member variables and function parameters
 //------------------------------------------------------
 
-Mu gmu;
+Mutex gmu;
 
 class StaticMu {
-  static Mu statmu;
+  static Mutex statmu;
 };
 
 class FooLate {
 public:
-  void foo1()           __attribute__((exclusive_locks_required(gmu)))   { }
-  void foo2()           __attribute__((exclusive_locks_required(mu)))    { }
-  void foo3(Mu *m)      __attribute__((exclusive_locks_required(m)))     { }
-  void foo3(FooLate *f) __attribute__((exclusive_locks_required(f->mu))) { }
-  void foo4(FooLate *f) __attribute__((exclusive_locks_required(f->mu)));
+  void foo1()           EXCLUSIVE_LOCKS_REQUIRED(gmu)   { }
+  void foo2()           EXCLUSIVE_LOCKS_REQUIRED(mu)    { }
+  void foo3(Mutex *m)   EXCLUSIVE_LOCKS_REQUIRED(m)     { }
+  void foo3(FooLate *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu) { }
+  void foo4(FooLate *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu);
 
-  static void foo5()    __attribute__((exclusive_locks_required(mu))); // \
+  static void foo5()    EXCLUSIVE_LOCKS_REQUIRED(mu); // \
     // expected-error {{'this' cannot be implicitly used in a static member function declaration}}
 
   template <class T>
-  void foo6() __attribute__((exclusive_locks_required(T::statmu))) { }
+  void foo6() EXCLUSIVE_LOCKS_REQUIRED(T::statmu) { }
 
   template <class T>
-  void foo7(T* f) __attribute__((exclusive_locks_required(f->mu))) { }
+  void foo7(T* f) EXCLUSIVE_LOCKS_REQUIRED(f->mu) { }
 
-  int a __attribute__((guarded_by(gmu)));
-  int b __attribute__((guarded_by(mu)));
-  int c __attribute__((guarded_by(this->mu)));
+  int a GUARDED_BY(gmu);
+  int b GUARDED_BY(mu);
+  int c GUARDED_BY(this->mu);
 
-  Mu mu;
+  Mutex mu;
 };
 
 //-------------------------
 // Empty argument lists
 //-------------------------
 
-class __attribute__((lockable)) EmptyArgListsTest {
-  void lock() __attribute__((exclusive_lock_function())) { }
-  void unlock() __attribute__((unlock_function())) { }
+class LOCKABLE EmptyArgListsTest {
+  void lock() EXCLUSIVE_LOCK_FUNCTION() { }
+  void unlock() UNLOCK_FUNCTION() { }
 };
 
 
@@ -1285,7 +1285,7 @@
 
 class Foo {
 public:
-  Mu mu_;
+  Mutex mu_;
   void foo1();
   void foo2(Foo *f);
 };
@@ -1293,17 +1293,17 @@
 template <class T>
 class Bar {
 public:
-  Mu mu_;
+  Mutex mu_;
   void bar();
 };
 
-void Foo::foo1()       __attribute__((exclusive_locks_required(mu_))) { }
-void Foo::foo2(Foo *f) __attribute__((exclusive_locks_required(f->mu_))) { }
+void Foo::foo1()       EXCLUSIVE_LOCKS_REQUIRED(mu_) { }
+void Foo::foo2(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) { }
 
 template <class T>
-void Bar<T>::bar() __attribute__((exclusive_locks_required(mu_))) { }
+void Bar<T>::bar() EXCLUSIVE_LOCKS_REQUIRED(mu_) { }
 
-void baz(Foo *f) __attribute__((exclusive_locks_required(f->mu_))) { }
+void baz(Foo *f) EXCLUSIVE_LOCKS_REQUIRED(f->mu_) { }
 
 } // end namespace
 
@@ -1312,11 +1312,11 @@
 
 class Foo {
 public:
-  int __attribute__((guarded_by(mu_))) a;
-  int __attribute__((guarded_by(mu_))) b, c;
+  int GUARDED_BY(mu_) a;
+  int GUARDED_BY(mu_) b, c;
 
 private:
-  Mu mu_;
+  Mutex mu_;
 };
 
 
@@ -1331,15 +1331,60 @@
     void bar2(Bar* b) EXCLUSIVE_LOCKS_REQUIRED(b->mu)    { b->a = 0; }
     void bar3(Foo* f) EXCLUSIVE_LOCKS_REQUIRED(f->fooMu) { f->a = 0; }
 
-    Mu mu;
+    Mutex mu;
   };
 
   int a GUARDED_BY(fooMu);
-  Mu fooMu;
-  static Mu fooMuStatic;
+  Mutex fooMu;
+  static Mutex fooMuStatic;
+};
+
+}
+
+namespace PointerToMemberTest {
+
+// Empty string should be ignored.
+int  testEmptyAttribute GUARDED_BY("");
+void testEmptyAttributeFunction() EXCLUSIVE_LOCKS_REQUIRED("");
+
+class Graph {
+public:
+  Mutex mu_;
+};
+
+class Node {
+public:
+  void foo() EXCLUSIVE_LOCKS_REQUIRED(&Graph::mu_);
+  int a GUARDED_BY(&Graph::mu_);
+};
+
+}
+
+
+namespace SmartPointerTest {
+
+template<class T>
+class smart_ptr {
+ public:
+  smart_ptr(T* p) : ptr_(p) { };
+
+  T* operator->() { return ptr_; }
+  T& operator*()  { return ptr_; }
+
+ private:
+  T* ptr_;
+};
+
+
+class MyClass {
+public:
+  Mutex mu_;
+
+  smart_ptr<int> a PT_GUARDED_BY(mu_);
 };
 
 }
 
+
 } // end namespace TestMultiDecl
 

Propchange: cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 25 07:05:17 2012
@@ -1,2 +1,2 @@
 /cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-155108
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-155543

Modified: cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m (original)
+++ cfe/branches/tooling/test/SemaObjC/arc-property-lifetime.m Wed Apr 25 07:05:17 2012
@@ -168,3 +168,8 @@
         f.realy_strong_attr_prop = [[Baz alloc] init];
         f.implicit = [[Baz alloc] init];
 }
+
+// rdar://11253688
+ at interface Boom 
+ at property (readonly) const void * innerPointer __attribute__((objc_returns_inner_pointer)); // expected-error {{'objc_returns_inner_pointer' attribute only applies to methods}}
+ at end

Modified: cfe/branches/tooling/test/SemaObjC/attr-availability.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/attr-availability.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/attr-availability.m (original)
+++ cfe/branches/tooling/test/SemaObjC/attr-availability.m Wed Apr 25 07:05:17 2012
@@ -1,6 +1,11 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9.0.0 -fsyntax-only -verify %s
- at interface A
-- (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2)));
+
+ at protocol P
+- (void)proto_method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note 2 {{method 'proto_method' declared here}}
+ at end
+
+ at interface A <P>
+- (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{method 'method' declared here}}
 @end
 
 @interface B : A
@@ -10,4 +15,6 @@
 void f(A *a, B *b) {
   [a method]; // expected-warning{{'method' is deprecated: first deprecated in Mac OS X 10.2}}
   [b method];
+  [a proto_method]; // expected-warning{{'proto_method' is deprecated: first deprecated in Mac OS X 10.2}}
+  [b proto_method]; // expected-warning{{'proto_method' is deprecated: first deprecated in Mac OS X 10.2}}
 }

Modified: cfe/branches/tooling/test/SemaObjC/weak-receiver-warn.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/weak-receiver-warn.m?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/weak-receiver-warn.m (original)
+++ cfe/branches/tooling/test/SemaObjC/weak-receiver-warn.m Wed Apr 25 07:05:17 2012
@@ -17,3 +17,34 @@
   [weakx setBlock: ^{ [x actNow]; }]; // expected-warning {{weak receiver may be unpredictably null in ARC mode}}
   weakx.block = ^{ [x actNow]; };
 }
+
+ at interface Test
+{
+  __weak Test* weak_prop;
+}
+- (void) Meth;
+ at property  __weak Test* weak_prop; // expected-note {{property declared here}}
+ at property (weak, atomic) id weak_atomic_prop; // expected-note {{property declared here}}
+- (__weak id) P; // expected-note {{method 'P' declared here}}
+ at end
+
+ at implementation Test
+- (void) Meth {
+    if (self.weak_prop) {
+      self.weak_prop = 0;
+    }
+    if (self.weak_atomic_prop) {
+      self.weak_atomic_prop = 0;
+    }
+    [self.weak_prop Meth]; // expected-warning {{weak property may be unpredictably null in ARC mode}}
+    id pi = self.P;
+
+    [self.weak_atomic_prop Meth];  // expected-warning {{weak property may be unpredictably null in ARC mode}}
+
+    [self.P Meth];		   // expected-warning {{weak implicit property may be unpredictably null in ARC mode}}
+}
+
+- (__weak id) P { return 0; }
+ at dynamic weak_prop, weak_atomic_prop;
+ at end
+

Modified: cfe/branches/tooling/test/SemaObjCXX/ivar-construct.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjCXX/ivar-construct.mm?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjCXX/ivar-construct.mm (original)
+++ cfe/branches/tooling/test/SemaObjCXX/ivar-construct.mm Wed Apr 25 07:05:17 2012
@@ -27,3 +27,11 @@
 
 @implementation B
 @end
+
+// <rdar://problem/11284902>
+template<typename T> struct Incomplete; // expected-note{{declared here}}
+
+ at interface C {
+  Incomplete<int> a[4][4][4]; // expected-error{{implicit instantiation of undefined template 'Incomplete<int>'}}
+}
+ at end

Modified: cfe/branches/tooling/test/SemaTemplate/class-template-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/class-template-decl.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/class-template-decl.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/class-template-decl.cpp Wed Apr 25 07:05:17 2012
@@ -95,3 +95,45 @@
   };
 }
 
+namespace redecl {
+  int A; // expected-note {{here}}
+  template<typename T> struct A; // expected-error {{different kind of symbol}}
+
+  int B; // expected-note {{here}}
+  template<typename T> struct B { // expected-error {{different kind of symbol}}
+  };
+
+  template<typename T> struct F;
+  template<typename T> struct K;
+
+  int G, H; // expected-note {{here}}
+
+  struct S {
+    int C; // expected-note {{here}}
+    template<typename T> struct C; // expected-error {{different kind of symbol}}
+
+    int D; // expected-note {{here}}
+    template<typename T> struct D { // expected-error {{different kind of symbol}}
+    };
+
+    int E;
+    template<typename T> friend struct E { // expected-error {{cannot define a type in a friend}}
+    };
+
+    int F;
+    template<typename T> friend struct F; // ok, redecl::F
+
+    template<typename T> struct G; // ok
+
+    template<typename T> friend struct H; // expected-error {{different kind of symbol}}
+
+    int I, J, K;
+
+    struct U {
+      template<typename T> struct I; // ok
+      template<typename T> struct J { // ok
+      };
+      template<typename T> friend struct K; // ok, redecl::K
+    };
+  };
+}

Modified: cfe/branches/tooling/test/SemaTemplate/friend-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/friend-template.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/friend-template.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/friend-template.cpp Wed Apr 25 07:05:17 2012
@@ -243,3 +243,62 @@
   
   A<double>::B<double>  ab;
 }
+
+namespace RedeclUnrelated {
+  struct S {
+    int packaged_task;
+    template<typename> class future {
+      template<typename> friend class packaged_task;
+    };
+    future<void> share;
+  };
+}
+
+namespace PR12557 {
+  template <typename>
+  struct Foo;
+
+  template <typename Foo_>
+  struct Bar {
+    typedef Foo_  Foo; // expected-note {{previous}}
+
+    template <typename> friend struct Foo; // expected-error {{redefinition of 'Foo' as different kind of symbol}}
+  };
+
+  Bar<int> b;
+}
+
+namespace PR12585 {
+  struct A { };
+  template<typename> struct B {
+    template<typename> friend class A::does_not_exist; // \
+     // expected-error {{friend declaration of 'does_not_exist' does not match any declaration in 'PR12585::A'}}
+  };
+
+  struct C {
+    template<typename> struct D;
+  };
+  template<typename> class E {
+    int n;
+    template<typename> friend struct C::D;
+  };
+  template<typename T> struct C::D {
+    int f() {
+      return E<int>().n;
+    }
+  };
+  int n = C::D<void*>().f();
+
+  struct F {
+    template<int> struct G;
+  };
+  template<typename T> struct H {
+    // FIXME: As with cases above, the note here is on an unhelpful declaration,
+    // and should point to the declaration of G within F.
+    template<T> friend struct F::G; // \
+      // expected-error {{different type 'char' in template redeclaration}} \
+      // expected-note {{previous}}
+  };
+  H<int> h1; // ok
+  H<char> h2; // expected-note {{instantiation}}
+}

Modified: cfe/branches/tooling/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/driver/driver.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/driver/driver.cpp (original)
+++ cfe/branches/tooling/tools/driver/driver.cpp Wed Apr 25 07:05:17 2012
@@ -475,6 +475,10 @@
   if (C.get())
     Res = TheDriver.ExecuteCompilation(*C, FailingCommand);
 
+  // Force a crash to test the diagnostics.
+  if(::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH"))
+     Res = -1;
+
   // If result status is < 0, then the driver command signalled an error.
   // In this case, generate additional diagnostic information if possible.
   if (Res < 0)

Modified: cfe/branches/tooling/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CMakeLists.txt?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CMakeLists.txt (original)
+++ cfe/branches/tooling/tools/libclang/CMakeLists.txt Wed Apr 25 07:05:17 2012
@@ -61,7 +61,7 @@
 
   if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     set(LIBCLANG_LINK_FLAGS
-      "-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000")
+      "-Wl,-compatibility_version -Wl,1 -Wl,-dead_strip")
     set_target_properties(libclang
       PROPERTIES
       LINK_FLAGS "${LIBCLANG_LINK_FLAGS}"

Modified: cfe/branches/tooling/tools/libclang/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/Makefile?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/Makefile (original)
+++ cfe/branches/tooling/tools/libclang/Makefile Wed Apr 25 07:05:17 2012
@@ -24,7 +24,7 @@
 include $(CLANG_LEVEL)/Makefile
 
 # Add soname to the library.
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU))
         LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
 endif
 
@@ -42,7 +42,7 @@
     endif
 
     # Extra options to override libtool defaults.
-    LLVMLibsOptions += -Wl,-dead_strip -Wl,-seg1addr,0xE0000000 
+    LLVMLibsOptions += -Wl,-dead_strip
 
     # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
     DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')

Modified: cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp (original)
+++ cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp Wed Apr 25 07:05:17 2012
@@ -38,7 +38,6 @@
 
 protected:
   clang::ASTContext *Context;
-  clang::SourceManager *SM;
 
 private:
   class FindConsumer : public clang::ASTConsumer {
@@ -59,7 +58,6 @@
 
     virtual clang::ASTConsumer* CreateASTConsumer(
         clang::CompilerInstance& compiler, llvm::StringRef dummy) {
-      Visitor->SM = &compiler.getSourceManager();
       Visitor->Context = &compiler.getASTContext();
       /// TestConsumer will be deleted by the framework calling us.
       return new FindConsumer(Visitor);
@@ -108,6 +106,7 @@
         FullLocation.isValid() &&
         FullLocation.getSpellingLineNumber() == ExpectedLine &&
         FullLocation.getSpellingColumnNumber() == ExpectedColumn) {
+      EXPECT_TRUE(!Found);
       Found = true;
     } else if (Name == ExpectedMatch ||
                (FullLocation.isValid() &&
@@ -116,7 +115,7 @@
       // If we did not match, record information about partial matches.
       llvm::raw_string_ostream Stream(PartialMatches);
       Stream << ", partial match: \"" << Name << "\" at ";
-      Location.print(Stream, *this->SM);
+      Location.print(Stream, this->Context->getSourceManager());
     }
   }
 
@@ -159,6 +158,31 @@
   EXPECT_TRUE(Visitor.runOver("class X {}; class Y : public X {};"));
 }
 
+TEST(RecursiveASTVisitor, VisitsCXXBaseSpecifiersOfForwardDeclaredClass) {
+  TypeLocVisitor Visitor;
+  Visitor.ExpectMatch("class X", 3, 18);
+  EXPECT_TRUE(Visitor.runOver(
+    "class Y;\n"
+    "class X {};\n"
+    "class Y : public X {};"));
+}
+
+TEST(RecursiveASTVisitor, VisitsCXXBaseSpecifiersWithIncompleteInnerClass) {
+  TypeLocVisitor Visitor;
+  Visitor.ExpectMatch("class X", 2, 18);
+  EXPECT_TRUE(Visitor.runOver(
+    "class X {};\n"
+    "class Y : public X { class Z; };"));
+}
+
+TEST(RecursiveASTVisitor, VisitsCXXBaseSpecifiersOfSelfReferentialType) {
+  TypeLocVisitor Visitor;
+  Visitor.ExpectMatch("X<class Y>", 2, 18);
+  EXPECT_TRUE(Visitor.runOver(
+    "template<typename T> class X {};\n"
+    "class Y : public X<Y> {};"));
+}
+
 TEST(RecursiveASTVisitor, VisitsBaseClassTemplateArguments) {
   DeclRefExprVisitor Visitor;
   Visitor.ExpectMatch("x", 2, 3);
@@ -184,8 +208,7 @@
     "void foo() { y<Y>(Y()); }"));
 }
 
-/* FIXME:
-TEST(RecursiveASTVisitor, VisitsCallInNestedTemplateInstantiation) {
+TEST(RecursiveASTVisitor, VisitsCallInNestedFunctionTemplateInstantiation) {
   CXXMemberCallVisitor Visitor;
   Visitor.ExpectMatch("Y::x", 4, 5);
   EXPECT_TRUE(Visitor.runOver(
@@ -197,7 +220,24 @@
     "};\n"
     "void foo() { Z<Y>::f<int>(); }"));
 }
-*/
+
+TEST(RecursiveASTVisitor, VisitsCallInNestedClassTemplateInstantiation) {
+  CXXMemberCallVisitor Visitor;
+  Visitor.ExpectMatch("A::x", 5, 7);
+  EXPECT_TRUE(Visitor.runOver(
+    "template <typename T1> struct X {\n"
+    "  template <typename T2> struct Y {\n"
+    "    void f() {\n"
+    "      T2 y;\n"
+    "      y.x();\n"
+    "    }\n"
+    "  };\n"
+    "};\n"
+    "struct A { void x(); };\n"
+    "int main() {\n"
+    "  (new X<A>::Y<A>())->f();\n"
+    "}"));
+}
 
 /* FIXME: According to Richard Smith this is a bug in the AST.
 TEST(RecursiveASTVisitor, VisitsBaseClassTemplateArgumentsInInstantiation) {
@@ -212,4 +252,3 @@
 */
 
 } // end namespace clang
-

Modified: cfe/branches/tooling/utils/clang-completion-mode.el
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/clang-completion-mode.el?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/clang-completion-mode.el (original)
+++ cfe/branches/tooling/utils/clang-completion-mode.el Wed Apr 25 07:05:17 2012
@@ -95,7 +95,7 @@
     (delq nil
           (mapcar (lambda (x) (and (funcall condp x) x)) lst)))
 
-;; Determine whether 
+;; Determine whether FIXME: explain better
 (defun is-completion-line (line)
   (or (string-match "OVERLOAD:" line)
       (string-match (concat "COMPLETION: " clang-completion-substring) line)))
@@ -105,14 +105,14 @@
          (completion-lines (filter 'is-completion-line all-lines)))
     (if (consp completion-lines)
         (progn
-         ;; Erase the process buffer
+         ;; Erase the process buffer.
          (let ((cur (current-buffer)))
            (set-buffer buffer)
            (goto-char (point-min))
            (erase-buffer)
            (set-buffer cur))
          
-         ;; Display the process buffer
+         ;; Display the process buffer.
          (display-buffer buffer)
          
          ;; Insert the code-completion string into the process buffer.
@@ -120,7 +120,7 @@
            (insert (mapconcat 'identity completion-lines "\n")))
          ))))
 
-;; Process "sentinal" that, on successful code completion, replaces the 
+;; Process "sentinel" that, on successful code completion, replaces the 
 ;; contents of the code-completion buffer with the new code-completion results
 ;; and ensures that the buffer is visible.
 (defun clang-completion-sentinel (proc event)
@@ -128,14 +128,14 @@
          (completion-lines (filter 'is-completion-line all-lines)))
     (if (consp completion-lines)
         (progn
-         ;; Erase the process buffer
+         ;; Erase the process buffer.
          (let ((cur (current-buffer)))
            (set-buffer (process-buffer proc))
            (goto-char (point-min))
            (erase-buffer)
            (set-buffer cur))
          
-         ;; Display the process buffer
+         ;; Display the process buffer.
          (display-buffer (process-buffer proc))
          
          ;; Insert the code-completion string into the process buffer.
@@ -159,7 +159,7 @@
                              `("-code-completion-at" ,cc-point)
                              (list (buffer-file-name))))
          (cc-buffer-name (concat "*Clang Completion for " (buffer-name) "*")))
-    ;; Start the code-completion process
+    ;; Start the code-completion process.
     (if (buffer-file-name)
         (progn
           ;; If there is already a code-completion process, kill it first.

Modified: cfe/branches/tooling/utils/clangVisualizers.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/clangVisualizers.txt?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/utils/clangVisualizers.txt (original)
+++ cfe/branches/tooling/utils/clangVisualizers.txt Wed Apr 25 07:05:17 2012
@@ -27,6 +27,32 @@
 	)
 }
 
+llvm::SmallVectorImpl<*>{
+	preview (
+		#(
+			"[",
+			($T1*)$e.EndX - ($T1*)$e.BeginX,
+			"](",
+			#array(
+				expr: (($T1*)$e.BeginX)[$i],
+				size: ($T1*)$e.EndX - ($T1*)$e.BeginX
+			),
+			")"
+		)
+	)
+
+	children (
+		#(
+			#([size] : ($T1*)$e.EndX - ($T1*)$e.BeginX),
+			#([capacity] : ($T1*)$e.CapacityX - ($T1*)$e.BeginX),
+			#array(
+				expr: (($T1*)$e.BeginX)[$i],
+				size: ($T1*)$e.EndX - ($T1*)$e.BeginX
+			)
+		)
+	)
+}
+
 llvm::StringRef{
 	preview ([$e.Data,s])
 	stringview ([$e.Data,sb])

Modified: cfe/branches/tooling/www/comparison.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/comparison.html?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/www/comparison.html (original)
+++ cfe/branches/tooling/www/comparison.html Wed Apr 25 07:05:17 2012
@@ -50,8 +50,6 @@
     <ul>
     <li>GCC supports languages that clang does not aim to, such as Java, Ada,
         FORTRAN, etc.</li>
-    <li>GCC has a few <a href="cxx_status.html">C++'11 features</a> that Clang
-        does not yet support.</li>
     <li>GCC supports more targets than LLVM.</li>
     <li>GCC is popular and widely adopted.</li>
     <li>GCC does not require a C++ compiler to build it.</li>

Modified: cfe/branches/tooling/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/cxx_status.html?rev=155545&r1=155544&r2=155545&view=diff
==============================================================================
--- cfe/branches/tooling/www/cxx_status.html (original)
+++ cfe/branches/tooling/www/cxx_status.html Wed Apr 25 07:05:17 2012
@@ -83,7 +83,7 @@
     <tr>
       <td>Initializer lists</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm">N2672</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Static assertions</td>
@@ -113,7 +113,7 @@
     <tr>
       <td>Lambda expressions</td>
       <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf">N2927</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Declared type of an expression</td>
@@ -123,7 +123,7 @@
     <tr>
       <td>    Incomplete return types</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">N3276</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Right angle brackets</td>
@@ -164,7 +164,7 @@
       <td>Forward declarations for enums</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf">N2764</a>
       <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1206">DR1206</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Generalized attributes</td>
@@ -174,7 +174,7 @@
     <tr>
       <td>Generalized constant expressions</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">N2235</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Alignment support</td>
@@ -216,12 +216,12 @@
     <tr>
       <td>Universal character names in literals</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html">N2170</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>User-defined literals</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">N2765</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Standard Layout Types</td>
@@ -247,7 +247,7 @@
       <td>Extending <code>sizeof</code></td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html">N2253</a>
       <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#850">DR850</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Inline namespaces</td>
@@ -257,7 +257,7 @@
     <tr>
       <td>Unrestricted unions</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Local and unnamed types as template arguments</td>
@@ -303,17 +303,17 @@
     <tr>
       <td>Atomic operations</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html">N2427</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Strong Compare and Exchange</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2748.html">N2748</a></td>
-      <td class="none" align="center">No</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Bidirectional Fences</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm">N2752</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
 
     <tr>
@@ -339,7 +339,7 @@
     <tr>
       <td>Allow atomics use in signal handlers</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm">N2547</a></td>
-      <td class="svn" align="center">SVN</td>
+      <td class="svn" align="center">Clang 3.1</td>
     </tr>
     <tr>
       <td>Thread-local storage</td>





More information about the llvm-branch-commits mailing list