Commit Graph

24854 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis beb71b315a Rename -Wunused-method -> -Wunused-member-function.
llvm-svn: 111305
2010-08-17 22:06:44 +00:00
Ted Kremenek 5c3cea7b09 Remove dead code.
llvm-svn: 111304
2010-08-17 22:05:33 +00:00
John McCall 6d86202fa7 Whoops. Don't fall through into the overload case when mangling a
dependent call expression.

llvm-svn: 111300
2010-08-17 21:51:21 +00:00
Argyrios Kyrtzidis cad715fb9b Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.
This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.

llvm-svn: 111298
2010-08-17 21:43:11 +00:00
Fariborz Jahanian 798f83239c Diagnose use of iboutletcollection on ivar/property
of non-object types. Radar 8308053.

llvm-svn: 111296
2010-08-17 21:39:27 +00:00
John McCall 815039af77 Implicit decl ref expressions might not have name locations; don't silently
fail to instantiate them.

llvm-svn: 111293
2010-08-17 21:27:17 +00:00
Sebastian Redl 7940e6fb1d Fix CMake build
llvm-svn: 111284
2010-08-17 21:00:23 +00:00
Ted Kremenek 4f2ab5a549 Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop. This would cause
the body of the DoStmt to be disconnected from the preceding code.

llvm-svn: 111283
2010-08-17 21:00:06 +00:00
Ted Kremenek 110974dfa4 CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop edge can never be taken.
llvm-svn: 111282
2010-08-17 20:59:56 +00:00
Sebastian Redl 135bcc791b Reintroduce the serialization library, with fixed dependencies.
llvm-svn: 111279
2010-08-17 20:43:28 +00:00
Fariborz Jahanian b5d59b66c2 Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.

llvm-svn: 111275
2010-08-17 20:23:12 +00:00
Douglas Gregor 600c4f6d84 Remove the last bit of the Clang Serialization library, for now
llvm-svn: 111267
2010-08-17 19:00:27 +00:00
Douglas Gregor 256a7282e4 Revert Sebastian's build-breaking patch.
llvm-svn: 111265
2010-08-17 18:31:01 +00:00
Dan Gohman b1e20869a2 Add the clangSerialization library to libclang.
llvm-svn: 111261
2010-08-17 18:07:30 +00:00
Sebastian Redl 52ce9bb2fb Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.
llvm-svn: 111258
2010-08-17 17:55:49 +00:00
Sebastian Redl ea68af43e8 Fix a typo in a diag name.
llvm-svn: 111257
2010-08-17 17:55:38 +00:00
Daniel Dunbar 71323e66b6 Remove a gratuitous lie.
llvm-svn: 111253
2010-08-17 17:34:48 +00:00
Douglas Gregor 175ea046ee A member function never has "C" linkage. Fixes <rdar://problem/8318976>.
llvm-svn: 111238
2010-08-17 16:09:23 +00:00
Douglas Gregor 7116a8c19a When generating code completion patterns for method declarations, give
the resulting pattern the appropriate cursor kind of an instance or
class method declaration.

llvm-svn: 111237
2010-08-17 16:06:07 +00:00
Chris Lattner b5050f3cd0 apparently msvc defines _STDCALL_SUPPORTED, so we should
too.  Patch by Per Linden!

llvm-svn: 111236
2010-08-17 16:02:32 +00:00
Chris Lattner d28e6cc554 Add a slightly better hack for microsoft style inline asm,
patch by Per Linden!

llvm-svn: 111235
2010-08-17 16:00:12 +00:00
Chris Lattner c0a585d63c Implement #pragma push_macro, patch by Francois Pichet!
llvm-svn: 111234
2010-08-17 15:55:45 +00:00
Douglas Gregor b0ce9b79ba 1 != I. Fix the formulation of code-completion patterns for
Objective-C method declarations with > 2 parameters.

llvm-svn: 111233
2010-08-17 15:53:35 +00:00
Benjamin Kramer 35b077e674 Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData().  Patch by Peter Davies (with some tweaks).

llvm-svn: 111229
2010-08-17 12:54:38 +00:00
John McCall 3696dcb171 Don't try to initialize a reference with a constructed temporary if either
of the classes is invalid.  A class is invalid if a base is invalid.

