Current support for C++11 features in mainstream compilers

Source: Internet
Author: User
Tags lua

Current support for C++11 features in mainstream compilers

1. GCC compiler (fully supported from compiler gcc4.8.x version)

(1) The current C++11 feature, which has previously become a c++0x feature, is supported incrementally from the subsequent release of GCC4.3.

(2) from the official information can be seen, the current from the full c++11 feature support is from the compiler gcc4.8.x version.

Reference URL: https://gcc.gnu.org/projects/cxx-status.html#cxx112.  The Clang compiler Clang is a C + + compiler based on LLVM, published under the LLVM BSD license, and its goal (one) is to go beyond GCC. April 2013,Clang has fully supported the c++11 standardand start implementing the C++1Y feature (that is, c++14, which is the next small update version of C + +).  3. The compiler msvc:vs2013 provided by VS provides most of the support for C++11, VS2015, which provides almost all c++11 support. Reference URL:VS2015 features in preview version of C++11/14/17https://blogs.msdn.microsoft.com/c/2015/01/29/vs2015c111417/ Integrated development Environment Scenario 1. Xcode Xcode is an integrated development tool (IDE) that runs on operating system Mac OS X, developed by Apple Inc.  Xcode has a unified user interface design, coding, testing, debugging is done in a simple window.  Latest Version Xcode7. The compiler used by XCODE3 is the GCC compiler, and after Xcode4 and version, the compiler used by Xcode has been replaced with the new LLVM compiler.  The front end of the LLVM compiler is clang.  LLVM is the framework of the architecture compiler (compiler), 2006 Chris Lattner joined Apple Inc. and is committed to LLVM's application in the Apple development system.  In 2005 Apple hired Chris LATTNER,LLVM to be the official Apple-supported compiler.  Apple has used it for pipelining optimization in OpenCL, and Xcode has been able to compile code using LLVM-GCC. 2011-12-02 LLVM3.0 was released, LLVM included a series of sub-projects, and they also released new versions synchronously, such as C/c++/objective-c front-end Clang 3.0 Improved C + + program compilation support; improved C + + 2011 Standard Support  Implement some of the features that support the forthcoming C1X standard, faster generation of code, faster compilation. The compiler that comes with Xcode. 2. vs201x Compiler comparison

1. Clang Development for a reason

Apple uses LLVM to generate code (JIT) on a GPU that does not support all OpenGL features (Intel low-end graphics), so that the program still works. The integration process of LLVM and GCC then caused some unhappiness, and the GCC system was bulky and cumbersome, while Apple's heavily used objective-c had a low priority in GCC. In addition, GCC, as a purely compiled system, is poorly matched to the IDE. In addition to licensing requirements, Apple cannot use the modified version of GCC as a closed source. So Apple decided to write from scratch the front end of C family, which is based on the LLVM Clang.

Features of the Clang:

    • Fast: By compiling carbon.h tests for almost all C header files on OS X, including preprocessing (Preprocess), Syntax (Lex), parsing (parse), semantic parsing (Semantic analysis), abstract syntax tree generation Syntax Tree) Time, Clang is Apple GCC 4.0 2.5x fast. (2007-7-25)
    • Memory footprint is small: Clang memory footprint is the source of 130%,apple GCC is more than 10x.
    • Diagnostic information is readable: I do not typesetting, recommend to visit the site. The syntax of the error is not only the source code hints, but also in the wrong call and the relevant context below the ~~~~~ and ^ hints, compared to the GCC hints are heavenly.
    • GCC compatibility.
    • The design is clear, simple, easy to understand and easy to expand and enhance. The learning curve is gentle compared to the old code-based GCC.
    • Library-based modular design for easy IDE integration and reuse of other uses. For historical reasons, GCC is a single executable compiler that has completed all the processes from preprocessing to final code generation, and many of the information in the middle is not reused by other programs. Clang the compilation process into separate phases, and the AST information can be serialized. With the support of the library, the program is able to obtain information at the AST level, which greatly enhances the ability to manipulate the code. For the IDE, code completion, refactoring is an important function, but if there is no underlying support, only using tags analysis or regular expression matching is difficult to achieve

2. GCC also has its advantages:

    • Support Java/ada/fortran
    • The current Clang C + + support lags behind GCC, see http://clang.llvm.org/cxx_status.html. (recently Clang has been able to self-compile, see HTTP://WWW.PHORONIX.COM/SCAN.PHP?PAGE=NEWS_ITEM&PX=NZK2MW)
    • GCC supports more platforms
    • GCC is more popular and widely used to support complete
    • GCC-based C, no C + + compiler is required to compile

In addition to Clang, LLVM is also used for JIT optimization in Gallium3D, Pixman in Xorg also consider using LLVM to optimize execution speed, Llvm-lua use LLVM to compile LUA code, gpuocelot use LLV M can enable CUDA programs to run on multicore x86cpu, IBM cells, OpenCL-enabled devices without recompiling ...

Current support for C++11 features in mainstream compilers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.