Clang

from Wikipedia, the free encyclopedia
Clang

DragonFull.png
Basic data

Maintainer Chris Lattner
developer The LLVM team
Current  version 10.0.0
( March 24, 2020 )
operating system Unix , GNU / Linux , Windows , macOS , and others
programming language C ++
category Compiler front end
License Apache License 2.0 ( Free Software )
clang.llvm.org

Clang [ klæŋ ] is a compiler frontend for the programming languages C , C ++ , Objective-C and Objective-C ++ . Compared to other compiler front ends, it has more extensive and more precise static and dynamic analysis methods that make troubleshooting easier. In addition, it enables faster translations of the source texts with less memory consumption and, as a result, often smaller executable programs . Clang was developed as a frontend for the compiler backend LLVM ; Thanks to the modular structure of Clang, its components can also be integrated into other products.

Clang is subject to a BSD-like license . In contrast to the GNU General Public License , the more liberal BSD license does not require you to disclose all the source texts of programs that use Clang or parts of it, which is often of interest, especially for proprietary products.

Use of the compiler

The Clang development project is closely linked to the LLVM project. It was developed as a replacement for the GCC compiler front end. Since September 2009, Clang has officially been considered stable and productive, and with LLVM Version 2.6 it is an integral part of the LLVM compiler package. From version 2.7 the programming language C ++ is officially supported. However, Clang can also be used without LLVM as a purely static program analysis and error diagnosis tool, for example when used with other compilers.

From version 3.0 the LLVM project no longer supports the GCC compiler, but requires Clang or, alternatively, the Dragonegg plug-in . On May 12, 2012, the FreeBSD project announced the switch to Clang instead of GCC as the standard compiler from version 10.0 of the operating system.

On the Apple Macintosh and since October 2014 also on Linux , Clang is the standard compiler for Google Chrome . For static code analysis, Clang is integrated into Apple's Xcode development environment for the programming languages ​​C, Objective-C and C ++.

Comparison with GCC

In addition to GCC , Clang is a compiler that is often used in the open source environment. It differs from GCC in both technical and licensing terms.

One advantage of Clang over GCC is its modularity. Thanks to its modularity, Clang is better than GCC in other programs such as B. reusable integrated development environments .

The BSD-like license makes it easier to publish Clang together with other software as a complete package.

Clang is in some cases faster than gcc or g ++ in processing syntax and machine code generation. The total time saved, however, depends very much on the scenario. Especially under Linux conditions, this is often not as high as, for example, in environments and tasks typical for Apple systems.

Version numbers

The version numbers at LLVM and Clang usually increase by one decimal place every six months. Since June 2010, Clang has always had the same version number as the associated LLVM. The LLVM and Clang version numbers in Apple's integrated development environment Xcode correspond in turn to different ones, namely on branches created by Apple with their own version numbers (e.g. clang-700.0.72 based on LLVM 3.7.0), into which Apple also backports of bug fixes newer versions can be incorporated.

History and relationship of version numbering:

LLVM Clang Xcode
2.6 1.0 1.0
2.7 1.1 1.5
2.8 2.8 1.6
2.9 2.9 1.7
3.0 3.0 2.0
3.1 3.1 3.0
3.2 3.2 4.2
3.3 3.3 (clang-500.2.75) 5.0
3.4 3.4 (clang-503.0.38) 5.1
3.5 3.5 (clang-600.0.51) 6.0.1
3.6 3.6 (clang-602.0.53) 6.4
3.7 3.7 (clang-700.0.72) 7.0
3.8 3.8 (clang-703.0.29) 7.3

Emergence

On July 11, 2007, Clang was released under an open source license.

At the BSDCan 2008 conference , Clang was presented by LLVM project manager Chris Lattner as part of the lecture LLVM and Clang: Next Generation Compiler Technology . Afterwards, at the Apple developer conference Worldwide Developers Conference 2009, Clang was presented by the lectures of Chris Lattner and the developers Doug Gregor and Ted Kremenek.

In February 2012, Clang was also presented at the Microsoft developer conference Going Native 2012 as part of a lecture .

Individual evidence

  1. The LLVM Compiler Infrastructure Project (English) - official website
  2. "Written by The LLVM Team" (below the FAQ list )
  3. LLVM 10.0.0 release . March 24, 2020 (accessed March 24, 2020).
  4. Download LLVM releases . March 24, 2020 (accessed March 24, 2020).
  5. Eric Christopher: [LLVMdev] simply wonder pronunciation of clang. (No longer available online.) In: LLVMdev mailing list. July 3, 2008, archived from the original on February 8, 2012 ; accessed on May 11, 2020 (English): "We've been pronouncing it kl"
  6. clang.llvm.org Official presence of Clang
  7. LLVM 2.6 release! ( Memento of the original from January 11, 2012 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. (English) - Reported to lists.cs.uiuc.edu , from October 23, 2009 @1@ 2Template: Webachiv / IABot / lists.cs.uiuc.edu
  8. clang: a C language family frontend for LLVM (English) - project page at LLVM ; Status: October 18, 2010
  9. Expressive Diagnostics (English) - page at LLVM ; As of November 27, 2009
  10. LLVM 3.0 separates from GCC
  11. FreeBSD Quarterly Status Report January-March, 2012
  12. FreeBSD wants Clang to be the default compiler
  13. LLVM Project Blog: Using clang for Chrome production builds on Linux
  14. Clang as the standard compiler for Chrome on Macintosh
  15. Running the analyzer within Xcode.Retrieved September 20, 2019.
  16. clang.llvm.org - Clang vs GCC
  17. ^ FYI: Version number change (English) - Contribution to Clang Developers , June 25, 2010
  18. Xcode clang version record (English) - Manually maintained list of XCode clang versions in XCode
  19. Xcode Version Information - XCode build and version numbers
  20. bsdcan.org
  21. llvm.org (PDF)
  22. ^ Compiler State of the Union
  23. State of Clang (Video) (MOV file; 268.69 MB)