Lines Matching +refs:clang +refs:format +refs:fallback +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.
239 …<b><span style="color:black">test.c:28:8: <span style="color:magenta">warning</span>: extra tokens…
241 <span style="color:green">^</span>
242 <span style="color:green">//</span>
260 .. option:: -fdiagnostics-format=clang/msvc/vi
262 Changes diagnostic output format to better match IDEs and command line tools.
264 This option controls the output format of the filename, line number,
268 **clang** (default)
317 For example, a format string warning will produce these three
332 .. option:: -f[no-]save-optimization-record[=<format>]
341 By default, the serialization format is YAML.
347 ``-fsave-optimization-record=yaml``: A structured YAML format.
351 ``-fsave-optimization-record=bitstream``: A binary format based on LLVM
359 ``<base>.opt.<format>``
365 * ``clang -fsave-optimization-record -c in.c -o out.o`` will generate
368 * ``clang -fsave-optimization-record -c in.c`` will generate
376 ``<base>.opt.<format>.thin.<num>.<format>``
386 ``clang -fsave-optimization-record=bitstream in.c -o out`` will generate
399 ``<base>-<arch>.opt.<format>``
489 parsable format after the file/line/column number information. The
509 parseable format at the end of diagnostics. The following example
510 illustrates the format:
676 * ``off`` (Disable auto-generation of preprocessed source files during a clang crash.)
682 Disable auto-generation of preprocessed source files during a clang crash.
738 $ clang -O2 -Rpass=inline code.cc -o code
780 compilation step. The ``clang`` driver during execution calls different tools,
785 CSV format:
789 $ clang -fproc-stat-report=abc foo.c
791 clang-11,"/tmp/foo-123456.o",92000,84000,87536
803 are printed on standard output in human readable format:
807 $ clang -fproc-stat-report foo.c
808 clang-11: output=/tmp/foo-855a8e.o, total=68.000 ms, user=60.000 ms, mem=86920 Kb
818 stdout in human readable format.
820 process statistics to the given file in the CSV format. Specifying a relative
898 clang --config=/home/user/cfgs/testing.txt
899 clang --config=debug.cfg --config=runtimes.cfg
910 clang build using CMake parameters, ``CLANG_CONFIG_FILE_USER_DIR`` and
927 - ``clang`` for the ``gcc`` driver (used to compile C programs)
928 - ``clang++`` for the ``gxx`` driver (used to compile C++ programs)
929 - ``clang-cpp`` for the ``cpp`` driver (pure preprocessor)
930 - ``clang-cl`` for the ``cl`` driver
932 - ``clang-dxc`` for the ``dxc`` driver
934 For example, when calling ``x86_64-pc-linux-gnu-clang-g++``,
937 x86_64-pc-linux-gnu-clang++.cfg
942 x86_64-pc-linux-gnu-clang-g++.cfg
948 i386-pc-linux-gnu-clang++.cfg
956 For example, ``x86_64-pc-linux-gnu-clang-g++`` will attempt to load two
959 clang++.cfg
962 with fallback to trying::
964 clang-g++.cfg
1082 by running '``clang --print-diagnostic-categories``'.
1122 #pragma clang diagnostic push
1123 #pragma clang diagnostic ignored "-Wextra-tokens"
1128 #pragma clang diagnostic pop
1181 #pragma clang system_header
1196 $ clang -Ifoo -isystem bar --system-header-prefix=x/ \
1254 `static analyzer <https://clang-analyzer.llvm.org>`_ can also be
1256 `annotations <https://clang-analyzer.llvm.org/annotations.html>`_ and the
1258 page <https://clang-analyzer.llvm.org/faq.html#exclude_code>`_ for more
1290 $ clang -x c-header test.h -o test.h.pch
1296 option is passed to ``clang``:
1300 $ clang -include-pch test.h.pch test.c -o test
1302 The ``clang`` driver will check if the PCH file ``test.h.pch`` is
1314 $ clang -x c-header test.h -o test.h.pch
1317 $ clang test.c -o test
1319 In this example, ``clang`` will not automatically use the PCH file for
1351 # clang -x c-header --relocatable-pch -isysroot /path/to/build /path/to/build/mylib.h mylib.h.pch
1570 and ``clang fp contract`` pragmas. Please refer to the pragma documentation
1772 ``double`` computations must be performed in the 80-bit X87 format, Clang
1811 ``#pragma clang fp eval_method``.
1955 :doc:`SanitizerSpecialCaseList` for file format description.
2149 $ cd $P/foo && clang -c -funique-internal-linkage-names name_conflict.c
2150 $ cd $P/bar && clang -c -funique-internal-linkage-names name_conflict.c
2151 $ cd $P && clang foo/name_conflict.o && bar/name_conflict.o
2163 that need to placed in unique sections can be specified. The format of the
2237 generated by that tool must then be converted into a format that can be read
2264 $ clang++ -O2 -gline-tables-only code.cc -o code
2268 into the format that the LLVM optimizer understands. Currently, there
2282 3. Convert the collected profile data to LLVM's sample profile format.
2306 $ clang++ -O2 -gline-tables-only -fprofile-sample-use=code.prof code.cc -o code
2315 $ clang++ -O2 -gline-tables-only -fprofile-sample-use=code.prof \
2322 the data generated by the profiler must be converted into a format that can be
2327 information. The format is described below. It can also be generated from
2331 profile files. This is the format generated by the ``create_llvm_prof`` tool
2334 3. GCC encoding. This is based on the gcov format, which is accepted by GCC. It
2343 profiler's native format into one of these three.
2349 This section describes the ASCII text format for sampling profiles. It is,
2483 $ clang++ -O2 -fprofile-instr-generate code.cc -o code
2521 file still needs to be converted to a different format expected by the compiler (
2529 3. Combine profiles from multiple runs and convert the "raw" profile format to
2530 the input expected by clang. Use the ``merge`` command of the
2538 since the merge operation also changes the file format.
2545 $ clang++ -O2 -fprofile-instr-use=code.profdata code.cc -o code
2548 profile. As you make changes to your code, clang may no longer be able to
2573 $ clang++ -O2 -fprofile-generate=yyy/zzz code.cc -o code
2578 To generate the profile data file with the compiler readable format, the
2604 $ clang++ -O2 -fprofile-generate=yyy/zzz code.cc -o code
2613 $ clang++ -O2 -fprofile-use=code.profdata -fcs-profile-generate=sss/ttt \
2624 $ clang++ -O2 -fprofile-use=cs_code.profdata
2683 :doc:`SanitizerSpecialCaseList` format which selects which files and
2688 $ clang++ -O2 -fprofile-instr-generate -fprofile-list=fun.list code.cc -o code
2694 …$ clang++ -O2 -fprofile-instr-generate -fcoverage-mapping -fprofile-list=fun.list -fprofile-list=c…
2696 Supported sections are ``[clang]``, ``[llvm]``, and ``[csllvm]`` representing
2697 clang PGO, IRPGO, and CSIRPGO, respectively. Supported prefixes are ``function``
2706 # The following cases are for clang instrumentation.
2707 [clang]
2720 An older format is also supported, but it is only able to add the
2724 ``!fun:<name>`` or ``!src:<file>`` respectively. The format also supports
2741 # Recognized section names are clang, llvm and csllvm.
2763 …$ clang++ -Oz -fprofile-generate=group_0/ -fprofile-function-groups=3 -fprofile-selected-function-…
2764 …$ clang++ -Oz -fprofile-generate=group_1/ -fprofile-function-groups=3 -fprofile-selected-function-…
2765 …$ clang++ -Oz -fprofile-generate=group_2/ -fprofile-function-groups=3 -fprofile-selected-function-…
2862 $ clang --coverage -fprofile-filter-files=".*\.c$" foo.c
2873 $ clang --coverage -fprofile-exclude-files="^/usr/include/.*$" foo.c
2883 $ clang --coverage -fprofile-exclude-files="^/usr/include/.*$" \
3004 Clang parses Doxygen and non-Doxygen style documentation comments and attaches
3006 Doxygen-style comments and ignores ordinary comments starting with ``//`` and
3044 The support for standard C in clang is feature-complete except for the
3047 Extensions supported by clang
3055 clang supports the -std option, which changes what language mode clang uses.
3058 specified, clang defaults to gnu17 mode. Many C99 and C11 features are
3112 clang tries to be compatible with gcc as much as possible, but some gcc
3115 - clang does not support decimal floating point types (``_Decimal32`` and
3117 - clang does not support nested functions; this is a complex feature
3130 - clang only supports global register variables when the register specified
3134 - clang does not support static initialization of flexible array
3137 - clang does not support
3141 that because clang pretends to be like GCC 4.2, and this extension
3143 extension with clang at the moment.
3144 - clang does not support the gcc extension for forward-declaring
3160 - clang does not support the gcc extension that allows variable-length
3163 the extension appears to be rarely used. Note that clang *does*
3172 - clang does not support ``__builtin_apply`` and friends; this extension
3180 clang has support for many extensions from Microsoft Visual C++. To enable these
3186 clang has a ``-fms-compatibility`` flag that makes clang accept enough
3189 <https://clang.llvm.org/compatibility.html#dep_lookup_bases>`_, which is
3190 a common compatibility issue with clang. This flag is enabled by default
3193 ``-fdelayed-template-parsing`` lets clang delay parsing of function template
3197 For compatibility with existing code that compiles with MSVC, clang defines the
3199 and 180000000 respectively, making clang look like an early release of Visual
3202 compatibility version makes clang behave more like that version of MSVC. For
3211 clang fully implements all of standard C++98 except for exported
3215 See the `C++ support in Clang <https://clang.llvm.org/cxx_status.html>`_ page
3301 $ clang test.cl
3308 $ clang -target nvptx64-unknown-unknown test.cl
3309 $ clang -target amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3315 $ clang -c -emit-llvm test.cl
3328 From clang 14 onwards SPIR-V can be generated directly as detailed in
3334 From clang 9 a C++ mode is available for OpenCL (see
3351 $ clang -cl-std=CL2.0 -cl-single-precision-constant test.cl
3369 $ clang -cl-std=CL2.0 -cl-no-stdinc test.cl
3393 $ clang -c -target spirv64 -cl-ext=-cl_khr_fp64 test.cl
3399 $ clang -target r600 -cl-ext=-all,+cl_khr_fp16 test.cl
3402 clang by default.
3420 $ clang -target amdgcn-amd-amdhsa -mcpu=gfx900 test.cl
3426 $ clang -target nvptx64-unknown-unknown test.cl
3436 $ clang -target spirv32 -c test.cl
3437 $ clang -target spirv64 -c test.cl
3448 $ clang -target spir test.cl -emit-llvm -c
3449 $ clang -target spir64 test.cl -emit-llvm -c
3487 $ clang -cl-std=CL2.0 test.cl
3639 Starting from clang 9 kernel code can contain C++17 features: classes, templates,
3643 there is no plan to support it in clang in any new releases in the near future.
3680 clang -cl-std=clc++1.0 test.clcpp
3681 clang -cl-std=clc++ -c -target spirv64 test.cl
3689 clang test.clcpp
3697 clang -cl-std=clc++ test.cl
3733 clang -cl-std=clc++ test.cl
3771 For the X86 target, clang supports the `-m16` command line
3807 clang currently contains some support for other architectures (e.g. Sparc);
3811 clang contains limited support for the MSP430 embedded processor, but
3812 both the clang support and the LLVM backend support are highly
3817 platform is quite easy; see ``lib/Basic/Targets.cpp`` in the clang source
3860 - ``some_directory/bin/clang.exe``
3861 - ``some_directory/bin/clang++.exe``
3929 $ clang -target spirv32 -c test.cl
3930 $ clang -target spirv64 -c test.cl
3947 $ clang -target spirv32 -fintegrated-objemitter -c test.cl
3950 it is not suitable for arbitrary use cases. This feature is only enabled when clang
3962 $ clang -target spirv64 test1.cl test2.cl
3965 format can be found in `the SPIR-V target guide
3970 clang-cl
3973 clang-cl is an alternative command-line interface to Clang, designed for
3976 To enable clang-cl to find system headers, libraries, and the linker when run
3981 clang-cl can also be used from inside Visual Studio by selecting the LLVM
3988 Page for selecting the clang-cl executable to use for builds.
3991 ``/p:PlatformToolset=LLVM``. This allows trying out the clang-cl toolchain
3994 It's also possible to point MSBuild at clang-cl without changing toolset by
3995 passing ``/p:CLToolPath=c:\llvm\bin /p:CLToolExe=clang-cl.exe``.
4004 ``CMAKE_CXX_COMPILER`` variables to clang-cl:
4008 cmake -GNinja -DCMAKE_C_COMPILER="c:/Program Files (x86)/LLVM/bin/clang-cl.exe"
4009 -DCMAKE_CXX_COMPILER="c:/Program Files (x86)/LLVM/bin/clang-cl.exe" ..
4015 To be compatible with cl.exe, clang-cl supports most of the same command-line
4019 Options that are known to clang-cl, but not currently supported, are ignored
4024 clang-cl.exe: warning: argument unused during compilation: '/AI'
4028 Options that are not known to clang-cl will be ignored by default. Use the
4034 clang-cl.exe: error: no such file or directory: '/foobar'
4036 Please `file a bug <https://bugs.llvm.org/enter_bug.cgi?product=clang&component=Driver>`_
4037 for any valid cl.exe flags that clang-cl does not understand.
4039 Execute ``clang-cl /?`` to see a list of supported options:
4048 /clang:<arg> Pass <arg> to the clang driver
4217 …ble auto-generation of preprocessed source files and a script for reproduction during a clang crash
4324 -Xclang <arg> Pass <arg> to the clang compiler
4326 The /clang: Option
4329 When clang-cl is run with a set of ``/clang:<arg>`` options, it will gather all
4330 of the ``<arg>`` arguments and process them as if they were passed to the clang
4332 clang-cl options or flags that have a different meaning when passed to the clang
4333 driver. Regardless of where they appear in the command line, the ``/clang:``
4334 arguments are treated as if they were passed at the end of the clang-cl command
4415 clang-cl supports several features that require runtime library support:
4429 ``C:\Program Files\LLVM\lib\clang\11.0.0\lib\windows\clang_rt.profile-x86_64.lib``.
4435 ``/LIBPATH:C:\Program Files\LLVM\lib\clang\11.0.0\lib\windows`` to the linker.
4436 If the user links the program with the ``clang`` or ``clang-cl`` drivers, the
4442 $ clang-cl -c -fsanitize=undefined t.cpp