Slashdot Mirror


LLVM and Clang 3.4 Are Out

An anonymous reader writes that the LLVM compiler framework and Clang C++ compiler hit 3.4 "With C++14 draft fully implemented in Clang and libc++. Read more in LLVM and Clang release notes." Also of note: "This is expected to be the last release of LLVM which compiles using a C++98 toolchain. We expect to start using some C++11 features in LLVM and other sub-projects starting after this release. That said, we are committed to supporting a reasonable set of modern C++ toolchains as the host compiler on all of the platforms. This will at least include Visual Studio 2012 on Windows, and Clang 3.1 or GCC 4.7.x on Mac and Linux. The final set of compilers (and the C++11 features they support) is not set in stone, but we wanted users of LLVM to have a heads up that the next release will involve a substantial change in the host toolchain requirements."

17 of 118 comments (clear)

  1. pretty quick on the C++14 support by Trepidity · · Score: 3, Interesting

    Does that make it the first compiler with full draft C++14 support? GCC is making progress but not there yet.

    1. Re:pretty quick on the C++14 support by Trepidity · · Score: 3, Insightful

      From a technical perspective I like LLVM, but I don't get the appeal of your 2nd point. Why should I work for free on a project in order to enable companies to make proprietary extensions to it that they won't release back to the community? The GPL makes me more willing to contribute to projects, because it ensures that everyone plays fair, so to speak: I'm adding my contributions, and if you find the results valuable and extend my work, you should do likewise.

    2. Re:pretty quick on the C++14 support by serviscope_minor · · Score: 5, Interesting

      Yet another good readon for everyone to drop GCC and move on to the future. GCC is obsolete in pretty much every aspect,

      Pure FUD. Who the hell modded this up. It's just plain trolling. GCC and LLVM are neck and neck, with GCC winning in the quality of the optimizer. I've also had compiler crashes much more recently with LLVM than with GCC, so it seems that GCC is also somewhat more battle hardened.


      and the non-permissive license makes it hard to use for other purposes than simple command-line compilation compared to LLVM which can be integrated in many different products.

      Only if you want to make your other tool non-free. Otherwise GCC works just fine.

      --
      SJW n. One who posts facts.
    3. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 4, Insightful

      The BSD folks tend to argue that things work out in the end anyway. Useful contributions find their way back, and when they don't then at least someone got some good code out of it. There are few exceptions, in general you can't force anyone to contribute back. Very few projects are that good. The only thing you achieve is that your code is used in less places.

    4. Re:pretty quick on the C++14 support by jandrese · · Score: 4, Interesting

      He's referring to integrating the compiler into your IDE. GCC makes this intentionally difficult, which is a big reason why there is no Visual Studio equivalent system that uses GCC. CLANG/LLVM is designed much more openly and should allow developers to really reach (and exceed) feature parity with Visual Studio.

      --

      I read the internet for the articles.
    5. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 3, Informative

      Only if you want to make your other tool non-free. Otherwise GCC works just fine.

      You don't have to go as far as non-free. Projects that are non-GPLv3+ can't easily integrate with it. Even free software projects would benefit if GCC was at least LGPL since that allows code linking.

    6. Re:pretty quick on the C++14 support by jandrese · · Score: 4, Informative

      What they can't do is micro-compile snippets of code to find errors, do auto-completion, etc...

      I'll let the clang guys explain it better.

      --

      I read the internet for the articles.
    7. Re:pretty quick on the C++14 support by gnasher719 · · Score: 3, Informative

      I'm sure it was Apple that stopped Apple from contributing to GCC. I'm thankful that they contributed to LLVM by developing Clang, but it was entirely their own choice to not contribute to GCC after 4.2.1.

      It was an intentional change in the license that made it impossible for Apple to do some of the things they wanted to do.

    8. Re:pretty quick on the C++14 support by Above · · Score: 5, Insightful

      There actually is a good reason.

      Let's say a company invents a proprietary bit of silicon, and wants a compiler for it. They may likely chose one that requires them not to spill the beans on their proprietary hardware in the process. So yes, it's true, you don't get the benefit of their "special sauce", but you were never going to get it anyway, so there is no loss.

      However, that same company now has a lot of people using the code. It takes time and money to track separate changes, so if they find a bug in code not specific to their proprietary stuff they are likely to fix it, and submit it upstream so they don't have to maintain it going forward. That code will benefit you.

      So basically, the people who find the GPL odious will never use gcc, and will find some alternative. Given those people have fully closed options (license Intel's compiler, or Microsoft's), or use something like LLVM. With the LLVM model they can submit fixes to their non-secret sauce upstream, as well as get others to help fix problems they find in the non-secret sauce part.

      TL;DL, if you choose gcc or LLVM you're never getting their secret sauce, but if you choose LLVM you get more help on the non-secret sauce parts.

      That is the real essence of the "BSD License" philosophy. You may or may not agree.

    9. Re:pretty quick on the C++14 support by am+2k · · Score: 5, Informative

      Huh? QCreator, Netbeans and Eclipse C/C++ IDEs are fully integrated with GCC, including both debugging and compilation.

      What Xcode can do is integrate llvm with autocompletion. For example, if you do a switch statement on an enum-value, it autocompletes the possible enum constants after you type "case". After the first entry, it automatically removes the constants you already used from the list of possibilities.

      Xcode also does perfect autocompletion (method names, parameter types, etc.) of types derived from C++ templates, which simply isn't possible without compiling the file. This even works as you change the same file those templates are declared in.

      Other things include the analyzer, which tells you about issues that arise on certain input conditions. When you click on an issue, Xcode visually displays the flow through the program to arrive at the undesired end result using arrows.

    10. Re:pretty quick on the C++14 support by HeckRuler · · Score: 4, Insightful

      Ah yes, all those people running BSD... All those people.
      Which, hey, if you include Apples OSX, is a hell of a lot of people. So yes, let us bask in all that effort that Apple has done for the open source community.

      Very few [open/free] projects are that good.

      Well with that sort of QUANTITY, you can't expect them all to be stellar.

      The only thing you achieve is that your code is used in less places.

      But those are places that you can actually use rather than the proprietary walled garden constrictive license which make for the sort of thing where you don't actually own the things you own. It also makes for a platform which is dead in the water and has no legs. And it's usually expensive.

      I don't care if a few businessmen shy away from the code I throw out there under an free license. They most certainly wouldn't have helped me.

    11. Re:pretty quick on the C++14 support by jo_ham · · Score: 3, Insightful

      A free software license does not limit what you can do with the code. For all intents and purposes Apple could have released their code under GPLv3+ and they would have been fine. I totally understand why they choose not to do that, but it was Apples choice to do it; they could have done different if they really, really, really wanted to.

      And then shipped it together as a bundle with Xcode? The GPLv3 specifically prevents them doing that, and it was deliberately written that way. The GPLv3 absolutely limits what you can do with that code. It is a very restrictively and carefully written licence in certain very key areas (not that this is necessarily a bad thing if you want such a thing - and there are valid reasons for it existing).

      So, no Apple couldn't have done that "if they really wanted to", without making the whole of Xcode open source.

      That's not really "choice" and "freedom" is it? That's what this comes down to - the GPL protects the freedom of the *code* whereas the BSD licence protects the freedom of the *users and/or developers* of that code.

    12. Re: pretty quick on the C++14 support by Bill_the_Engineer · · Score: 3, Insightful

      The problem with your argument being that Apple sponsors the clang and llvm project. I'm sure they put in more money than you, and we still enjoy the use of the BSD code.

      --
      These comments are my own and do not necessarily reflect the views or opinions of my employer or colleagues...
    13. Re:pretty quick on the C++14 support by peppepz · · Score: 3, Informative

      Please update your FUD. GCC has supported a plugin architecture since 2010. You can use any GPL-compatible license for your plugin. This includes BSD, and in fact, there's a LLVM plugin for gcc.

    14. Re:pretty quick on the C++14 support by phantomfive · · Score: 3, Interesting

      And then shipped it together as a bundle with Xcode? The GPLv3 specifically prevents them doing that, and it was deliberately written that way.

      Wait, how does GPLv3 prevent them from shipping it in a bundle with Xcode? I'm pretty sure that's allowed under GPL3, but Apple didn't like the patent clauses.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:pretty quick on the C++14 support by postmortem · · Score: 3, Informative
  2. Code Completion? Static Analysis? by glennrrr · · Score: 4, Informative

    What's the code-completion situation in GCC these days, or the static analyzer situation? (I don't know.) Apple went with Clang at least in part because of not being able to get those features out of GCC without making Xcode GPL3 compliant, but I'd guess that an IDE with a compatible license might have a better shot at getting that information out of GCC. Code completion and static analysis are 2 of the great features of Xcode; I wouldn't want to go back to tools that didn't have either.