| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 153009
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly
for other char types (wide, 16, and 32). Add tests for all these, and since
this means testing such hints under C++0x, add tests for some untested C++0x
hint cases in the existing code, including suggesting nullptr for pointer
initialization.
This sets up the initialization helper to provide better type fidelity that
will be especially helpful for non-assignment cases (such as fixit-correcting
NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead
of the less informative foo(0)))
llvm-svn: 153008
|
| |
|
|
|
|
| |
nested-name-specifier for a class template declaration. Fixes PR12291.
llvm-svn: 153006
|
| |
|
|
|
|
| |
declarator-ids that occur at class scope. Fixes PR8019.
llvm-svn: 153002
|
| |
|
|
|
|
|
|
| |
writing @synchronized statement; do not call locking
expression more than once and support early exits in
@synchronized's statement block (such as return).
llvm-svn: 152993
|
| |
|
|
|
|
|
| |
the availability of the enumeration type itself. Fixes
<rdar://problem/10996386>.
llvm-svn: 152977
|
| |
|
|
|
|
|
|
| |
counting autoreleases. Fixes PR10376.
(Also, 80-column violations.)
llvm-svn: 152976
|
| |
|
|
| |
llvm-svn: 152975
|
| |
|
|
|
|
|
| |
(The plist output does not match the one we expect, specifically we do
not detect that the interesting symbol is returned by a call.)
llvm-svn: 152969
|
| |
|
|
|
|
|
| |
Do not display the standard "Returning from 'foo'", when a stack hint is
available.
llvm-svn: 152964
|
| |
|
|
| |
llvm-svn: 152963
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The symbol-aware stack hint combines the checker-provided message
with the information about how the symbol was passed to the callee: as
a parameter or a return value.
For malloc, the generated messages look like this :
"Returning from 'foo'; released memory via 1st parameter"
"Returning from 'foo'; allocated memory via 1st parameter"
"Returning from 'foo'; allocated memory returned"
"Returning from 'foo'; reallocation of 1st parameter failed"
(We are yet to handle cases when the symbol is a field in a struct or
an array element.)
llvm-svn: 152962
|
| |
|
|
|
|
|
| |
% is a common character in IR so we'd crash on almost any malformed IR. The
diagnostic formatter expects a formatting directive when it sees an unescaped %.
llvm-svn: 152956
|
| |
|
|
|
|
|
|
|
|
| |
store to 1. This allows code-gen to select a more appropriate alignment. If left
to zero, an alignment greater than the alignment of the pointer may be selected,
causing code-gen to use instructions which require an alignment greater than the
pointer guarantees.
<rdar://problem/11043589>
llvm-svn: 152951
|
| |
|
|
|
|
| |
// rdar://11063663
llvm-svn: 152949
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For "int i = NULL;" we would produce:
null.cpp:5:11: warning: implicit conversion of NULL constant to integer [-Wconversion]
int i = NULL;
~ ^~~~
null.cpp:1:14: note: expanded from macro 'NULL'
\#define NULL __null
^~~~~~
But we really shouldn't trace that macro expansion back into the header, yet we
still want macro back traces for code like this:
\#define FOO NULL
int i = FOO;
or
\#define FOO int i = NULL;
FOO
While providing appropriate tagging at different levels of the expansion, etc.
The included test case exercises these cases & does some basic validation (to
ensure we don't have macro expansion notes where we shouldn't, and do where we
should) - but doesn't go as far as to validate the source location/ranges
used in those notes and warnings.
llvm-svn: 152940
|
| |
|
|
|
|
| |
This fixes g++.dg/parse/friend5.C.
llvm-svn: 152938
|
| |
|
|
| |
llvm-svn: 152931
|
| |
|
|
|
|
|
|
| |
This fixes PR 4307.
Patch by Eitan Adler!
llvm-svn: 152918
|
| |
|
|
| |
llvm-svn: 152900
|
| |
|
|
|
|
| |
It should be aware of LIBRARY_PATH.
llvm-svn: 152896
|
| |
|
|
|
|
| |
support.
llvm-svn: 152894
|
| |
|
|
|
|
| |
aren't supported at the moment. PR12040.
llvm-svn: 152891
|
| |
|
|
|
|
|
| |
Don't know if it is an anathema to include '#' in the warning name. I'm fine
with changing it, but this was the most obvious name.
llvm-svn: 152886
|
| |
|
|
|
|
| |
statements.
llvm-svn: 152875
|
| |
|
|
|
|
| |
storage class, the asm name doesn't specify a register. PR12244.
llvm-svn: 152873
|
| |
|
|
| |
llvm-svn: 152867
|
| |
|
|
|
|
|
| |
the behavior of gcc with respect to the -fno-inline and -fno-inline-functions
flags.
llvm-svn: 152861
|
| |
|
|
| |
llvm-svn: 152859
|
| |
|
|
| |
llvm-svn: 152858
|
| |
|
|
| |
llvm-svn: 152857
|
| |
|
|
| |
llvm-svn: 152848
|
| |
|
|
| |
llvm-svn: 152839
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BugVisitor DiagnosticPieces.
When checkers create a DiagnosticPieceEvent, they can supply an extra
string, which will be concatenated with the call exit message for every
call on the stack between the diagnostic event and the final bug report.
(This is a simple version, which could be/will be further enhanced.)
For example, this is used in Malloc checker to produce the ",
which allocated memory" in the following example:
static char *malloc_wrapper() { // 2. Entered call from 'use'
return malloc(12); // 3. Memory is allocated
}
void use() {
char *v;
v = malloc_wrapper(); // 1. Calling 'malloc_wrappers'
// 4. Returning from 'malloc_wrapper', which allocated memory
} // 5. Memory is never released; potential
memory leak
llvm-svn: 152837
|
| |
|
|
| |
llvm-svn: 152835
|
| |
|
|
| |
llvm-svn: 152830
|
| |
|
|
|
|
|
|
| |
to avoid a stack overflow with extreme cases.
Part of rdar://10941790.
llvm-svn: 152820
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows us to handle extreme cases of chained binary operators without causing stack
overflow.
The binary operators that are handled with the data recursive evaluator are
comma, logical, or operators that have operands with integral or enumeration type.
Part of rdar://10941790.
llvm-svn: 152819
|
| |
|
|
|
|
| |
Patch by Silviu Baranga!
llvm-svn: 152788
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Err on the side of brevity and rename (while providing aliases for the original
name) -Wbool-conversions, -Wint-conversions, and -Wvector-conversions for
consistency with constant, literal, string, and sign conversion warnings. And
name the diagnostic groups explicitly while I'm here rather than rewriting the
string in the groups and sema td files.
Curiously, vector-conversion is not under -Wconversion. Perhaps it should be.
llvm-svn: 152776
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Original commit message:
Provide -Wnull-conversion separately from -Wconversion.
Like GCC, provide a NULL conversion to non-pointer conversion as a separate
flag, on by default. GCC's flag is "conversion-null" which we provide for
cross compatibility, but in the interests of consistency (with
-Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called
-Wnull-conversion.
Patch by Lubos Lunak.
Review feedback by myself, Chandler Carruth, and Chad Rosier.
llvm-svn: 152774
|
| |
|
|
|
|
|
| |
Abbreviated commit message:
Provide -Wnull-conversion separately from -Wconversion.
llvm-svn: 152765
|
| |
|
|
|
|
| |
really works.
llvm-svn: 152757
|
| |
|
|
|
|
|
|
|
|
|
| |
-fno-inline-functions.
This behaves much like -fno-inline in gcc, but based on a discussion with
Daniel it was decided that -fno-inline-functions should subsume -fno-inline.
Please speak up if you object. The -fno-inline flag remains ignored.
Final part of rdar://10972766
llvm-svn: 152754
|
| |
|
|
|
|
|
|
| |
scoped enumeration members. Later uses of an enumeration temploid as a nested
name specifier should cause its instantiation. Plus some groundwork for
explicit specialization of member enumerations of class templates.
llvm-svn: 152750
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Like GCC, provide a NULL conversion to non-pointer conversion as a separate
flag, on by default. GCC's flag is "conversion-null" which we provide for
cross compatibility, but in the interests of consistency (with
-Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called
-Wnull-conversion.
Patch by Lubos Lunak.
Review feedback by myself, Chandler Carruth, and Chad Rosier.
llvm-svn: 152745
|
| |
|
|
|
|
| |
qualified name lookups into transparent contexts.
llvm-svn: 152739
|
| |
|
|
|
|
| |
in the callee.
llvm-svn: 152734
|
| |
|
|
|
|
| |
MaterializeTemporaryExpr.
llvm-svn: 152730
|
| |
|
|
| |
llvm-svn: 152721
|