| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.
Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.
llvm-svn: 133103
|
|
|
|
| |
llvm-svn: 132996
|
|
|
|
| |
llvm-svn: 132975
|
|
|
|
|
|
| |
handle memcpy and memmove. Spotted by Nico.
llvm-svn: 132902
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
diagnostic group to cover the cases where we have definitively bad
behavior: dynamic classes.
It also rips out the existing support for POD-based checking. This
didn't work well, and triggered too many false positives. I'm looking
into a possibly more principled way to warn on the fundamental buggy
construct here. POD-ness isn't the critical aspect anyways, so a clean
slate is better. This also removes some silliness from the code until
the new checks arrive.
llvm-svn: 132534
|
|
|
|
|
|
| |
This path was reviewed by Chandler Carruth at http://codereview.appspot.com/4538074/
llvm-svn: 132297
|
|
|
|
| |
llvm-svn: 131793
|
|
|
|
|
|
|
|
| |
checking both the source and the destination operands, renaming the
warning group to -Wnon-pod-memaccess and tweaking the diagnostic text
in the process.
llvm-svn: 130786
|
|
|
|
|
|
|
| |
- a default-on warning for pointers to dynamic classes (= classes with vtables)
- a default-off warning for other non-POD types
llvm-svn: 130781
|
|
|
|
|
|
| |
'memset' with external linkage.
llvm-svn: 130770
|
|
|
|
|
|
|
|
|
|
|
| |
definition of POD. Specifically, this allows certain non-aggregate
types due to their data members being private.
The representation of C++11 POD testing is pretty gross. Any suggestions
for improvements there are welcome. Especially the name
'isCXX11PODType()' seems truly unfortunate.
llvm-svn: 130492
|
|
|
|
|
|
| |
may provide a deviant definition of memset).
llvm-svn: 130368
|
|
|
|
|
|
|
|
| |
silence this warning. ;]
Fixed that obvious bug and added a bit more testing as well.
llvm-svn: 130318
|
|
|
|
|
|
|
|
|
|
| |
a destination pointer that points to a non-POD type. This can flag such
horrible bugs as overwriting vptrs when a previously POD structure is
suddenly given a virtual method, or creating objects that crash on
practically any use by zero-ing out a member when its changed from
a const char* to a std::string, etc.
llvm-svn: 130299
|
|
|
|
| |
llvm-svn: 129567
|
|
|
|
|
|
| |
Luis Felipe Strano Moraes!
llvm-svn: 129559
|
|
|
|
|
|
|
| |
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
llvm-svn: 129554
|
|
|
|
|
|
|
|
|
|
|
|
| |
rewriting the literal when the value is integral. It is not uncommon to
see code written as:
const int kBigNumber = 42e5;
Without any real awareness that this is no longer an ICE. The note helps
automate and ease the process of fixing code that violates the warning.
llvm-svn: 129243
|
|
|
|
|
|
| |
Patch by Dave Zarzycki!
llvm-svn: 129189
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch authored by Eric Niebler.
Many methods on the Sema class (e.g. ConvertPropertyForRValue) take Expr
pointers as in/out parameters (Expr *&). This is especially true for the
routines that apply implicit conversions to nodes in-place. This design is
workable only as long as those conversions cannot fail. If they are allowed
to fail, they need a way to report their failures. The typical way of doing
this in clang is to use an ExprResult, which has an extra bit to signal a
valid/invalid state. Returning ExprResult is de riguour elsewhere in the Sema
interface. We suggest changing the Expr *& parameters in the Sema interface
to ExprResult &. This increases interface consistency and maintainability.
This interface change is important for work supporting MS-style C++
properties. For reasons explained here
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013180.html>,
seemingly trivial operations like rvalue/lvalue conversions that formerly
could not fail now can. (The reason is that given the semantics of the
feature, getter/setter method lookup cannot happen until the point of use, at
which point it may be found that the method does not exist, or it may have the
wrong type, or overload resolution may fail, or it may be inaccessible.)
llvm-svn: 129143
|
|
|
|
|
|
| |
is a single implementation. No functionality change intended.
llvm-svn: 128877
|
|
|
|
| |
llvm-svn: 128253
|
|
|
|
|
|
|
|
| |
just fine, and GCC 4.2 doesn't warn here either.
We added this warning back in 2007 when we were comparing against GCC 4.0.
llvm-svn: 127704
|
|
|
|
| |
llvm-svn: 127703
|
|
|
|
|
|
|
|
| |
enumeration type to another in C, classify enumeration constants as if
they had the type of their enclosing enumeration. Fixes
<rdar://problem/9116337>.
llvm-svn: 127514
|
|
|
|
|
|
|
| |
extending the existing support for sizeof and alignof. Original
patch by Guy Benyei.
llvm-svn: 127475
|
|
|
|
|
|
|
|
|
|
|
| |
the call to getSpellingLoc(). On 'aes.c'
in the LLVM test suite, this function was consuming 7.4% of -fsyntax-only time. This change fixes this issue
by delaying the check that the warning would be issued within a system macro by as long as possible. The
main negative of this change is now the logic for this check is done in multiple places in this function instead
of just in one place up front.
llvm-svn: 127425
|
|
|
|
|
|
| |
accesses in ?: expressions.
llvm-svn: 126766
|
|
|
|
|
|
|
| |
don't let calls to such functions go down the normal type-checking path.
Test this out with __builtin_classify_type and __builtin_constant_p.
llvm-svn: 126539
|
|
|
|
|
|
|
|
| |
never can be a real security issue.
Fixes PR 9314.
llvm-svn: 126447
|
|
|
|
| |
llvm-svn: 126341
|
|
|
|
|
|
|
|
|
| |
code the diagnostic is associated with.
This Stmt* is unused, but we will use it shortly for pruning diagnostics associated
with unreachable code.
llvm-svn: 126286
|
|
|
|
|
|
| |
using basic dataflow to suppress warnings on unreachable array bounds checks.
llvm-svn: 126285
|
|
|
|
|
|
| |
enumeration types. Fixes <rdar://problem/8559831>.
llvm-svn: 126183
|
|
|
|
|
|
| |
comparison itself is a constant expression. Fixes PR7536.
llvm-svn: 126057
|
|
|
|
| |
llvm-svn: 125821
|
|
|
|
|
|
|
|
|
| |
especially C++ code, and generally expand the test coverage.
Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.
llvm-svn: 125775
|
|
|
|
|
|
| |
of Clang, and reflows the code a bit to make it easier to read.
llvm-svn: 125773
|
|
|
|
|
|
|
|
|
|
|
| |
specifically targets literals which are implicitly converted, a those
are more often unintended and trivial to fix. This can be especially
helpful for diagnosing what makes 'const int x = 1e6' not an ICE.
Original patch authored by Jim Meehan with contributions from other
Googlers and a few cleanups from myself.
llvm-svn: 125745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.
Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.
This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.
I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.
llvm-svn: 125744
|
|
|
|
| |
llvm-svn: 125693
|
|
|
|
| |
llvm-svn: 125649
|
|
|
|
| |
llvm-svn: 125640
|
|
|
|
|
|
|
| |
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.
llvm-svn: 125450
|
|
|
|
|
|
|
| |
bit-field width nor the initializer value are type- or
value-dependent. Fixes PR8712.
llvm-svn: 124866
|
|
|
|
|
|
|
| |
on, as well as more reliably limiting invalid references to locals from
nested scopes.
llvm-svn: 124721
|
|
|
|
|
|
|
| |
prefix in a printf format string is matched
with the appropriate conversion specifier.
llvm-svn: 123055
|
|
|
|
|
|
| |
checking trivial comparisons. Fixes PR8795.
llvm-svn: 122322
|
|
|
|
|
|
|
|
|
|
|
|
| |
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.
Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.
Fixes rdar://8365684.
llvm-svn: 121873
|
|
|
|
|
|
|
|
| |
Most Neon shift intrinsics do not have variants for polynomial types, but
vsri_n and vsli_n do support them, and we need to properly range-check the
shift immediates for them.
llvm-svn: 121509
|