1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-20 06:35:50 +02:00

Update and integrate LLVM documentation

The LLVM MBS toolchain plugin help is integrated into the CDT Getting
Started guide. The 'Emit LLVM IR' tool option is documented and disabled
by default. Instances of "MacOS X" in MBS toolchain display strings are
replaced with "macOS".
This commit is contained in:
John Dallaway 2025-08-15 14:37:07 +01:00
parent 9d9d71e184
commit cce2876d6b
13 changed files with 59 additions and 72 deletions

View file

@ -2140,8 +2140,9 @@ For macOS Sierra (10.12), there seems to be additional problems with GDB
that might make it unusable, see the [GDB bug that might make it unusable, see the [GDB bug
report](https://sourceware.org/bugzilla/show_bug.cgi?id=20266). report](https://sourceware.org/bugzilla/show_bug.cgi?id=20266).
GDB does not support local macOS application debugging on Apple silicon > [!NOTE]
(AArch64) at present. It is necessary to use the LLDB debugger instead. > GDB does not support local macOS application debugging on Apple silicon
> (AArch64) at present. It is necessary to use the LLDB debugger instead.
#### How do I get the LLDB debugger? #### How do I get the LLDB debugger?
@ -2209,7 +2210,7 @@ with
#### How do I install the LLDB debugger integration? #### How do I install the LLDB debugger integration?
1. Go to Help \> Install new Software 1. Go to Help > Install new Software
2. Select the CDT update site (9.1 or greater) 2. Select the CDT update site (9.1 or greater)
3. Under **CDT Optional Features**, select **C/C++ LLDB Debugger 3. Under **CDT Optional Features**, select **C/C++ LLDB Debugger
Integration** Integration**
@ -2359,8 +2360,8 @@ setvbuf(stderr, NULL, _IONBF, 0);
CDT does not come with a compiler, so if you do not have one you will CDT does not come with a compiler, so if you do not have one you will
need to install one. Follows are options available to you: need to install one. Follows are options available to you:
- macOS: Install Xcode from the App Store or from Apple Developer web - macOS: Install the _Xcode Command Line Tools_ from the App Store or
site. from Apple Developer web site.
- Linux: If not already installed, it should be available in your - Linux: If not already installed, it should be available in your
distribution's package system on your installation CDs. distribution's package system on your installation CDs.

View file

@ -28,9 +28,9 @@ TargetName.gnu.lib=Gnu Static Library
TargetName.cygw.exe=Cygwin Executable TargetName.cygw.exe=Cygwin Executable
TargetName.cygw.so=Cygwin DLL TargetName.cygw.so=Cygwin DLL
TargetName.cygw.lib=Cygwin Library TargetName.cygw.lib=Cygwin Library
TargetName.macosx.exe=MacOS X Executable TargetName.macosx.exe=macOS Executable
TargetName.macosx.so=MacOS X Shared Library TargetName.macosx.so=macOS Shared Library
TargetName.macosx.lib=MacOS X Static Library TargetName.macosx.lib=macOS Static Library
TargetName.solaris.exe=Solaris Gnu Executable TargetName.solaris.exe=Solaris Gnu Executable
TargetName.solaris.so=Solaris Gnu Shared Library TargetName.solaris.so=Solaris Gnu Shared Library
TargetName.solaris.lib=Solaris Gnu Static Library TargetName.solaris.lib=Solaris Gnu Static Library
@ -57,7 +57,7 @@ ToolChainName.Dbg=GCC Tool Chain
ToolChainName.Linux=Linux GCC ToolChainName.Linux=Linux GCC
ToolChainName.Cygwin=Cygwin GCC ToolChainName.Cygwin=Cygwin GCC
ToolChainName.MinGW=MinGW GCC ToolChainName.MinGW=MinGW GCC
ToolChainName.Macosx=MacOSX GCC ToolChainName.Macosx=macOS GCC
ToolChainName.Solaris=Solaris GCC ToolChainName.Solaris=Solaris GCC
# Generic platform names # Generic platform names
@ -96,8 +96,8 @@ ToolName.linker.mingw.gnu.c=MinGW C Linker
ToolName.linker.mingw.gnu.cpp=MinGW C++ Linker ToolName.linker.mingw.gnu.cpp=MinGW C++ Linker
# Mach-O tool names # Mach-O tool names
ToolName.linker.macosx.c = MacOS X C Linker ToolName.linker.macosx.c = macOS C Linker
ToolName.linker.macosx.cpp = MacOS X C++ Linker ToolName.linker.macosx.cpp = macOS C++ Linker
#Solaris tool names #Solaris tool names
ToolName.compiler.solaris.c = Solaris C Compiler ToolName.compiler.solaris.c = Solaris C Compiler

View file

@ -32,7 +32,6 @@ bin.includes = about.html,\
reference/,\ reference/,\
tasks/,\ tasks/,\
toc.xml,\ toc.xml,\
toc_LLVM.xml,\
topics_Concepts.xml,\ topics_Concepts.xml,\
topics_Getting_Started.xml,\ topics_Getting_Started.xml,\
topics_Reference.xml,\ topics_Reference.xml,\

View file

@ -14,10 +14,6 @@
file="toc.xml" file="toc.xml"
primary="true"> primary="true">
</toc> </toc>
<toc
file="toc_LLVM.xml"
primary="true">
</toc>
<index path="index"/> <index path="index"/>
</extension> </extension>

View file

@ -246,7 +246,7 @@
<para>For Linux, select "Linux GCC"</para> <para>For Linux, select "Linux GCC"</para>
</listitem> </listitem>
<listitem> <listitem>
<para>For Mac OS X, select "MacOSX GCC"</para> <para>For macOS, select "macOS GCC"</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Do not use "Cross GCC"! Unfortunately this option may be <para>Do not use "Cross GCC"! Unfortunately this option may be

View file

@ -43,3 +43,5 @@ xref:cdt_w_build.adoc[Building a project]
xref:cdt_w_debug.adoc[Debugging a project] xref:cdt_w_debug.adoc[Debugging a project]
xref:cdt_w_existing_code.adoc[Importing your C/{cpp} source files into Eclipse] xref:cdt_w_existing_code.adoc[Importing your C/{cpp} source files into Eclipse]
xref:../llvm/user_manual.adoc[LLVM with Clang/GCC for Eclipse CDT]

View file

@ -30,15 +30,15 @@ endif::[]
== General information == General information
LLVM with Clang/GCC for Eclipse CDT plug-in provides LLVM toolchain with The LLVM with Clang/GCC for Eclipse CDT plug-in integrates an LLVM toolchain using
Clang or llvm-gcc compiler to compile C/(cpp} programs. the Clang or llvm-gcc compiler with the CDT managed build system to compile C/(cpp} programs.
http://www.llvm.org[LLVM] is a rather modern toolchain that supports the http://www.llvm.org[LLVM] is a modern toolchain that supports the
compilation of C/(cpp} code (among others) to LLVM virtual machine's compilation of C/(cpp} code (among others) to LLVM virtual machine's
_bitcode_, which in turn can be compiled to each platform's native _bitcode_, which in turn can be compiled to each platform's native
binary. binary.
The plug-in includes the following tools from the LLVM toolchain: The plug-in integrates the following tools from the LLVM toolchain:
Clang/Clang{plus}{plus}/llvm-gcc/llvm-g{plus}{plus} (C/(cpp} compilers), llvm-ld (linker), Clang/Clang{plus}{plus}/llvm-gcc/llvm-g{plus}{plus} (C/(cpp} compilers), llvm-ld (linker),
llvm-ar (archiver), llvm-as (assembler), llc (static compiler) and lli llvm-ar (archiver), llvm-as (assembler), llc (static compiler) and lli
(JIT/Interpreter). (JIT/Interpreter).

View file

@ -30,24 +30,19 @@ endif::[]
== Initial configuration == Initial configuration
When you launch an Eclipse workspace with LLVM plug-in for the first On Linux and macOS hosts, the LLVM toolchain will typically be installed via the package
time, you may need to set paths to LLVM binaries, headers and libraries. management tool provided by the Linux distribution or as part of the
This is done in Eclipse by navigating to Window -> Preferences -> LLVM. _Xcode Command Line Tools_ and will be located on the system `PATH`.
Set LLVM installation folder to point where your LLVM binaries are, If your LLVM toolchain is not on the system `PATH` when launching the Eclipse Workbench,
include directory to point where your Clang includes are and library you may need to add the location of your LLVM binaries to the `PATH` environment variable
path to the directory where your LLVM libraries reside. within Eclipse. This is done by navigating to Window -> Preferences ->
C/{cpp} -> Build -> Environment. Select the `PATH` environment variable and then edit its
value to point where your LLVM binaries are located.
If your paths in Preferences and LLVM are correctly set and the plug-in If your `PATH` environment variable is set correctly, you should see the
is able to find your LLVM binaries, you should have the option to use _LLVM with Clang_ and _LLVM with GCC_ toolchains available for selection within the
"LLVM with Clang (Linux/MacOSX/Windows)" toolchain and "LLVM with GCC CDT project wizard for managed build projects. The toolchains are available for both
(Linux/MacOSX/Windows) toolchain". The toolchains are available in C and {cpp} projects.
project types of 'executable', 'static library' and 'dynamic library' in
both C and {cpp}.
An alternative way is to set the LLVM binary path to PATH system NOTE: Clang is automatically detected when installed on a Microsoft Windows host using
environment variable. the MSYS2 package manager. It is not necessary to modify the `PATH`.
You may also have to include the path to
Standard {cpp} Library in order to compile {cpp} programs by adding the
path in LLVM Preferences or appending it to LD_LIBRARY_PATH system
environment variable.

View file

@ -32,30 +32,26 @@ endif::[]
=== Project types === Project types
==== [#executables]#Executables# ==== Executables
At the moment the executables built with the default settings of a LLVM The executables built with the default settings of an LLVM
with Clang project are native binaries and can be run and debugged as with Clang project are native binaries and can be run and debugged as
such. However LLVM does also support compiling programs to LLVM bitcode, such. However LLVM does also support building programs to LLVM bitcode,
which in turn can be run with lli, which is the LLVM toolchain's which in turn can be run with `lli`, which is the LLVM toolchain's
interpreter/JIT compiler. Unfortunately programs run with lli can not be interpreter/JIT compiler. Unfortunately programs run with `lli` can not be
efficiently debugged, since the only (usable) debugging information that efficiently debugged, since the only (usable) debugging information that
you can get from them is the backtrace. You can, however, compile the you can get from them is the backtrace. You can, however, compile the
bitcode versions of your programs, if you will (TODO: even though bitcode versions of your programs, if you wish (TODO: even though
running them from Eclipse doesn't work at the moment). running them from Eclipse doesn't work at the moment).
===== Compiling to LLVM bitcode instead of native binary ===== Compiling to LLVM bitcode instead of object code
You can compile your programs to LLVM bitcode instead of native binaries C/{cpp} source files are compiled to native object code by default. You can compile
by unchecking the "Create native binary (-native)" checkbox in your your source files to LLVM bitcode instead of object code by checking the _Emit LLVM IR_
project's properties in Properties → C/{cpp} Build → Settings → LLVM checkbox in the Project Properties dialog on the Properties -> C/{cpp} Build ->
Linker → General LLVM options. After this Eclipse will not give the Settings -> LLVM Clang -> Optimization page.
-native flag to llvm-ld, so the product of linking is just linked
bitcode files (.bc) and a Bash script file with the name of the wanted
executable. The Bash script will simply run the compiled LLVM bitcode
file with lli.
==== [#libraries]#Shared and static libraries# ==== Shared and static libraries
The shared and static libraries generated with LLVM plugin are (TODO: The shared and static libraries generated with LLVM plugin are (TODO:
for now) only LLVM bitcode files linked into one file and therefore for now) only LLVM bitcode files linked into one file and therefore

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<toc label="LLVM plug-in for Eclipse CDT">
<topic label="User manual" href="llvm/user_manual.htm">
<topic label="General information about the plugin" href="llvm/general.htm"/>
<topic label="Initial configuration" href="llvm/initial_configuration.htm"/>
<topic label="LLVM specific information and options" href="llvm/llvm_specific.htm">
</topic>
</topic>
</toc>

View file

@ -20,5 +20,11 @@
<topic label="Building a project" href="getting_started/cdt_w_build.htm"/> <topic label="Building a project" href="getting_started/cdt_w_build.htm"/>
<topic label="Debugging projects" href="getting_started/cdt_w_debug.htm"/> <topic label="Debugging projects" href="getting_started/cdt_w_debug.htm"/>
<topic label="Importing C/C++ source files into Eclipse" href="getting_started/cdt_w_existing_code.htm"/> <topic label="Importing C/C++ source files into Eclipse" href="getting_started/cdt_w_existing_code.htm"/>
<topic label="LLVM with Clang/GCC for Eclipse CDT" href="llvm/user_manual.htm">
<topic label="General information about the plugin" href="llvm/general.htm"/>
<topic label="Initial configuration" href="llvm/initial_configuration.htm"/>
<topic label="LLVM specific information and options" href="llvm/llvm_specific.htm">
</topic>
</topic>
</topic> </topic>
</toc> </toc>

View file

@ -1,5 +1,5 @@
############################################################################### ###############################################################################
# Copyright (c) 2010 Nokia Siemens Networks Oyj, Finland. # Copyright (c) 2010, 2025 Nokia Siemens Networks Oyj and others
# #
# This program and the accompanying materials # This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0 # are made available under the terms of the Eclipse Public License 2.0
@ -9,7 +9,8 @@
# SPDX-License-Identifier: EPL-2.0 # SPDX-License-Identifier: EPL-2.0
# #
# Contributors: # Contributors:
# Nokia Siemens Networks Oyj, initial LLVM support as an add-on to CDT. # Nokia Siemens Networks Oyj, initial LLVM support as an add-on to CDT
# John Dallaway, add option for clang '-emit-llvm' (#1277)
############################################################################### ###############################################################################
# plugin names # plugin names
@ -25,20 +26,20 @@ ToolChainName.llvm=LLVM
ToolChainName.llvm.with.linker=LLVM with C/C++ Linker ToolChainName.llvm.with.linker=LLVM with C/C++ Linker
ToolChainName.llvm.with.static.compiler=LLVM with static compiler ToolChainName.llvm.with.static.compiler=LLVM with static compiler
ToolChainName.llvm.static.compiler.linux=LLVM with static compiler (Linux) ToolChainName.llvm.static.compiler.linux=LLVM with static compiler (Linux)
ToolChainName.llvm.static.compiler.macosx=LLVM with static compiler (MacOSX) ToolChainName.llvm.static.compiler.macosx=LLVM with static compiler (macOS)
ToolChainName.llvm.static.compiler.win32=LLVM with static compiler (Windows) ToolChainName.llvm.static.compiler.win32=LLVM with static compiler (Windows)
ToolChainName.llvm.jit=LLVM with JIT/Interpreter ToolChainName.llvm.jit=LLVM with JIT/Interpreter
ToolChainName.llvm.jit.linux=LLVM with JIT/Interpreter (Linux) ToolChainName.llvm.jit.linux=LLVM with JIT/Interpreter (Linux)
ToolChainName.llvm.jit.macosx=LLVM with JIT/Interpreter (MacOSX) ToolChainName.llvm.jit.macosx=LLVM with JIT/Interpreter (macOS)
ToolChainName.llvm.jit.win32=LLVM with JIT/Interpreter (Windows) ToolChainName.llvm.jit.win32=LLVM with JIT/Interpreter (Windows)
ToolChainName.llvm.clang=LLVM with Clang ToolChainName.llvm.clang=LLVM with Clang
ToolChainName.llvm.clang.win32.mingw=LLVM with Clang (Windows) (MinGW)\u0020 ToolChainName.llvm.clang.win32.mingw=LLVM with Clang (Windows) (MinGW)\u0020
ToolChainName.llvm.clang.win32.cygwin=LLVM with Clang (Windows) (Cygwin) ToolChainName.llvm.clang.win32.cygwin=LLVM with Clang (Windows) (Cygwin)
ToolChainName.llvm.linux=LLVM with Clang (Linux) ToolChainName.llvm.linux=LLVM with Clang (Linux)
ToolChainName.llvm.macosx=LLVM with Clang (MacOSX) ToolChainName.llvm.macosx=LLVM with Clang (macOS)
ToolChainName.llvm.gnu=LLVM with GCC ToolChainName.llvm.gnu=LLVM with GCC
ToolChainName.llvm.gnu.linux=LLVM with GCC (Linux) ToolChainName.llvm.gnu.linux=LLVM with GCC (Linux)
ToolChainName.llvm.gnu.macosx=LLVM with GCC (MacOSX) ToolChainName.llvm.gnu.macosx=LLVM with GCC (macOS)
ToolChainName.llvm.gnu.win32.cygwin=LLVM with GCC (Windows) (Cygwin) ToolChainName.llvm.gnu.win32.cygwin=LLVM with GCC (Windows) (Cygwin)
ToolChainName.llvm.gnu.win32.mingw=LLVM with GCC (Windows) (MinGW) ToolChainName.llvm.gnu.win32.mingw=LLVM with GCC (Windows) (MinGW)

View file

@ -851,7 +851,7 @@ Contributors:
<option <option
category="llvm.c_cpp.compiler.category.optimization" category="llvm.c_cpp.compiler.category.optimization"
command="-emit-llvm" command="-emit-llvm"
defaultValue="true" defaultValue="false"
id="llvm.c_cpp.compiler.option.optimization.emit-llvm" id="llvm.c_cpp.compiler.option.optimization.emit-llvm"
name="%Option.Llvm.Clang.EmitLlvm.name" name="%Option.Llvm.Clang.EmitLlvm.name"
tip="%Option.Llvm.Clang.EmitLlvm.tip" tip="%Option.Llvm.Clang.EmitLlvm.tip"