Some of the magic functions take arguments of arbitrary type. However,
for semantic correctness, the compiler still requires a declaration
of these functions with the correct type. Since C does not have
argument-type-overloaded function, this made those functions hard to
use in C code. Improve this situation by allowing arbitrary suffixes
in the affected magic functions' names, thus allowing the user to
create different declarations for different types.
A patch by Keno Fischer!
Differential Revision: https://reviews.llvm.org/D30589
llvm-svn: 297325
Summary:
This patch enables namespace end comments under a new flag FixNamespaceComments,
which is enabled for the LLVM and Google styles.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D30405
llvm-svn: 296632
Added description of a new feature that allows to specify
vendor extension in flexible way using compiler pragma instead
of modifying source code directly (committed in clang@r289979).
Review: D29829
llvm-svn: 295313
Point out that --coverage and -ftest-coverage, which is what most people
are used to, do not enable clang's frontend based coverage pass.
Suggested by Benn Bolay!
llvm-svn: 294626
Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.
Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html
Reviewers: aaron.ballman, klimek, alexfh
Subscribers: ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D28850
llvm-svn: 292477
Summary: Add missing flag to UsersManual
It would be good to merge it to 4.0 branch.
Reviewers: hans
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D28727
llvm-svn: 292112
This time, make ignored options, such as /utf-8, show up as well if they
have help text.
Also, since we're now exposing -fdelayed-template-parsing, add help text
to the -fno version so that shows up as well.
llvm-svn: 291798
There was a small error in the code in the tutorial. The tutorial contains a few errors which results in code not being able to compile.
One error was described here: https://llvm.org/bugs/show_bug.cgi?id=25583 .
I found and fixed the error and one additional error.
Reviewers: aaron.ballman, malcolm.parsons
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D28180
llvm-svn: 290766
Summary:
I needed to know whether a FieldDecl had an in-class
initializer for D26453. I used a narrowing matcher there, but a
traversal matcher might be generally useful.
Reviewers: sbenza, bkramer, klimek, aaron.ballman
Subscribers: aaron.ballman, Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D28034
llvm-svn: 290492
After Darwin has been updated not to link in stdc++ on Darwin this actually
started to break.
Differential Revision: https://reviews.llvm.org/D27598
llvm-svn: 289887
This was accidentally removed in r260506, even though we only support
non-allocatable global register variables. The general (allocatable) case
is explicitly not supported.
Differential Revision: https://reviews.llvm.org/D27473
llvm-svn: 289455
As a first step toward removing Objective-C garbage collection from
Clang, remove support from the driver. I'm hoping this will flush out
any expected bots/configurations/whatever that might rely on it.
I've left the options behind temporarily in -cc1 to keep tests passing.
I'll kill them off entirely in a follow up when I've had a chance to
update/delete the rest of Clang.
llvm-svn: 288872
Summary: x86 is not a valid arch for target triples, but x86_64 and i386 are.
Reviewers: rengolin, silvas
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D26960
llvm-svn: 288723
In bigger projects like an Operating System, the same source code is
often compiled in slightly different ways. This could be the difference
between PIC and non-PIC code for static vs dynamic libraries, it could
also be the difference between size optimised versions of tools for
ramdisk images. At the moment, the compilation database has no way to
distinguish such cases. As first step, add a field in the JSON format
for it and process it accordingly.
Differential Revision: https://reviews.llvm.org/D27138
llvm-svn: 288436
- Fix the bug with transition handling in ExprInspectionChecker's
checkDeadSymbols implementation.
- Test this bug by adding a new function clang_analyzer_numTimesReached() to
catch number of passes through the code, which should be handy for testing
against unintended state splits.
- Add two more functions should help debugging issues quickly without running
the debugger or dumping exploded graphs - clang_analyzer_dump() which dump()s
an SVal argument to a warning message, and clang_analyzer_printState(), which
dump()s the current program state to stderr.
Differential Revision: https://reviews.llvm.org/D26835
llvm-svn: 288257
Summary:
Just like gcc, we should have the -Og option as more and more software are using it:
https://llvm.org/bugs/show_bug.cgi?id=20765
Reviewers: echristo, dberlin, dblaikie, keith.walker.arm, rengolin
Subscribers: aprantl, friss, mehdi_amini, RKSimon, probinson, majnemer, cfe-commits
Differential Revision: https://reviews.llvm.org/D24998
llvm-svn: 286602
TSan and MSan were the only remaining sanitizers referring to the deprecated
attribute for issue suppression. Update the docs to recommend
__attribute__((no_sanitize("..."))) instead.
Differential Revision: https://reviews.llvm.org/D25885
llvm-svn: 285349
The 'no_undeclared_includes' attribute should be used in a module to
tell that only non-modular headers and headers from used modules are
accepted.
The main motivation behind this is to prevent dep cycles between system
libraries (such as darwin) and libc++.
Patch by Richard Smith!
llvm-svn: 284797
Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.
The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:
clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)
in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.
Differential Revision: https://reviews.llvm.org/D25338
llvm-svn: 283746
Revert the -print-libgcc-file-name change as the new test fails
on Darwin. It needs to be updated to run the libgcc part only on systems
supporting that rtlib.
llvm-svn: 283586
Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.
The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:
clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)
in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.
Differential Revision: https://reviews.llvm.org/D25338
llvm-svn: 283572
Summary:
With this commit simple coroutines can be created in plain C using coroutine builtins.
Reviewers: rnk, EricWF, rsmith
Subscribers: modocache, mgorny, mehdi_amini, beanz, cfe-commits
Differential Revision: https://reviews.llvm.org/D24373
llvm-svn: 283155
This option behaves in a similar spirit as -save-temps and writes
internal llvm statistics in json format to a file.
Differential Revision: https://reviews.llvm.org/D24820
llvm-svn: 282426
The fix in r282148 was not enough to fix the following error:
/home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338:
WARNING: unknown option: -flto=full
on the sphinx bot:
http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313
(not reproducible locally).
This time, simply remove the option reference.
llvm-svn: 282151
Summary: Add some user facing documentation on ThinLTO and how to use it.
Reviewers: mehdi_amini
Subscribers: mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D24806
llvm-svn: 282089
Flesh out the section on interpreting coverage reports, mention the
coverage export feature, and add notes on how to build llvm with
coverage turned on.
llvm-svn: 281988
This patch adds an entry for "-rtlib" in the output of `man clang` and `clang -help`.
Patch by Lei Zhang!
Differential Revision: https://reviews.llvm.org/D24069
llvm-svn: 281440
Original commit message:
Add -fdiagnostics-show-hotness
Summary:
I've recently added the ability for optimization remarks to include the
hotness of the corresponding code region. This uses PGO and allows
filtering of the optimization remarks by relevance. The idea was first
discussed here:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334
The general goal is to produce a YAML file with the remarks. Then, an
external tool could dynamically filter these by hotness and perhaps by
other things.
That said it makes sense to also expose this at the more basic level
where we just include the hotness info with each optimization remark.
For example, in D22694, the clang flag was pretty useful to measure the
overhead of the additional analyses required to include hotness.
(Without the flag we don't even run the analyses.)
For the record, Hal has already expressed support for the idea of this
patch on IRC.
Differential Revision: https://reviews.llvm.org/D23284
llvm-svn: 281293
Summary:
I've recently added the ability for optimization remarks to include the
hotness of the corresponding code region. This uses PGO and allows
filtering of the optimization remarks by relevance. The idea was first
discussed here:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/98334
The general goal is to produce a YAML file with the remarks. Then, an
external tool could dynamically filter these by hotness and perhaps by
other things.
That said it makes sense to also expose this at the more basic level
where we just include the hotness info with each optimization remark.
For example, in D22694, the clang flag was pretty useful to measure the
overhead of the additional analyses required to include hotness.
(Without the flag we don't even run the analyses.)
For the record, Hal has already expressed support for the idea of this
patch on IRC.
Differential Revision: https://reviews.llvm.org/D23284
llvm-svn: 281276
Fixed incorrect docs that referred to:
objc_arc_weak_unavailable
when it should be:
objc_arc_weak_reference_unavailable
Patch by: Sean McBride!
llvm-svn: 281227
remark flags. For now I'm checking in a copy of the built documentation, but we
can replace this with a placeholder (as we do for the attributes reference
documentation) once we enable building this server-side.
llvm-svn: 281192
This adds support for modules that require (non-)freestanding
environment, such as the compiler builtin mm_malloc submodule.
Differential Revision: https://reviews.llvm.org/D23871
llvm-svn: 280613
This adds support for modules that require (no-)gnu-inline-asm
environment, such as the compiler builtin cpuid submodule.
This is the gnu-inline-asm variant of https://reviews.llvm.org/D23871
Differential Revision: https://reviews.llvm.org/D23905
rdar://problem/26931199
llvm-svn: 280159
to CC1, which are translated to function attributes and can e.g. be mapped on
build attributes FP_exceptions and FP_denormal. Setting these build attributes
allows better selection of floating point libraries.
Differential Revision: https://reviews.llvm.org/D23840
llvm-svn: 280064
In this mode, there is no need to load any module map and the programmer can
simply use "@import" syntax to load the module directly from a prebuilt
module path. When loading from prebuilt module path, we don't support
rebuilding of the module files and we ignore compatible configuration
mismatches.
rdar://27290316
Differential Revision: http://reviews.llvm.org/D23125
llvm-svn: 279096
Summary:
This is required for compliance with the Mozilla style guide.
This is a rebase+minor change of Birunthan Mohanathas's patch
Reviewers: djasper
Subscribers: klimek, cfe-commits, opilarium
Differential Revision: https://reviews.llvm.org/D23317
llvm-svn: 278121
This reverts commit r275895 in order to address some post-commit review
feedback from Eric Christopher (see: the list thread for r275895).
llvm-svn: 276936
Compute an effective target triple exactly once in ConstructJob(), and
then simply pass around references to it. This eliminates wasteful
re-computation of effective triples (e.g in getARMFloatABI()).
Differential Revision: https://reviews.llvm.org/D22290
llvm-svn: 275895
A number of warnings still remain, but these were the last of the
"unlexable code"-related ones (AFAICT).
I changed a few examples in docs/UsersManual.rst to showcase
-Wextra-tokens because it's already documented (-Wmultichar isn't), and
the sphinx C lexer apparently can't handle char literals like 'ab'. It
seemed like a better overall approach than just marking the code blocks
as none or console.
llvm-svn: 273232
The reason is that this (a) seems to work just fine and (b) useful when building stuff with
sanitizer+coverage, but need to exclude the sanitizer for a particular source file.
llvm-svn: 272717
Summary:
This is similar to other loop pragmas like 'vectorize'. Currently it
only has state values: distribute(enable) and distribute(disable). When
one of these is specified the corresponding loop metadata is generated:
!{!"llvm.loop.distribute.enable", i1 true/false}
As a result, loop distribution will be attempted on the loop even if
Loop Distribution in not enabled globally. Analogously, with 'disable'
distribution can be turned off for an individual loop even when the pass
is otherwise enabled.
There are some slight differences compared to the existing loop pragmas.
1. There is no 'assume_safety' variant which makes its handling slightly
different from 'vectorize'/'interleave'.
2. Unlike the existing loop pragmas, it does not have a corresponding
numeric pragma like 'vectorize' -> 'vectorize_width'. So for the
consistency checks in CheckForIncompatibleAttributes we don't need to
check it against other pragmas. We just need to check for duplicates of
the same pragma.
Reviewers: rsmith, dexonsmith, aaron.ballman
Subscribers: bob.wilson, cfe-commits, hfinkel
Differential Revision: http://reviews.llvm.org/D19403
llvm-svn: 272656
Mention that the code coverage tool becomes less precise whenever
unpredictable changes in control flow occur.
Thanks to Sean Silva for pointing this out!
llvm-svn: 271902
Added notes about full support of all non-offloading features of OpenMP
4.5 + info about option -fopenmp-version=[31|40|45] that allows to
control supported OpenMP version.
llvm-svn: 271263
This patch adds the commandline option -mcompact-branches={never,optimal,always),
which controls how LLVM generates compact branches for MIPSR6 targets. By default,
the compact branch policy is 'optimal' where LLVM will generate the most
appropriate branch for any situation. The 'never' and 'always' policy will disable
or always generate compact branches wherever possible respectfully.
Reviewers: dsanders, vkalintiris, atanasyan
Differential Revision: http://reviews.llvm.org/D20729
llvm-svn: 271000
MSVC now supports the __is_assignable type trait intrinsic,
to enable easier and more efficient implementation of the
Standard Library's is_assignable trait.
As of Visual Studio 2015 Update 3, the VC Standard Library
implementation uses the new intrinsic unconditionally.
The implementation is pretty straightforward due to the previously
existing is_nothrow_assignable and is_trivially_assignable.
We handle __is_assignable via the same code as the other two except
that we skip the extra checks for nothrow or triviality.
Patch by Dave Bartolomeo!
Differential Revision: http://reviews.llvm.org/D20492
llvm-svn: 270458
Summary:
This AST matcher will match a given CastExpr kind.
It's an narrowing matcher on CastExpr.
Reviewers: klimek, alexfh, sbenza, aaron.ballman
Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19871
llvm-svn: 269460
Summary:
This option allows the user to control how much of the file name is
emitted by UBSan. Tuning this option allows one to save space in the
resulting binary, which is helpful for restricted execution
environments.
With a positive N, UBSan skips the first N path components.
With a negative N, UBSan only keeps the last N path components.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19666
llvm-svn: 269309
Summary:
This patch is adding support for a matcher to check string literal length.
This matcher is used in clang-tidy checkers and is part of this refactoring:
see: http://reviews.llvm.org/D19841
Reviewers: sbenza, klimek, aaron.ballman
Subscribers: alexfh, klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19876
llvm-svn: 269274