Showing posts with label LLVM. Show all posts
Showing posts with label LLVM. Show all posts

Wednesday, April 06, 2011

WWDC2010 Session313 LLVM Technologies in Depth

This session covers: Clang in Xcode 4 (Code completion, Fix-it, Indexing and Edit-all-in-scope), Clients of LLVM(LLDB, Integrated assembler).

Using Clang Inside Xcode 4

Many contents have been covered in Session 312. Just more examples.

Benefits of LLDB Design

Higher fidelity expression parsing and evaluation

Support all language constructs

     Inline function, template instantiation   

     Debugger gets new language features

Less platform specific knowledge in the debugger

Can pull in other compiler features: Fix-it, code completion

Assembler

LLVM Compiler 2.0 have an integrated assembler. We need not generate .s file and parse big text files. It saves much time.

LLVM assembler

Benefits of LLVM Integrated Assembler:

10% f aster builds (for debug builds of many applications)

Better error messages for inline assembly

More useful assembly dumps

WWDC2010 Session313 LLVM Technologies in Depth

Author: Ted Kremenek - Manager, Compiler Frontend Team

Tuesday, April 05, 2011

WWDC2010 Session312 What's New in the LLVM Compiler

LLVM stands for Low Level Virtual Machine which is a compiler infrastructure, written in C++. The LLVM project started in 2000 at the University of Illinois at Urbana-Champaign, under the direction of Vikram Adve and Chris Lattner. In late 2000, Lattner joined the University of Illinois at Urbana-Champaign as a research assistant and M.Sc. student. Lattner was hired by Apple in 2005.

Compiler Landscape

Three compilers

3 compilers

LLVM Compiler in Xcode 3.2.3 does not support C++. You have to use LLVM-GCC for C++ in Xcode 3.2.3. Now LLVM Compiler 2.0 in Xcode 4 supports C++. That is why the default compiler of Xcode 4 is LLVM Compiler. GCC 4.2 is not recommended because Apple will not fix bugs any more.

WebKit, JavaScriptCore, OpenSSL are built with LLVM in iOS 4. Performance improvement: Open SSL 28%, JavaScriptCore 11%.

LLVM Compiler:

1. Fast compile times - Almost 3x faster debug builds

2. Great user features

3. Beautiful error messages

4. compatible with GCC

Clang Frontend is a parser for C family of languages including C, Objective-C, C++.

Clang is part of many great new tools: LLVM Compiler, Xcode Static Analyzer, Xcode 4, LLDB Debugger, OpenCL. Clang is integrated into Xcode 4 for source code indexing, syntax highlighting, code completion, live warnings and Fix-its.

Xcode Static Analyzer
Automatically find bugs by analyzing your code.