diff --git a/dist/changelog/changes-12.0.0.md b/dist/changelog/changes-12.0.0.md index 0107cab7302..2c027e6530b 100644 --- a/dist/changelog/changes-12.0.0.md +++ b/dist/changelog/changes-12.0.0.md @@ -36,6 +36,8 @@ Every language, compiler and library that is supported at https://godbolt.org is also supported in Qt Creator. You can save your Compiler Explorer session as a `.qtce` file (JSON-based). +([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-explore-compiler-code.html)) + ### CMake Debugging and the Debug Adapter Protocol Set breakpoints in a CMake file and select `DAP` and `CMake Preset` in `Debug` diff --git a/doc/qtcreator/images/qtcreator-compiler-explorer.webp b/doc/qtcreator/images/qtcreator-compiler-explorer.webp new file mode 100644 index 00000000000..91efe84f9bf Binary files /dev/null and b/doc/qtcreator/images/qtcreator-compiler-explorer.webp differ diff --git a/doc/qtcreator/images/qtcreator-new-file.webp b/doc/qtcreator/images/qtcreator-new-file.webp index 4429f37cd3c..9bea2de2f9c 100644 Binary files a/doc/qtcreator/images/qtcreator-new-file.webp and b/doc/qtcreator/images/qtcreator-new-file.webp differ diff --git a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc index a716f7aede6..04da01aaccf 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-how-tos.qdoc @@ -58,6 +58,7 @@ \li \l {Add libraries to projects} \li \l {Add subprojects to projects} \li \l {Add wizards} + \li \l {Create compiler explorer sessions} \li \l {Create C++ classes} \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} @@ -79,6 +80,10 @@ \section1 Build and Run + \list + \li \l {Explore compiler code} + \endlist + \section2 Manage Kits \list diff --git a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc index 494c7069b12..6498f2c70dd 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-files-creating.qdoc @@ -46,6 +46,10 @@ or list models, \QD forms and a matching classes for Qt Widgets projects, Qt resource files, as well as QML and JavaScript files for Qt Quick projects. + \row + \li \uicontrol {Compiler Explorer} + \li Example setup for using Compiler Explorer to compile C++ or Python + code. \row \li \uicontrol {GLSL} \li OpenGL fragment and vertex shaders. @@ -68,8 +72,9 @@ \li Empty Nim source and script files. \endtable - \sa {Create C++ classes}, {Create OpenGL fragment and vertex shaders}, - {Create resource files}, {Use project wizards} + \sa {Create compiler explorer sessions}, {Create C++ classes}, + {Create OpenGL fragment and vertex shaders}, {Create resource files}, + {Use project wizards} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc new file mode 100644 index 00000000000..21e99086df3 --- /dev/null +++ b/doc/qtcreator/src/projects/creator-only/creator-how-to-create-compiler-explorer-setup.qdoc @@ -0,0 +1,95 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-how-to-create-compiler-explorer-sessions.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects + + \title Create compiler explorer sessions + + To create a compiler explorer session for a C++ or Python project: + + \list 1 + \li Select \uicontrol File > \uicontrol {New File} > + \uicontrol {Compiler Explorer} > \uicontrol C++ or \uicontrol Python + > \uicontrol Choose. + \li Follow the instructions of the wizard to create an example + compiler explorer session as a JSON-based \c .qtce file and to open + it. + \endlist + + \note Enable the Compiler Explorer plugin to use it. + + \sa {Create files}, {Enable and disable plugins}, {Explore compiler code} +*/ + +/*! + \page creator-how-to-explore-compiler-code.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-build + + \title Explore compiler code + + With the \l{https://godbolt.org/}{Compiler Explorer}, you can enter code to + explore the capabilities of your compilers and interpreters. \QC supports + all languages, compilers, and libraries that Compiler Explorer supports. You + can save your compiler explorer session as a JSON-based \c .qtce file. + + \image qtcreator-compiler-explorer.webp {Python code in the compiler explorer} + + \note Enable the Compiler Explorer plugin to use it. + + To check how a compiler sees C++ or Python code: + + \list 1 + \li Select \uicontrol Tools > \uicontrol {Compiler Explorer} > + \uicontrol {Open Compiler Explorer}. + \li In the \uicontrol Language field, select the language to compile. + \li In the \uicontrol Compiler field, select a compiler to see the + assembly code. + \li Enter code to see the resulting assembly code. + \endlist + + You can also see the application status and output. + + To explore several compilers, select \uicontrol {Add Compiler}. + + \section1 Set compiler options + + Select \inlineimage icons/settings.png + to set compiler options. + + \table + \header + \li Setting + \li Value + \row + \li Compiler options + \li Arguments passed to the compiler. Add options to enable optimization + and to change other aspects of the compilation. + \row + \li Libraries + \li Add the libraries that your code links against. + \row + \li Execute the code + \li Execute the resulting executable. + \row + \li Compile to binary object + \li Convert the source code to a binary executable. + \row + \li Intel asm syntax + \li Use the Intel ASM syntax for writing the assembly code. + \row + \li Demangle identifiers + \li Extract and demangle identifiers from mangled symbols. + \e {Name mangling} adds descriptive data to a function's identifier + at link time. The data indicates which namespace and object a + function belongs to and which arguments it handles in which order. + \endtable + + \sa {Create compiler explorer sessions}, {Enable and disable plugins}, + {Add compilers}, {Add custom compilers} +*/ diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index bfc6e8122fa..bf2a02eba2a 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -211,6 +211,7 @@ \li \l {Add libraries to projects} \li \l {Add subprojects to projects} \li \l {Add wizards} + \li \l {Create compiler explorer sessions} \li \l {Create C++ classes} \li \l {Create files} \li \l {Create OpenGL fragment and vertex shaders} @@ -233,6 +234,7 @@ \li \l {Add Nim compilers} \li \l {Add Qt versions} \li \l {Edit Qbs profiles} + \li \l {Explore compiler code} \endlist \li Read Qt Documentation \list