Tag / Clang

  • March 8, 2016 - Daniel Kolesa

    Embrace C++14 in Your Project

    I recently wrote a series on the benefits of the C++11 spec. However, C++14 is a newer specification that has been out for a while and adds a few more exciting language features. Clang 3.8 was recently released, and this marks a stable implementation of C++14 in my opinion. In the past I’ve encountered some nasty bugs while implementing new features, preventing me from actually using them. This is no longer the case in version 3.8 and it therefore seem to be fairly safe. In terms of other C++ toolchains, the 5.x series of GCC cover C++14 pretty well, and MS Visual Studio offers partial support in their own compiler with full support coming soon through the officially supported Clang compiler. Let’s take a look at some of the new features that make this version great. Variable Templates In my opinion, variable templates are the single most important C++14 feature. […]

    Read More
  • October 13, 2015 - Daniel Kolesa

    Some Final Thoughts on C++11

    This article is part 4 of a 4 part series on the benefits of the C++11 revision of the C++ programming language. The previous three articles in this series introduced readers to C++11 toolchains and some of the biggest features this revision of C++ provides. This article covers a handful of minor features that are still quite valuable for anyone writing software in C++11 including range-based for loops, initializer lists, null pointer constants, strongly typed enumerations, static asserts, user defined literals and more. Finally, this article closes with an introduction to a personal project of mine that makes a handful of things in C++11 easier. Other improvements There are quite a few features of C++11 that are worth mentioning, even if they don’t warrant as detailed an entry as the last two articles in this series. Range-based for Loop There is now a new for loop syntax for iterating over […]

    Read More
  • August 18, 2015 - Daniel Kolesa

    Introduction to C++11 Toolchains

    This article is part 1 of a 4 part series on the benefits of the C++11 revision of the C++ programming language The C++11 standard has been with us for quite a while, but it hasn’t yet gained traction as significantly as one might expect. It’s a shame as there are many reasons to utilize C++11 features, and the toolchain support is pretty good, especially on Unix-like systems with Windows finally catching up. I decided to write a series of articles to advertise the benefits of C++11 and provide an explanation of some of the new features. I found various resources on the web that are quite misleading, so I feel it is important to clarify some things. This article will focus on three of the popular toolchains used for compiling C++ programs. Toolchain Coverage C++11 toolchain support seems to be pretty good. These are the main three compilers most […]

    Read More
  • June 17, 2015 - Tilmann Scheller

    A Conclusion to Accelerating Your Build with Clang

    This is the second part of a series that explores improving the build process using Clang. This post will take a look at the remaining methods for speeding up the build and will conclude with an overall summary of the improved speeds. To read an introduction to this experiment as well as the build system we are using, take a look at part one of this series. Here is our list of ideas again: Generic: Build with Clang rather than GCC Use a faster linker, such as GNU gold Optimize our host compiler binary aggressively (LTO, PGO, LTO+PGO) Move parts of the debug info into separate files: split DWARF Use Ninja rather than GNU make in CMake-based projects Cache object files with ccache Use a shared library build instead of a static build for incremental debug builds Clang/LLVM-specific: Optimize TableGen for debug builds Build less: e.g. build only the backends we […]

    Read More
  • Building software is a time-consuming task, especially if you are working on large codebases such as Clang and LLVM (2.5M C++ lines combined). As an LLVM developer, a significant portion of my time is spent building the software because a clean build take several minutes to complete. The work outlined in this series started out as an experiment to see by how much we could speed up the build process by using different tools or build settings rather than simply upgrading our hardware, and the goal is to squeeze as much performance out of the toolchain as possible. The focus is on building Clang/LLVM, however most of the results and corresponding suggestions will apply to other large C++ projects as well, and this post expands on a lightning talk I recently gave at the EuroLLVM 2015 conference. Taking a Look at the Options So what can we actually do to speed up […]

    Read More