Lines Matching +refs:clang +refs:format +refs:style

18 `Clang Web Site <https://clang.llvm.org>`_ or the `LLVM Web
25 `Clang Static Analyzer <https://clang-analyzer.llvm.org>`_, please see its web
55 Clang also provides an alternative driver, :ref:`clang-cl`, that is designed
164 output format of the diagnostics that it generates.
235 …<b><span style="color:black">test.c:28:8: <span style="color:magenta">warning</span>: extra tokens…
237 <span style="color:green">^</span>
238 <span style="color:green">//</span>
255 .. option:: -fdiagnostics-format=clang/msvc/vi
257 Changes diagnostic output format to better match IDEs and command line tools.
259 This option controls the output format of the filename, line number,
263 **clang** (default)
313 For example, a format string warning will produce these three
328 .. option:: -f[no-]save-optimization-record[=<format>]
337 By default, the serialization format is YAML.
343 ``-fsave-optimization-record=yaml``: A structured YAML format.
347 ``-fsave-optimization-record=bitstream``: A binary format based on LLVM
355 ``<base>.opt.<format>``
361 * ``clang -fsave-optimization-record -c in.c -o out.o`` will generate
364 * ``clang -fsave-optimization-record -c in.c `` will generate
372 ``<base>.opt.<format>.thin.<num>.<format>``
382 ``clang -fsave-optimization-record=bitstream in.c -o out`` will generate
395 ``<base>-<arch>.opt.<format>``
485 parsable format after the file/line/column number information. The
505 parseable format at the end of diagnostics. The following example
506 illustrates the format:
672 Disable auto-generation of preprocessed source files during a clang crash.
723 $ clang -O2 -Rpass=inline code.cc -o code
765 compilation step. The ``clang`` driver during execution calls different tools,
770 CSV format:
774 $ clang -fproc-stat-report=abc foo.c
776 clang-11,"/tmp/foo-123456.o",92000,84000,87536
788 are printed on standard output in human readable format:
792 $ clang -fproc-stat-report foo.c
793 clang-11: output=/tmp/foo-855a8e.o, total=68.000 ms, user=60.000 ms, mem=86920 Kb
803 stdout in human readable format.
805 process statistics to the given file in the CSV format. Specifying a relative
859 clang --config /home/user/cfgs/testing.txt
860 clang --config debug.cfg
871 clang build using CMake parameters, CLANG_CONFIG_FILE_USER_DIR and
876 For example, if the Clang executable is named `armv7l-clang` (it may be a
877 symbolic link to `clang`), then Clang will search for file `armv7l.cfg` in the
882 `x86_64-clang-cl`, Clang first looks for `x86_64-cl.cfg` and if it is not found,
892 x86_64-clang -m32 abc.c
991 by running '``clang --print-diagnostic-categories``'.
1031 #pragma clang diagnostic push
1032 #pragma clang diagnostic ignored "-Wextra-tokens"
1037 #pragma clang diagnostic pop
1090 #pragma clang system_header
1105 $ clang -Ifoo -isystem bar --system-header-prefix=x/ \
1145 `static analyzer <https://clang-analyzer.llvm.org>`_ can also be
1147 `annotations <https://clang-analyzer.llvm.org/annotations.html>`_ and the
1149 page <https://clang-analyzer.llvm.org/faq.html#exclude_code>`_ for more
1181 $ clang -x c-header test.h -o test.h.pch
1187 option is passed to ``clang``:
1191 $ clang -include test.h test.c -o test
1193 The ``clang`` driver will first check if a PCH file for ``test.h`` is
1206 $ clang -x c-header test.h -o test.h.pch
1209 $ clang test.c -o test
1211 In this example, ``clang`` will not automatically use the PCH file for
1243 # clang -x c-header --relocatable-pch -isysroot /path/to/build /path/to/build/mylib.h mylib.h.pch
1365 and ``clang fp contract`` pragmas. Please refer to the pragma documentation
1621 :doc:`SanitizerSpecialCaseList` for file format description.
1806 $ cd $P/foo && clang -c -funique-internal-linkage-names name_conflict.c
1807 $ cd $P/bar && clang -c -funique-internal-linkage-names name_conflict.c
1808 $ cd $P && clang foo/name_conflict.o && bar/name_conflict.o
1820 that need to placed in unique sections can be specified. The format of the
1894 generated by that tool must then be converted into a format that can be read
1921 $ clang++ -O2 -gline-tables-only code.cc -o code
1925 into the format that the LLVM optimizer understands. Currently, there
1939 3. Convert the collected profile data to LLVM's sample profile format.
1963 $ clang++ -O2 -gline-tables-only -fprofile-sample-use=code.prof code.cc -o code
1970 the data generated by the profiler must be converted into a format that can be
1975 information. The format is described below. It can also be generated from
1979 profile files. This is the format generated by the ``create_llvm_prof`` tool
1982 3. GCC encoding. This is based on the gcov format, which is accepted by GCC. It
1991 profiler's native format into one of these three.
1997 This section describes the ASCII text format for sampling profiles. It is,
2131 $ clang++ -O2 -fprofile-instr-generate code.cc -o code
2169 file still needs to be converted to a different format expected by the compiler (
2177 3. Combine profiles from multiple runs and convert the "raw" profile format to
2178 the input expected by clang. Use the ``merge`` command of the
2186 since the merge operation also changes the file format.
2193 $ clang++ -O2 -fprofile-instr-use=code.profdata code.cc -o code
2196 profile. As you make changes to your code, clang may no longer be able to
2221 $ clang++ -O2 -fprofile-generate=yyy/zzz code.cc -o code
2226 To generate the profile data file with the compiler readable format, the
2252 $ clang++ -O2 -fprofile-generate=yyy/zzz code.cc -o code
2261 $ clang++ -O2 -fprofile-use=code.profdata -fcs-profile-generate=sss/ttt \
2272 $ clang++ -O2 -fprofile-use=cs_code.profdata
2323 :doc:`SanitizerSpecialCaseList` format which selects which files and
2329 $ clang++ -O2 -fprofile-instr-generate -fprofile-list=fun.list code.cc -o code
2337 …% clang++ -O2 -fprofile-instr-generate -fcoverage-mapping -fprofile-list=fun.list -fprofile-list=c…
2341 ``!fun:<name>`` or ``!src:<file>`` respectively. The format also supports
2358 # Recognized section names are clang, llvm and csllvm.
2459 $ clang --coverage -fprofile-filter-files=".*\.c$" foo.c
2470 $ clang --coverage -fprofile-exclude-files="^/usr/include/.*$" foo.c
2480 $ clang --coverage -fprofile-exclude-files="^/usr/include/.*$" \
2607 Clang parses Doxygen and non-Doxygen style documentation comments and attaches
2609 Doxygen-style comments and ignores ordinary comments starting with ``//`` and
2647 The support for standard C in clang is feature-complete except for the
2650 Extensions supported by clang
2658 clang supports the -std option, which changes what language mode clang uses.
2661 specified, clang defaults to gnu17 mode. Many C99 and C11 features are
2715 clang tries to be compatible with gcc as much as possible, but some gcc
2718 - clang does not support decimal floating point types (``_Decimal32`` and
2720 - clang does not support nested functions; this is a complex feature
2733 - clang only supports global register variables when the register specified
2737 - clang does not support static initialization of flexible array
2740 - clang does not support
2744 that because clang pretends to be like GCC 4.2, and this extension
2746 extension with clang at the moment.
2747 - clang does not support the gcc extension for forward-declaring
2763 - clang does not support the gcc extension that allows variable-length
2766 the extension appears to be rarely used. Note that clang *does*
2775 - clang does not support ``__builtin_apply`` and friends; this extension
2783 clang has support for many extensions from Microsoft Visual C++. To enable these
2789 clang has a ``-fms-compatibility`` flag that makes clang accept enough
2792 <https://clang.llvm.org/compatibility.html#dep_lookup_bases>`_, which is
2793 a common compatibility issue with clang. This flag is enabled by default
2796 ``-fdelayed-template-parsing`` lets clang delay parsing of function template
2800 For compatibility with existing code that compiles with MSVC, clang defines the
2802 and 180000000 respectively, making clang look like an early release of Visual
2805 compatibility version makes clang behave more like that version of MSVC. For
2814 clang fully implements all of standard C++98 except for exported
2818 See the `C++ support in Clang <https://clang.llvm.org/cxx_status.html>` page
2904 $ clang test.cl
2911 $ clang -target nvptx64-unknown-unknown test.cl
2912 $ clang -target amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
2918 $ clang -c -emit-llvm test.cl
2935 Starting from clang 9 a C++ mode is available for OpenCL (see
2952 $ clang -cl-std=CL2.0 -cl-single-precision-constant test.cl
2972 $ clang -cl-std=CL2.0 -cl-no-stdinc test.cl
2995 $ clang -target amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3001 $ clang -target nvptx64-unknown-unknown test.cl
3014 $ clang -target spir test.cl -emit-llvm -c
3015 $ clang -target spir64 test.cl -emit-llvm -c
3050 $ clang -cl-std=CL2.0 test.cl
3202 Starting from clang 9 kernel code can contain C++17 features: classes, templates,
3206 there is no plan to support it in clang in any new releases in the near future.
3237 clang -cl-std=clc++ test.cl
3244 clang test.clcpp
3277 clang -cl-std=clc++ test.cl
3315 For the X86 target, clang supports the `-m16` command line
3351 clang currently contains some support for other architectures (e.g. Sparc);
3355 clang contains limited support for the MSP430 embedded processor, but
3356 both the clang support and the LLVM backend support are highly
3361 platform is quite easy; see ``lib/Basic/Targets.cpp`` in the clang source
3404 - ``some_directory/bin/clang.exe``
3405 - ``some_directory/bin/clang++.exe``
3425 clang-cl
3428 clang-cl is an alternative command-line interface to Clang, designed for
3431 To enable clang-cl to find system headers, libraries, and the linker when run
3436 clang-cl can also be used from inside Visual Studio by selecting the LLVM
3443 Page for selecting the clang-cl executable to use for builds.
3446 ``/p:PlatformToolset=LLVM``. This allows trying out the clang-cl toolchain
3449 It's also possible to point MSBuild at clang-cl without changing toolset by
3450 passing ``/p:CLToolPath=c:\llvm\bin /p:CLToolExe=clang-cl.exe``.
3459 ``CMAKE_CXX_COMPILER`` variables to clang-cl:
3463 cmake -GNinja -DCMAKE_C_COMPILER="c:/Program Files (x86)/LLVM/bin/clang-cl.exe"
3464 -DCMAKE_CXX_COMPILER="c:/Program Files (x86)/LLVM/bin/clang-cl.exe" ..
3470 To be compatible with cl.exe, clang-cl supports most of the same command-line
3474 Options that are known to clang-cl, but not currently supported, are ignored
3479 clang-cl.exe: warning: argument unused during compilation: '/AI'
3483 Options that are not known to clang-cl will be ignored by default. Use the
3489 clang-cl.exe: error: no such file or directory: '/foobar'
3491 Please `file a bug <https://bugs.llvm.org/enter_bug.cgi?product=clang&component=Driver>`_
3492 for any valid cl.exe flags that clang-cl does not understand.
3494 Execute ``clang-cl /?`` to see a list of supported options:
3503 /clang:<arg> Pass <arg> to the clang driver
3673 …ble auto-generation of preprocessed source files and a script for reproduction during a clang crash
3777 -Xclang <arg> Pass <arg> to the clang compiler
3779 The /clang: Option
3782 When clang-cl is run with a set of ``/clang:<arg>`` options, it will gather all
3783 of the ``<arg>`` arguments and process them as if they were passed to the clang
3785 clang-cl options or flags that have a different meaning when passed to the clang
3786 driver. Regardless of where they appear in the command line, the ``/clang:``
3787 arguments are treated as if they were passed at the end of the clang-cl command
3868 clang-cl supports several features that require runtime library support:
3882 ``C:\Program Files\LLVM\lib\clang\11.0.0\lib\windows\clang_rt.profile-x86_64.lib``.
3888 ``/LIBPATH:C:\Program Files\LLVM\lib\clang\11.0.0\lib\windows`` to the linker.
3889 If the user links the program with the ``clang`` or ``clang-cl`` drivers, the
3895 $ clang-cl -c -fsanitize=undefined t.cpp