Using Clang from SVN in Xcode

In my free time, I work on the Clang open source project, mostly on the static analyzer. This is the backend behind Xcode’s wonderful “Analyze” tool, which catches path-sensitive problems like memory leaks and then shows you the path where the leak happens.

Using custom builds of the analyzer in Xcode has always been fairly easy with the set-xcode-analyzer tool, distributed with packaged builds of the checker or hidden in the tools/scan-build directory in the Clang source repository. But what if you want to use a custom build as your compiler?…say, to play with Automatic Reference Counting (which …

Automatic Reference Counting

In the Cocoa world, the big news from WWDC is the advent of Automatic Reference Counting, or ARC. The only real documentation for the system is an unlinked reference page on the Clang website, but as Clang is open source and the implementation’s in the latest builds now, that counts as public information.

The Cocoa frameworks have long used a reference-count-based system, but as of Mac OS X v10.5, Apple added optional garbage collection. As with most GC systems, you can mark certain references as __weak (which automatically become nil when their target is collected), and the actual collection of…

Possibly Related Tags