Commit Graph

89109 Commits

Author SHA1 Message Date
Jordy Rose 722f558f07 Model the effects of strcpy() and stpcpy() in CStringChecker. Other changes:
- Fix memcpy() and friends to actually invalidate the destination buffer.
- Emit a different message for out-of-bounds buffer accesses if the buffer is being written to.
- When conjuring symbols, let ValueManager figure out the type.

llvm-svn: 111120
2010-08-16 07:51:42 +00:00
Charles Davis ebab1ed5d3 Error out if reinterpret_casting between member pointers of two different
sizes.

llvm-svn: 111119
2010-08-16 05:30:44 +00:00
Charles Davis 2d3694297d Err on incomplete class types in member pointers when compiling for the
Microsoft C++ ABI, for now.

llvm-svn: 111118
2010-08-16 04:01:50 +00:00
Charles Davis 53c59df2f7 Implement support for member pointers under the Microsoft C++ ABI in the
AST library.

This also adds infrastructure for supporting multiple C++ ABIs in the AST.

llvm-svn: 111117
2010-08-16 03:33:14 +00:00
Jordy Rose df28e8ec41 - Allow making ElementRegions with complex offsets (expressions or symbols) for the purpose of bounds-checking.
- Rewrite GRState::AssumeInBound to actually do that checking, and to use the normal constraint path.
- Remove ConstraintManager::AssumeInBound.
- Teach RegionStore and FlatStore to ignore those regions for now.

llvm-svn: 111116
2010-08-16 01:15:17 +00:00
Benjamin Kramer cbc55d9dc0 Test expects SSE, give him SSE.
llvm-svn: 111115
2010-08-15 23:32:03 +00:00
David Chisnall 589a494352 Pass some things to the linker that gcc passes. -r is the only one of these that I'm sure about, but the others seem to be listed on FreeBSD by gcc -dumpspecs, so I hope they're right. Apparently -r is also not passed on GNU/Linux (and should be), but I can't see where the toolchain definition for this platform live.
llvm-svn: 111114
2010-08-15 22:58:12 +00:00
Jordy Rose d2b777a409 Move GRState's bind* methods out of its header file -- they're too big for inlining now.
llvm-svn: 111113
2010-08-15 22:19:33 +00:00
Oscar Fuentes 53339a737f Updated LLVMLibDeps.cmake
llvm-svn: 111112
2010-08-15 22:14:42 +00:00
Oscar Fuentes 5b823e0821 CMake: Improved COMMENT on a custom command
llvm-svn: 111111
2010-08-15 22:14:36 +00:00
Argyrios Kyrtzidis b482eb8b28 Call the base class in StmtProfiler::VisitOverloadExpr.
llvm-svn: 111110
2010-08-15 20:53:20 +00:00
Benjamin Kramer 4566466b7f Restore arch on these test, they fail on arm.
llvm-svn: 111109
2010-08-15 20:42:56 +00:00
Dale Johannesen 339423c460 Mark as XFAIL on darwin 8. PR 7886.
llvm-svn: 111108
2010-08-15 19:40:29 +00:00
Benjamin Kramer 340045b204 Open AST/PCH files in binary mode.
llvm-svn: 111106
2010-08-15 16:54:31 +00:00
Nick Lewycky 53f1042dc1 Make the FixItOptions object required instead of optional.
llvm-svn: 111105
2010-08-15 16:47:39 +00:00
Oscar Fuentes 8146b6ccd9 Updated the GenLibDeps -> LLVMLibDeps.cmake transformation example.
llvm-svn: 111104
2010-08-15 15:08:27 +00:00
Zhongxing Xu ee770d40fd StoreManager::RemoveDeadBindings() can take a Store instead of an entire GRState now.
llvm-svn: 111103
2010-08-15 12:45:09 +00:00
Argyrios Kyrtzidis d0fcc9a818 Revert r111082. No warnings for this common pattern.
llvm-svn: 111102
2010-08-15 10:27:23 +00:00
Argyrios Kyrtzidis 499e6e49e7 Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.
llvm-svn: 111101
2010-08-15 10:17:39 +00:00
Argyrios Kyrtzidis 04c7fa09e4 Don't warn for the common pattern of disallowing copying:
class S {
  S(const S&); // DO NOT IMPLEMENT
  void operator=(const S&); // DO NOT IMPLEMENT
};

llvm-svn: 111100
2010-08-15 10:17:33 +00:00
Zhongxing Xu 0ba9fd6c47 Remove redundant method.
llvm-svn: 111099
2010-08-15 10:08:38 +00:00
Zhongxing Xu bce831f7e0 Implement MallocChecker::EvalDeadSymbols() with the new API. This time we
iterate over symbols being tracked, instead of symbols being dead.

