Lably
Skip to content

Clang

Compiler front-end

  • 5 min read
  • 5 chapters

Related on Lably

Through Compiler, Free and open-source software and Software license

Clang operates in tandem with the LLVM compiler back end and has been a subproject of LLVM 2.6 and later. As with LLVM, it is free and open-source software under the Apache 2.0 software license. Its contributors include Apple, IBM, Microsoft, Google, ARM, Sony, Intel and AMD.

Clang 22 has full support for all published C++ standards up to C++17, implements most features of C++20 and C++23, and has initial support for the C++26 standard. Since v16.0.0, Clang compiles C++ using the GNU++17 dialect by default, which includes features from the C++17 standard and conforming GNU extensions.

Background

In 2005, Apple Inc. made extensive use of LLVM in several commercial products, including the iOS SDK and Xcode 3.1. An OpenGL code compiler for OS X that converts OpenGL calls into more fundamental calls for graphics processing units (GPU) that do not support certain features was one of the first uses of LLVM. This enabled Apple to support OpenGL on computers using Intel GMA chipsets, increasing performance on those machines.

The LLVM project originally intended to use GCC's front end. The GCC source code, however, is large and somewhat cumbersome; as one long-time GCC developer put it, referring to LLVM, "Trying to make the hippo dance is not really a lot of fun." Besides, Apple software uses Objective-C, which is a low priority for GCC developers. As such, GCC does not integrate smoothly into Apple's integrated development environment. Finally, GCC's license agreement, the GNU General Public License (GPL) version 3, requires developers who distribute extensions or modified versions of GCC to make their source code available, but LLVM's permissive software license doesn't require this.

For these reasons, Apple developed Clang, a new compiler front end which supports C, Objective-C and C++. In July 2007, the project received the approval for becoming open-source.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Computing and communication