llvm-svn: 111227
2010-08-17 07:23:57 +00:00
Douglas Gregor 2c8bd47a6a When the # of top-level declarations changes after reparsing a
translation unit, refresh code-completion results because they've
probably changed. However, enforce a cooldown period between
refreshes, to avoid thrashing.

llvm-svn: 111218
2010-08-17 00:40:40 +00:00
Zhongxing Xu a66d1694f4 Generate a node instead of a sink. A leak is not a fatal error.
llvm-svn: 111217
2010-08-17 00:36:37 +00:00
John McCall 2677e10732 A field of incomplete type is sufficiently disruptive that we should mark
the record invalid.

llvm-svn: 111211
2010-08-16 23:42:35 +00:00
Eli Friedman c3e9df3cc0 Move a bunch of code out of the ComplexExprEvaluator class definition;
no functionality change.

llvm-svn: 111207
2010-08-16 23:27:44 +00:00
Jordy Rose 5ccde8593f Allow the "size" of a buffer access check to be either signed or unsigned. Fixes PR7925.
llvm-svn: 111205
2010-08-16 23:25:19 +00:00
Douglas Gregor 40a5a7de1d Move include to the proper place. No functionality change
llvm-svn: 111204
2010-08-16 23:08:34 +00:00
Douglas Gregor 59cab5564f 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.

llvm-svn: 111203
2010-08-16 23:05:20 +00:00
Fariborz Jahanian 99311ba1a8 Diagnose assiging to an interface object in
non-fragile abi mode as sizes are not statically known.
Fixes radar 8315734.

llvm-svn: 111191
2010-08-16 21:51:12 +00:00
Tom Care c129cc18f0 Added basic psuedoconstant checking in IdempotentOperationChecker and fixed some test cases.
llvm-svn: 111190
2010-08-16 21:43:52 +00:00
Douglas Gregor df239670d4 Formatting fixes. No functionality change
llvm-svn: 111186
2010-08-16 21:23:13 +00:00
Douglas Gregor 6199f2d146 Implement name hiding of cached global code-completion results.
llvm-svn: 111184
2010-08-16 21:18:39 +00:00
Jordy Rose 63a38a1b94 Instead of using operator bool() for testing if a BindingKey is valid, use an explicit isValid() method.
llvm-svn: 111181
2010-08-16 20:53:01 +00:00
Jordy Rose 4a57ec86bb Move GRState::AssumeInBound out of its header file -- it's not really inline-friendly anymore.
llvm-svn: 111179
2010-08-16 20:34:06 +00:00
Douglas Gregor d46cf182a4 Move some code out-of-line which has long since grown too large to be
inlined. No functionality change.

llvm-svn: 111176
2010-08-16 20:01:48 +00:00
Sebastian Redl 6ebb51a41d Add two options for playing with modules.
llvm-svn: 111166
2010-08-16 18:17:11 +00:00
Douglas Gregor b61c07aca0 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.

llvm-svn: 111165
2010-08-16 18:08:11 +00:00
Fariborz Jahanian 055068df4a Fix a crash when parsing malformed out-of-line member function
definition. radar 8307865.

llvm-svn: 111163
2010-08-16 17:58:53 +00:00
Argyrios Kyrtzidis a3ae3eb690 Fix initialization for members of anonymous struct in a union.
llvm-svn: 111159
2010-08-16 17:27:13 +00:00
Argyrios Kyrtzidis 33aee3934a Emit diagnostic error when the field of an anonymous struct is non trivial.
llvm-svn: 111158
2010-08-16 17:27:08 +00:00
Douglas Gregor 247474085e Dereferencing NULL pointers is such poor form.
llvm-svn: 111150
2010-08-16 16:46:30 +00:00
Anton Yartsev 2cc136d4e3 support for vec_add, vec_adds, vec_and, vec_andc with bool arguments
llvm-svn: 111141
2010-08-16 16:22:12 +00:00
Douglas Gregor 6e24033bd2 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.

llvm-svn: 111139
2010-08-16 16:18:59 +00:00
Abramo Bagnara 217e902b1d Fixed typo in conj, conjf, conjl signature.
llvm-svn: 111134
2010-08-16 15:57:05 +00:00
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