| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 224880
|
|
|
|
|
|
|
|
| |
when source range is incorrect causing the warning to be
issued when it should not because expression is in a macro.
rdar://19256338
llvm-svn: 224549
|
|
|
|
|
|
|
| |
Bitfield RefersToEnclosingLocal of Stmt::DeclRefExprBitfields renamed to RefersToCapturedVariable to reflect latest changes introduced in commit 224323. Also renamed method Expr::refersToEnclosingLocal() to Expr::refersToCapturedVariable() and comments for constant arguments.
No functional changes.
llvm-svn: 224329
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The extension has the following syntax:
__builtin_call_with_static_chain(Call, Chain)
where Call must be a function call expression and Chain must be of pointer type
This extension performs a function call Call with a static chain pointer
Chain passed to the callee in a designated register. This is useful for
calling foreign language functions whose ABI uses static chain pointers
(e.g. to implement closures).
Differential Revision: http://reviews.llvm.org/D6332
llvm-svn: 224167
|
|
|
|
|
|
| |
since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668.
llvm-svn: 224039
|
|
|
|
|
|
| |
that contained side effects.
llvm-svn: 223184
|
|
|
|
|
|
| |
for C code.
llvm-svn: 222327
|
|
|
|
|
|
|
|
|
|
|
| |
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242
llvm-svn: 222264
|
|
|
|
|
|
|
| |
Shift some functions around, make a method in Sema private,
call the correct overloaded function. No functional change.
llvm-svn: 222081
|
|
|
|
|
|
| |
for a typedef before arithmetic conversion in all rare corner cases.
llvm-svn: 222049
|
|
|
|
| |
llvm-svn: 222047
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Ok, here is somewhat addition to D6217 aiming to preserve old darwin behavior wrt the typedefed types. The actual change to SemaChecking turned out to be pretty gross, in particular:
1. We need to extract the typedef'ed type for proper diagnostics
2. We need to walk over paren expressions as well
Reviewers: chandlerc, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6256
llvm-svn: 222044
|
|
|
|
|
|
|
| |
which evaluates to true. rdar://18716393.
Reviewed by Richard Trieu
llvm-svn: 222009
|
|
|
|
|
|
| |
comments.
llvm-svn: 221714
|
|
|
|
|
|
|
| |
That this is a c-only patch. c++ already has this warning.
This addresses rdar://18716393
llvm-svn: 221702
|
|
|
|
|
|
|
|
| |
parameters with nonnull attribute when comparison is always
true/false. Patch causes false positive when parameter is
modified in the function.
llvm-svn: 221163
|
|
|
|
|
|
|
|
| |
nonnull attribute when comparison is always
true/false. Patch by Steven Wu with few fixes and minor
refactoring and adding tests by me. rdar://18712242
llvm-svn: 220496
|
|
|
|
|
|
|
|
|
| |
Split logic to separate checking function
Refine the macro checking
Catch nullptr->bool conversions
Add some explanatory comments
llvm-svn: 219774
|
|
|
|
|
|
|
| |
implicit casts. Reviewed by Reid Kleckner.
rdar://18405357
llvm-svn: 219712
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and !=) to support mixed complex and real operand types.
This requires removing an assert from SemaChecking, and adding support
both to the constant evaluator and the code generator to synthesize the
imaginary part when needed. This seemed somewhat cleaner than having
just the comparison operators force real-to-complex conversions.
I've added test cases for these operations. I'm really terrified that
there were *no* tests in-tree which exercised this.
This turned up when trying to build R after my change to the complex
type lowering.
llvm-svn: 219570
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to GCC 4.4, __sync_fetch_and_nand was implemented as:
{ tmp = *ptr; *ptr = ~tmp & value; return tmp; }
but this was changed in GCC 4.4 to be:
{ tmp = *ptr; *ptr = ~(tmp & value); return tmp; }
in response to this change, support for sync_fetch_and_nand (and
sync_nand_and_fetch) was removed in r99522 in order to avoid miscompiling code
depending on the old semantics. However, at this point:
1. Many years have passed, and the amount of code relying on the old
semantics is likely smaller.
2. Through the work of many contributors, all LLVM backends have been updated
such that "atomicrmw nand" provides the newer GCC 4.4+ semantics (this process
was complete July of 2014 (added to the release notes in r212635).
3. The lack of this intrinsic is now a needless impediment to porting codes
from GCC to Clang (I've now seen several examples of this).
It is true, however, that we still set GNUC_MINOR to 2 (corresponding to GCC
4.2). To compensate for this, and to address the original concern regarding
code relying on the old semantics, I've added a warning that specifically
details the fact that the semantics have changed and that we provide the newer
semantics.
Fixes PR8842.
llvm-svn: 218905
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MS-compatibility mode
Clang warns (treated as error by default, but still ignored in system headers)
when passing non-POD arguments to variadic functions, and generates a trap
instruction to crash the program if that code is ever run.
Unfortunately, MSVC happily generates code for such calls without a warning,
and there is code in system headers that use it.
This makes Clang not insert the trap instruction when in -fms-compatibility
mode, while still generating the warning/error message.
Differential Revision: http://reviews.llvm.org/D5492
llvm-svn: 218640
|
|
|
|
|
|
|
|
|
| |
In addition to __builtin_assume_aligned, GCC also supports an assume_aligned
attribute which specifies the alignment (and optional offset) of a function's
return value. Here we implement support for the assume_aligned attribute by making
use of the @llvm.assume intrinsic.
llvm-svn: 218500
|
|
|
|
|
|
|
| |
memccpy_check should have source and dest size at arg 3 and 4
rdar://18431336
llvm-svn: 218367
|
|
|
|
|
|
|
|
| |
__builtin___memcpy_chk and similar builtins are
being used. Patch by Jacques Fortier (with added
clang tests). rdar://11076881
llvm-svn: 218063
|
|
|
|
|
|
|
|
| |
for __builtin___strlcpy_chk/__builtin___strlcat_chk.
Patch by Jacques Fortier with monir change by me and
addition of test. rdar://18259539
llvm-svn: 217700
|
|
|
|
|
|
|
|
|
| |
off by default, issue a warning if %s directive is used
in formart argument of a function/method declared as
__attribute__((format(CF/NSString, ...)))
To complete rdar://18182443
llvm-svn: 217619
|
|
|
|
|
|
|
|
| |
off by default, issue a warning if %s directive is used in
certain CF/NS formatting APIs, to assist user in deprecating
use of such %s in these APIs. rdar://18182443
llvm-svn: 217467
|
|
|
|
|
|
|
|
|
|
|
| |
This makes use of the recently-added @llvm.assume intrinsic to implement a
__builtin_assume(bool) intrinsic (to provide additional information to the
optimizer). This hooks up __assume in MS-compatibility mode to mirror
__builtin_assume (the semantics have been intentionally kept compatible), and
implements GCC's __builtin_assume_aligned as assume((p - o) & mask == 0). LLVM
now contains special logic to deal with assumptions of this form.
llvm-svn: 217349
|
|
|
|
|
|
| |
and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>.
llvm-svn: 216824
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the no-arguments case. Don't expand this to an __attribute__((nonnull(A, B,
C))) attribute, since that does the wrong thing for function templates and
varargs functions.
In passing, fix a grammar error in the diagnostic, a crash if
__attribute__((nonnull(N))) is applied to a varargs function,
a bug where the same null argument could be diagnosed multiple
times if there were multiple nonnull attributes referring to it,
and a bug where nonnull attributes would not be accumulated correctly
across redeclarations.
llvm-svn: 216520
|
|
|
|
| |
llvm-svn: 216452
|
|
|
|
| |
llvm-svn: 215569
|
|
|
|
| |
llvm-svn: 215568
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
macro arguments.
Previously, these warnings skipped any code in a macro expansion. Preform an
additional check and warn when the expression and context locations are both
in the macro argument.
The most obvious case not caught is passing a pointer directly to a macro,
i.e 'assert(&array)' but 'assert(&array && "valid array")' is caught. This is
because macro arguments are not typed and the conversion happens inside the
macro.
llvm-svn: 215251
|
|
|
|
|
|
|
| |
question mark instead of the context of the conditional operator. The
condition does not need the context of the conditional operator at all.
llvm-svn: 215048
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main subtlety here is that the Darwin tools still need to be given "-arch
arm64" rather than "-arch aarch64". Fortunately this already goes via a custom
function to handle weird edge-cases in other architectures, and it tested.
I removed a few arm64_be tests because that really isn't an interesting thing
to worry about. No-one using big-endian is also referring to the target as
arm64 (at least as far as toolchains go). Mostly they date from when arm64 was
a separate target and we *did* need a parallel name simply to test it at all.
Now aarch64_be is sufficient.
llvm-svn: 213744
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows ARM indicates __va_start as a variadic function. However, the function
itself is treated as having 4 formal arguments:
- (out) pointer to the va_list
- (in) address of the last named argument
- (in) slot size for the type of the last argument
- address of the last named argument
The last argument does not seem to have any bearing on codegen, and thus is not
explicitly type checked at this point.
Unlike the previous handling for __va_start, it does not currently validate if
the parameter is the last named parameter (it seems that MSVC currently accepts
this).
llvm-svn: 213595
|
|
|
|
|
|
|
|
| |
This fixes a couple of asserts when analyzing comparisons involving
C11 atomics that were uncovered by r205608 when we extended the
applicability of -Wtautological-constant-out-of-range-compare.
llvm-svn: 213573
|
|
|
|
|
|
|
|
|
|
|
|
| |
In MS-compatibility mode, we support the __assume builtin. The __assume builtin
does not evaluate its arguments, and we should issue a warning if __assume is
provided with an argument with side effects (because these effects will be
discarded).
This is similar in spirit to the warnings issued by other compilers (Intel
Diagnostic 2261, MS Compiler Warning C4557).
llvm-svn: 213266
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Memory barrier __builtin_arm_[dmb, dsb, isb] intrinsics are required to
implement their corresponding ACLE and MSVC intrinsics.
This patch ports ARM dmb, dsb, isb intrinsic to AArch64.
Requires LLVM r213247.
Differential Revision: http://reviews.llvm.org/D4521
llvm-svn: 213250
|
|
|
|
|
|
|
| |
Make argument orders match, unify diagnostic IDs and reword the message to be a
little less saccharine.
llvm-svn: 212845
|
|
|
|
|
|
|
| |
Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions
modelling by adding has-side-effects property.
llvm-svn: 212277
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing
variants of the exclusive operations, in line with the C++11 memory
model.
This adds support for two new intrinsics to expose them to C & C++
developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in
direct analogy with the versions with no implicit barrier.
rdar://problem/15885451
llvm-svn: 212175
|
|
|
|
|
|
|
|
|
|
| |
Fixes PR20110, where Clang hits an assertion failure when it expects that the
sub-expression of a bit cast to pointer to also be a pointer, but gets a value
instead.
Differential Revision: http://reviews.llvm.org/D4280
llvm-svn: 212160
|
|
|
|
|
|
|
| |
trigger on taking the address of a reference that is returned from a function
call.
llvm-svn: 211989
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: rtrieu
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4325
llvm-svn: 211972
|
|
|
|
|
|
| |
an assertion of its condition. Suggestion from David Blaikie.
llvm-svn: 211142
|
|
|
|
| |
llvm-svn: 211139
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compilation pipeline doesn't actually need to know about the high-level
concept of diagnostic mappings, and hiding the final computed level presents
several simplifications and other potential benefits.
The only exceptions are opportunistic checks to see whether expensive code
paths can be avoided for diagnostics that are guaranteed to be ignored at a
certain SourceLocation.
This commit formalizes that invariant by introducing and using
DiagnosticsEngine::isIgnored() in place of individual level checks throughout
lex, parse and sema.
llvm-svn: 211005
|