| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 143910
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.
Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.
I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.
llvm-svn: 143867
|
|
|
|
|
|
|
|
| |
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.
llvm-svn: 143263
|
|
|
|
|
|
|
|
|
|
|
| |
string is part of the function call, then there is no difference. If the
format string is not, the warning will point to the call site and a note
will point to where the format string is.
Fix-it hints for strings are moved to the note if a note is emitted. This will
prevent changes to format strings that may be used in multiple places.
llvm-svn: 143168
|
|
|
|
|
|
| |
GCC compiler workaround.
llvm-svn: 142931
|
|
|
|
|
|
| |
r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."
llvm-svn: 142921
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.
Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.
llvm-svn: 142914
|
|
|
|
|
|
| |
code. Apparently this is what GCC does, and some code depends on this. Fixes <rdar://problem/10321089>.
llvm-svn: 142716
|
|
|
|
| |
llvm-svn: 142465
|
|
|
|
|
|
|
|
| |
For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.
llvm-svn: 142342
|
|
|
|
| |
llvm-svn: 142157
|
|
|
|
| |
llvm-svn: 142012
|
|
|
|
| |
llvm-svn: 141955
|
|
|
|
|
|
| |
This finds 2 bugs in chromium and 1 in hunspell, with 0 false positives.
llvm-svn: 141902
|
|
|
|
| |
llvm-svn: 141632
|
|
|
|
|
|
|
|
|
|
|
| |
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.
llvm-svn: 141561
|
|
|
|
|
|
| |
subexpressions. Fixes PR10291.
llvm-svn: 141552
|
|
|
|
|
|
|
| |
for better self-documenting code, since the semantics
are subtly different from getDefinition().
llvm-svn: 141355
|
|
|
|
|
|
|
|
| |
C-style and functional casts are built in SemaCXXCast.cpp.
Introduce a helper class to encapsulate most of the random
state being passed around, at least one level down.
llvm-svn: 141170
|
|
|
|
|
|
| |
Fixes <rdar://problem/9473155>.
llvm-svn: 140777
|
|
|
|
| |
llvm-svn: 140775
|
|
|
|
|
|
| |
macro whose only replacement token is '_Bool'.
llvm-svn: 140656
|
|
|
|
|
|
|
| |
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.
llvm-svn: 140650
|
|
|
|
| |
llvm-svn: 140478
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is cast to a boolean. An exception has been made for string literals in
logical expressions to allow the common case of use in assert statements.
bool x;
x = "hi"; // Warn here
void foo(bool x);
foo("hi"); // Warn here
assert(0 && "error");
assert("error); // Warn here
llvm-svn: 140405
|
|
|
|
| |
llvm-svn: 140367
|
|
|
|
|
|
| |
It already works (and is useful with) macro locs as well.
llvm-svn: 140057
|
|
|
|
|
|
| |
Fixes PR10771.
llvm-svn: 139990
|
|
|
|
| |
llvm-svn: 139856
|
|
|
|
|
|
| |
their semantic attributes and then to take advantage of that.
llvm-svn: 139615
|
|
|
|
| |
llvm-svn: 139466
|
|
|
|
|
|
|
| |
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.
llvm-svn: 139423
|
|
|
|
|
|
|
| |
construct a new DeclRefExpr rather than re-using the existing
DeclRefExpr. Patch by Likai Liu, fixes PR8345.
llvm-svn: 139373
|
|
|
|
| |
llvm-svn: 139334
|
|
|
|
| |
llvm-svn: 139326
|
|
|
|
|
|
|
|
| |
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).
llvm-svn: 138985
|
|
|
|
|
|
|
| |
of default argument promotion and needs to happen unconditionally.
This is particularly semantically important in C++0x.
llvm-svn: 138691
|
|
|
|
|
|
| |
-Wdynamic-class-memaccess
llvm-svn: 138074
|
|
|
|
|
|
| |
are flexible arrays or have size 1.
llvm-svn: 138004
|
|
|
|
|
|
|
|
| |
__SIZE_TYPE__ (and hence be portable).
Also, change the warning to -Wstrl-incorrect-size.
llvm-svn: 137980
|
|
|
|
|
|
|
|
| |
if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now)."
This currently doesn't work on Windows.
llvm-svn: 137920
|
|
|
|
|
|
|
|
| |
argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now).
Warning logic provided by Geoff Keating.
llvm-svn: 137903
|
|
|
|
| |
llvm-svn: 137240
|
|
|
|
| |
llvm-svn: 137234
|
|
|
|
|
|
| |
field in a record.
llvm-svn: 137009
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
case situations with the unary operators & and *. Also extend the array bounds
checking to work with pointer arithmetic; the pointer arithemtic checking can
be turned on using -Warray-bounds-pointer-arithmetic.
The changes to where CheckArrayAccess gets called is based on some trial &
error and a bunch of digging through source code and gdb backtraces in order
to have the check performed under as many situations as possible (such as for
variable initializers, arguments to function calls, and within conditional in
addition to the simpler cases of the operands to binary and unary operator)
while not being called--and triggering warnings--more than once for a given
ArraySubscriptExpr.
llvm-svn: 136997
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
arrays. This now suppresses the warning only in the case of
a one-element array as the last field in a struct where the array size
is a literal '1' rather than any macro expansion or template parameter.
This doesn't distinguish between the language standard in use to allow
code which dates from C89 era to compile without the warning even in C99
and C++ builds. We could add a separate warning (under a different flag)
with fixit hints to switch to a flexible array, but its not clear that
this would be desirable. Much of the code using this idiom is striving
for maximum portability.
Tests were also fleshed out a bit, and the diagnostic itself tweaked to
be more pretty w.r.t. single elment arrays. This is more ugly than
I would like due to APInt's not being supported by the diagnostic
rendering engine.
A pseudo-patch for this was proposed by Nicola Gigante, but I reworked
it both for several correctness issues and for code style.
Sorry this was so long in coming.
llvm-svn: 136965
|
|
|
|
|
|
|
|
|
| |
1-element character arrays which are serving as flexible arrays. This is
the initial step, which is to restrict the 1-element array whitelist to
arrays that are member declarations. I'll refine it from here based on
the proposed patch.
llvm-svn: 136964
|
|
|
|
| |
llvm-svn: 136950
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
has a single element. This disables the warning in cases where
there is a clear bug, but this is really rare (who uses arrays
with one element?) and it also silences a large class of false
positive issues with C89 code that is using tail padding in structs.
A better version of this patch would detect when an array is in
a tail position in a struct, but at least patch fixes the huge
false positives that are hitting postgres and other code.
llvm-svn: 136724
|