Граф коммитов

23674 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 349d38cef0 Move include to the proper place. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 23:08:34 +00:00
Douglas Gregor a5fb7c3b56 Implement support for cached code completions for
nested-name-specifiers. Also includes fixes to the generation of
nested-name-specifier result in the non-cached case; we were producing
lame results for namespaces and namespace aliases, which (1) didn't
always have nested-name-specifiers when we want them, and (2) did not
have the necessary "::" as part of the completion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 23:05:20 +00:00
Fariborz Jahanian 57dae1a312 Diagnose assiging to an interface object in
non-fragile abi mode as sizes are not statically known.
Fixes radar 8315734.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:51:12 +00:00
Tom Care 50e8ac2369 Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:43:52 +00:00
Douglas Gregor 5535d5721b Formatting fixes. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:23:13 +00:00
Douglas Gregor 5f808c2bfe Implement name hiding of cached global code-completion results.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:18:39 +00:00
Jordy Rose d5addb4839 Instead of using operator bool() for testing if a BindingKey is valid, use an explicit isValid() method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 20:53:01 +00:00
Jordy Rose 1802eebad8 Move GRState::AssumeInBound out of its header file -- it's not really inline-friendly anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 20:34:06 +00:00
Douglas Gregor 697ca6dc94 Move some code out-of-line which has long since grown too large to be
inlined. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 20:01:48 +00:00
Sebastian Redl e55fd871b0 Add two options for playing with modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:17:11 +00:00
Douglas Gregor f5586f6b31 When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit. 

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:08:11 +00:00
Fariborz Jahanian d657742862 Fix a crash when parsing malformed out-of-line member function
definition. radar 8307865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:58:53 +00:00
Argyrios Kyrtzidis 881b36ccbf Fix initialization for members of anonymous struct in a union.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111159 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:27:13 +00:00
Argyrios Kyrtzidis dd7744d01e Emit diagnostic error when the field of an anonymous struct is non trivial.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:27:08 +00:00
Douglas Gregor c4421e966d Dereferencing NULL pointers is such poor form.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:46:30 +00:00
Anton Yartsev 05e3555b21 support for vec_add, vec_adds, vec_and, vec_andc with bool arguments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:22:12 +00:00
Douglas Gregor 1827e10051 When caching global completion results, keep track of the simplified
type class, so that we can adjust priorities appropriately when the
preferred type for the context and the actual type of the completion
are similar.

This gets us one step closer to parity of the cached completion
results with the non-cached completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111139 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:18:59 +00:00
Abramo Bagnara 6f1bd66748 Fixed typo in conj, conjf, conjl signature.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:57:05 +00:00
Jordy Rose e64f311c11 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 07:51:42 +00:00
Charles Davis f231df318d Error out if reinterpret_casting between member pointers of two different
sizes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 05:30:44 +00:00
Charles Davis d18f9f965b Err on incomplete class types in member pointers when compiling for the
Microsoft C++ ABI, for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 04:01:50 +00:00
Charles Davis 071cc7deff 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 03:33:14 +00:00
Jordy Rose e701117b21 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 01:15:17 +00:00
David Chisnall c736377543 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 22:58:12 +00:00
Jordy Rose 52082aff1c Move GRState's bind* methods out of its header file -- they're too big for inlining now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 22:19:33 +00:00
Argyrios Kyrtzidis 7b3e3f6bf6 Call the base class in StmtProfiler::VisitOverloadExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 20:53:20 +00:00
Benjamin Kramer 1395c5d005 Open AST/PCH files in binary mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 16:54:31 +00:00
Nick Lewycky 96872c4470 Make the FixItOptions object required instead of optional.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 16:47:39 +00:00
Zhongxing Xu 5e4cb347cb StoreManager::RemoveDeadBindings() can take a Store instead of an entire GRState now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 12:45:09 +00:00
Argyrios Kyrtzidis c83d2d7d89 Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:17:39 +00:00
Argyrios Kyrtzidis 06999f8ff6 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
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:17:33 +00:00
Zhongxing Xu 57663fe6c3 Remove redundant method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:08:38 +00:00
Zhongxing Xu 173ff56696 Implement MallocChecker::EvalDeadSymbols() with the new API. This time we
iterate over symbols being tracked, instead of symbols being dead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 08:19:57 +00:00
Douglas Gregor 8071e4212a 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 06:18:01 +00:00
Eli Friedman de7a0fcdf9 Use Enumerators.data() instead of &Enumerators[0] to fix a potential
assertion failure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 02:27:09 +00:00
Argyrios Kyrtzidis ba6f816d63 Remove dead code, caught by unused function warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:58 +00:00
Argyrios Kyrtzidis 469865cf50 DependentTypeOfExprType and DependentDecltypeType are not seen by client code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:44 +00:00
Argyrios Kyrtzidis c35919b637 Call the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:38 +00:00
Argyrios Kyrtzidis 78e4cc70cf Some refactoring on StmtPrinter to avoid unused function warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:33 +00:00
Argyrios Kyrtzidis ed635e4bff Add ATTRIBUTE_UNUSED to methods not supposed to be used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:27 +00:00
Argyrios Kyrtzidis bbc6454bb9 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 01:15:20 +00:00
Eli Friedman f2aabe199a Explicitly handle every case in the switch in RTTIBuilder::BuildTypeInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 00:24:31 +00:00
Nick Lewycky 48d64fbb31 Remember that FixItOptions* is optional and don't crash when it's not provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 23:03:19 +00:00
Jordy Rose a526154975 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().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 21:02:52 +00:00
Eli Friedman 43efa31fe6 PR7884: Fix the implementations of __real__ and __imag__ on real floats.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 20:52:13 +00:00
Jordy Rose 8556cc44af Add a test for alloca region extents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 20:46:10 +00:00
Jordy Rose c2b7dfaad6 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 20:44:32 +00:00
Jordy Rose 873f3dea54 Another metadata symbol change (missed a file)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 20:22:12 +00:00
Jordy Rose bd533aa4ff 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 20:18:45 +00:00
John McCall 838d796d02 More cleanup enabling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 07:46:19 +00:00