- Jun 16, 2011
-
-
Fariborz Jahanian authored
declaration of global var is __private_extern__. // rdar://9609649 llvm-svn: 133157
-
NAKAMURA Takumi authored
AFAIK, RHEL5 (and its clones) provides g++44 as the package "gcc44-c++". By default, g++-4.1.1 is available, though, its libstdc++ would not be suitable to clang++. llvm-svn: 133156
-
Chandler Carruth authored
and the programmer intended to write 'sizeof(*p)'. There are several elements to the new version: 1) The actual expressions are compared in order to more accurately flag the case where the pattern that works for an array has been used, or a '*' has been omitted. 2) Only do a loose type-based check for record types. This prevents us from warning when we happen to be copying around chunks of data the size of a pointer and the pointer types for the sizeof and source/dest match. 3) Move all the diagnostics behind the runtime diagnostic filter. Not sure this is really important for this particular diagnostic, but almost everything else in SemaChecking.cpp does so. 4) Make the wording of the diagnostic more precise and informative. At least to my eyes. 5) Provide highlighting for the two expressions which had the unexpected similarity. 6) Place this diagnostic under a flag: -Wsizeof-pointer-memaccess This uses the Stmt::Profile system for computing #1. Because of the potential cost, this is guarded by the warning flag. I'd be interested in feedback on how bad this is in practice; I would expect it to be quite cheap in practice. Ideas for a cheaper / better way to do this are also welcome. The diagnostic wording could likely use some further wordsmithing. Suggestions welcome here. The goals I had were to: clarify that its the interaction of 'memset' and 'sizeof' and give more reasonable suggestions for a resolution. An open question is whether these diagnostics should have the note attached for silencing by casting the dest/source pointer to void*. llvm-svn: 133155
-
Jordy Rose authored
[analyzer] Clean up modeling of strcmp, including cases where a string literal has an embedded null character, and where both arguments are the same buffer. Also use nested ifs rather than early returns; in this case early returns will lose any assumptions we've made earlier in the function. llvm-svn: 133154
-
Bruno Cardoso Lopes authored
Original patch by Syoyo Fujita with more comments by me. llvm-svn: 133153
-
Chandler Carruth authored
a ConstStmtVisitor. This also required adding some const iteration support for designated initializers and making some of the getters on the designators const. It also made the formatting of StmtProfile.cpp rather awkward. I'm happy to adjust any of the formatting if folks have suggestions. I've at least fitted it all within 80 columns. llvm-svn: 133152
-
Jordy Rose authored
I will not commit without building first. I will not commit without building first. I will not commit without building first... llvm-svn: 133150
-
Jordy Rose authored
[analyzer] Cleanup: mainly 80-char violations and preferring SValBuilder::getComparisonType() to just referencing IntTy. llvm-svn: 133149
-
John McCall authored
llvm-svn: 133148
-
John McCall authored
llvm-svn: 133147
-
John McCall authored
before it on the link line. llvm-svn: 133145
-
John McCall authored
llvm-svn: 133144
-
Chandler Carruth authored
pattern found in the wild where this warning was firing. llvm-svn: 133143
-
Jakob Stoklund Olesen authored
compares. 2^30 is actually the limit on the number of physical registers per TargetRegisterInfo.h. llvm-svn: 133142
-
Jakob Stoklund Olesen authored
This should unbreak the native ARM testers. llvm-svn: 133141
-
Argyrios Kyrtzidis authored
llvm-svn: 133140
-
Eli Friedman authored
llvm-svn: 133139
-
Chandler Carruth authored
llvm-svn: 133138
-
Chandler Carruth authored
c-index-test and friends. This brings the failures on CMake clang tests from 23 to 2 on Linux. llvm-svn: 133137
-
Chandler Carruth authored
argument types for mem{set,cpy,move}. Character pointers, much like void pointers, often point to generic "memory", so trying to check whether they match the type of the argument to 'sizeof' (or other checks) is unproductive and often results in false positives. Nico, please review; does this miss any of the bugs you were trying to find with this warning? The array test case you had should be caught by the array-specific sizeof warning I think. llvm-svn: 133136
-
Eli Friedman authored
llvm-svn: 133134
-
Nick Lewycky authored
llvm-svn: 133133
-
Andrew Trick authored
llvm-svn: 133132
-
Andrew Trick authored
REQUIRES: Asserts REQUIRES: Debug This required chaining test configuration properties. It seems like a generally good thing to do. llvm-svn: 133131
-
Andrew Trick authored
llvm-svn: 133130
-
John McCall authored
linking unnecessarily into libclang. llvm-svn: 133129
-
Chad Rosier authored
llvm-svn: 133128
-
Chad Rosier authored
accumulator forwarding. Specifically (from SVN log entry): Distribute (A + B) * C to (A * C) + (B * C) to make use of NEON multiplier accumulator forwarding: vadd d3, d0, d1 vmul d3, d3, d2 => vmul d3, d0, d2 vmla d3, d1, d2 Make sure it catches cases where operand 1 is add/fadd/sub/fsub, which was intended in the original revision. llvm-svn: 133127
-
John McCall authored
llvm-svn: 133125
-
Nick Lewycky authored
llvm-svn: 133124
-
John McCall authored
complaining about mismatches in the global method pool. llvm-svn: 133123
-
Chandler Carruth authored
be more consistent in how parenthesized ranges which hit macros are handled. Also makes the code significantly shorter, and the diagnostics when macros are present a bit more useful. Pair programmed w/ Matthew. llvm-svn: 133122
-
Chandler Carruth authored
pretty. In particular this makes it much easier for me to read messages such as: x.cc:42: ?: has lower ... Where I'm inclined to associate the third ':' with a missing column number, but in fact column numbers have been turned off. Similar punctuation collisions happened elsewhere as well. llvm-svn: 133121
-
Chandler Carruth authored
llvm-svn: 133120
-
Argyrios Kyrtzidis authored
[arcmt] Make arcmt-test accept cc1 options to make it more portable and hopefully fix MSVC failures. llvm-svn: 133119
-
Bruno Cardoso Lopes authored
llvm-svn: 133118
-
John McCall authored
llvm-svn: 133116
-
Anna Zaks authored
llvm-svn: 133115
-
John McCall authored
on all platforms in non-ARC mode. llvm-svn: 133114
-
Anna Zaks authored
Function::getNumBlockIDs() should be used instead of Function::size() to set the upper limit on the block IDs since basic blocks might get removed (simplified away) after being initially numbered. Plus the test case, in which SelectionDAGBuilder::visitBr() calls llvm::MachineFunction::removeFromMBBNumbering(), which introduces the hole in numbering leading to an assert in llc (prior to the fix). llvm-svn: 133113
-