llvm-svn: 111097
2010-08-15 08:19:57 +00:00
Mikhail Glushenkov b1ec90bcf4 Update tests.
llvm-svn: 111096
2010-08-15 07:07:24 +00:00
Mikhail Glushenkov 6ba0ca7f40 Regenerate.
llvm-svn: 111095
2010-08-15 07:07:17 +00:00
Mikhail Glushenkov 938e976b90 llvmc: remove dynamic plugins.
llvm-svn: 111094
2010-08-15 07:07:12 +00:00
Douglas Gregor 3998219789 Extend the code-completion caching infrastructure to include global
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters. 

There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.

Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.

llvm-svn: 111093
2010-08-15 06:18:01 +00:00
Eli Friedman f8d9817f4b Use Enumerators.data() instead of &Enumerators[0] to fix a potential
assertion failure.

llvm-svn: 111092
2010-08-15 02:27:09 +00:00
Argyrios Kyrtzidis 1cec2cc798 Remove dead code, caught by unused function warnings.
llvm-svn: 111091
2010-08-15 01:15:58 +00:00
Argyrios Kyrtzidis c99bab034c DependentTypeOfExprType and DependentDecltypeType are not seen by client code.
llvm-svn: 111090
2010-08-15 01:15:44 +00:00
Argyrios Kyrtzidis f4505457f8 Call the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.
llvm-svn: 111089
2010-08-15 01:15:38 +00:00
Argyrios Kyrtzidis 3080553b10 Some refactoring on StmtPrinter to avoid unused function warnings.
llvm-svn: 111088
2010-08-15 01:15:33 +00:00
Argyrios Kyrtzidis 0a33cb62a6 Add ATTRIBUTE_UNUSED to methods not supposed to be used.
llvm-svn: 111087
2010-08-15 01:15:27 +00:00
Argyrios Kyrtzidis 1b30d9c0f0 Commit improved version of 111026 & 111027.
Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

llvm-svn: 111086
2010-08-15 01:15:20 +00:00
Eli Friedman 1bb53d9cd6 Explicitly handle every case in the switch in RTTIBuilder::BuildTypeInfo.
llvm-svn: 111085
2010-08-15 00:24:31 +00:00
Nick Lewycky 0db53e433e Remember that FixItOptions* is optional and don't crash when it's not provided.
llvm-svn: 111084
2010-08-14 23:03:19 +00:00
Eric Christopher 54194bd127 Rework how the non-sse2 memory barrier is lowered so that the
encoding is correct for the built-in assembler.

Based on a patch from Chris.

llvm-svn: 111083
2010-08-14 21:51:50 +00:00
Argyrios Kyrtzidis 7c09ddf0ae Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
llvm-svn: 111082
2010-08-14 21:35:10 +00:00
Jordy Rose 2a2e21c902 Update CStringChecker to take advantage of the new metadata symbols and region change callback. Now does basic tracking of string length for general regions. Currently this is still only used for modeling strlen().
llvm-svn: 111081
2010-08-14 21:02:52 +00:00
Eli Friedman 9571953f36 PR7884: Fix the implementations of __real__ and __imag__ on real floats.
llvm-svn: 111080
2010-08-14 20:52:13 +00:00
Jordy Rose a797475712 Add a test for alloca region extents.
llvm-svn: 111079
2010-08-14 20:46:10 +00:00
Jordy Rose ac0ab20e3b Add a callback for when region changes occur. Still somewhat of a work-in-progress, but working! Effect on clients: all changes to a store now go through GRState.
llvm-svn: 111078
2010-08-14 20:44:32 +00:00
Jordy Rose 1f3a553b9b Another metadata symbol change (missed a file)
llvm-svn: 111077
2010-08-14 20:22:12 +00:00
Jordy Rose 7fa9bf05bc Add a new metadata symbol type for checkers to use. Metadata symbols must be associated with a region and will be collected if the region dies or its checker fails to mark it as in use.
llvm-svn: 111076
2010-08-14 20:18:45 +00:00
Howard Hinnant 51e3967484 [re.alg.match]
llvm-svn: 111075
2010-08-14 19:58:44 +00:00
Howard Hinnant 48b242a275 Everything under [re.results]
llvm-svn: 111074
2010-08-14 18:14:02 +00:00
Chris Lattner 2f6c3434ac improve indentation
llvm-svn: 111073
2010-08-14 17:26:09 +00:00
John McCall 32427785c0 More cleanup enabling.
llvm-svn: 111070
2010-08-14 07:46:19 +00:00
Bob Wilson bffc757df7 T2I_rbin_irs rr variant is for disassembly only, so don't provide a pattern.
llvm-svn: 111068
2010-08-14 03:18:29 +00:00
Eli Friedman df2392572e PR3344: Downgrade "too many braces around scalar initializer" to a warning.
llvm-svn: 111067
2010-08-14 03:14:53 +00:00
Ted Kremenek aa01481d78 Always recurse into sub-cursors when annotating tokens, as this information is used for annotating macro arguments. This finishes up <rdar://problem/8044584>.
llvm-svn: 111066
2010-08-14 02:50:46 +00:00