Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLVM C++ IDE for Windows

Is there some C/C++ IDE for Windows, which is integrated with the LLVM compiler (and Clang C/C++ analyzer), just like modern Xcode do.

I have Dev-Cpp (it uses outdated GCC) and Code::Blocks (with some GCC). But GCC gives me very cryptic error messages. I want to get some more user-friendly error messages from the Clang frontend.

Yes, Clang was not able to be used with complex C++ code, but trunk Clang already can compile LLVM itself. So I wonder if is there any of LLVM IDEs in development or in beta versions.

Yes, I can use Clang as other compiler with GCC-compatible IDEs. But is there any IDE, that are integrated with Clang? Clang have a different output format, so the IDE must parse it. Clang can provide IDE parsing of sources. Clang has an analyze option, which must be supported in an IDE. Take a look, e.g http://iosdevelopertips.com/xcode/static-code-analysis-clang-and-xcode-3-2.html

And the most wanted feature of Clang - is smart auto-completion, so the IDE can suggest only syntaxilly-correct variants, e.g. list only fields of this struct, class.

Results: (merged from answers):

  • Eclipse with CDT>=8 and with https://code.google.com/archive/p/llvm4eclipsecdt/ plugin, from Petri Tuononen (no smart auto-completion)
  • Vim with vimrc from the LLVM project (smart completion only?) https://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/
  • Emacs with (smart completion only?) https://llvm.org/svn/llvm-project/cfe/trunk/utils/clang-completion-mode.el
  • Qt Creator: https://blog.qt.io/blog/2011/10/19/qt-creator-and-clang/
  • CodeLite: http://www.codelite.org/LiteEditor/ClangIntegration35
like image 914
osgx Avatar asked Mar 21 '10 17:03

osgx


People also ask

Can you use LLVM on Windows?

LLVM fully supports the COFF object file format, which is compatible with all other existing Windows toolchains.

Does C use LLVM?

LLVM currently supports compiling of Ada, C, C++, D, Delphi, Fortran, Haskell, Julia, Objective-C, Rust, and Swift using various front ends.

What is Windows LLVM?

The first piece is the LLVM suite. This contains all of the tools, libraries, and header files needed to use LLVM. It contains an assembler, disassembler, bitcode analyzer and bitcode optimizer. It also contains basic regression tests that can be used to test the LLVM tools and the Clang front end.

Does Visual Studio use LLVM?

Starting in Visual Studio 2019 version 16.9, you can set a custom toolset version for LLVM. To set this property in a project in Visual Studio: Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.


1 Answers

LLVM is supported in Eclipse CDT via plug-in (llvm4eclipsecdt). It is the only Windows supported IDE supporting LLVM as far as I know. I am the main author of the plug-in so you can ask any questions related to it.

The plug-in offers the basic functionality for Clang and llvm-gcc compilation and support Linux and Windows (w/ Cygwin & MiNGW). LLVM tools such as assembler, archiver, linker, and static compiler (llc) are configured and can be customized via UI. The plug-in offers all the benefits that IDE can offer such as easy configuration and building with one action.

The only drawback is that it is not ready yet as it lacks of some of the advanced features that LLVM can offer such as Clang analyze and smart auto-completion. The plug-in is also not tested well and may not work perfectly therefore I hope I can get user feedback via mailing list found from Google code development site (listed below). I wish I had time to develop it further. I only develop it in my spare time, which is very limited. I welcome any developers to participate and contribute to the project.

Development site:
http://code.google.com/p/llvm4eclipsecdt/
https://github.com/TuononenP/llvm4eclipsecdt

Eclipse marketplace (100% free & open-source):
http://marketplace.eclipse.org/content/llvm-toolchain-eclipse-cdt

UPDATE: The plugin is deprecated. Instead install "C/C++ LLVM-Family Compiler Build Support" under Programming Languages using the official Eclipse update site e.g. http://download.eclipse.org/releases/mars

like image 162
Petri Tuononen Avatar answered Sep 20 '22 12:09

Petri Tuononen