Tom Care
82b2a1dada
Improved the handling of blocks and block variables in PseudoConstantAnalysis
...
- Removed the assumption that __block vars are all non-constant
- Simplified some repetitive code in RunAnalysis
- Added block walking support
- Code/comments cleanup
- Separated out test for block pseudoconstants
llvm-svn: 112098
2010-08-25 22:37:26 +00:00
John McCall
8302463dc6
Split out a header to hold APIs meant for the Sema implementation from Sema.h.
...
Clients of Sema don't need to know (for example) the list of diagnostics we
support.
llvm-svn: 112093
2010-08-25 22:03:47 +00:00
Dan Gohman
1869693150
Fix a typo.
...
llvm-svn: 112092
2010-08-25 21:59:25 +00:00
Douglas Gregor
0de55cecb2
When combining the code-completion results from Sema long with the
...
code-completion results cached by ASTUnit, sort the resulting result
set. This makes testing far, far easier, so this commit also includes
tests for the previous few fixes.
llvm-svn: 112070
2010-08-25 18:41:16 +00:00
Douglas Gregor
f11096c99c
Initialize the translation-unit scope before lexing the first
...
token. The first token might be something that ends up triggering code
completion, which in turn requires a valid Scope. Test case forthcoming.
llvm-svn: 112066
2010-08-25 18:07:12 +00:00
Douglas Gregor
ea7363732a
Add a code-completion context for "natural language" completions, so
...
that ASTUnit knows not to try to provide completions there.
llvm-svn: 112057
2010-08-25 17:10:00 +00:00
Douglas Gregor
115837041e
Introduce a preprocessor code-completion hook for contexts where we
...
expect "natural" language and should not provide any completions,
e.g., comments, string literals, #error.
llvm-svn: 112054
2010-08-25 17:04:25 +00:00
Douglas Gregor
334a10a343
Implement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.
...
llvm-svn: 112049
2010-08-25 15:47:31 +00:00
Benjamin Kramer
12367e30e0
Silence a GCC warning saying that unsigned >= UO_PostInc is always true.
...
llvm-svn: 112048
2010-08-25 13:24:04 +00:00
John McCall
e302792b61
GCC didn't care for my attempt at API compatibility, so brute-force everything
...
to the new constants.
llvm-svn: 112047
2010-08-25 11:45:40 +00:00
John McCall
1bcddcaab3
Random space optimization.
...
llvm-svn: 112046
2010-08-25 10:44:55 +00:00
John McCall
2536c6da0e
More incremental progress towards not including Expr.h in Sema.h.
...
llvm-svn: 112044
2010-08-25 10:28:54 +00:00
Chandler Carruth
5408017356
Rename *PendingImplicitInstantiations to *PendingInstantiations. No
...
functionality changed.
llvm-svn: 112040
2010-08-25 08:44:16 +00:00
John McCall
aab3e41eb2
Split FunctionScopeInfo and BlockScopeInfo into their own header.
...
llvm-svn: 112038
2010-08-25 08:40:02 +00:00
John McCall
28a0cf7825
Remove Sema.h's dependency on DeclCXX.h.
...
llvm-svn: 112032
2010-08-25 07:42:41 +00:00
John McCall
a1e130be25
Remove the DenseSet dependency from Sema.h.
...
llvm-svn: 112030
2010-08-25 07:03:20 +00:00
John McCall
276321a9ec
Teach Sema to live without CodeCompleteConsumer.h.
...
llvm-svn: 112028
2010-08-25 06:19:51 +00:00
John McCall
1d570a7e16
Remove AnalysisBasedWarnings.h's dependency on Type.h
...
llvm-svn: 112027
2010-08-25 05:56:39 +00:00
John McCall
19c1bfd1b0
Move more stuff out of Sema.h.
...
llvm-svn: 112026
2010-08-25 05:32:35 +00:00
John McCall
d845c79fe2
Sort the forward declarations.
...
llvm-svn: 112024
2010-08-25 04:28:15 +00:00
Sebastian Redl
3b1bbf7521
Reorganize and verbosely document some of ASTReader's fields.
...
llvm-svn: 112012
2010-08-25 01:03:37 +00:00
Sebastian Redl
8c0afc3d8d
Remove an unused field in ASTReader
...
llvm-svn: 112011
2010-08-25 01:03:30 +00:00
Argyrios Kyrtzidis
eb430fff0d
Make sure CXXABI is destroyed.
...
llvm-svn: 112004
2010-08-25 00:32:08 +00:00
Douglas Gregor
4d755e86b4
Give a slight preference to functions returning "void" when we're
...
performing code completion at the statement level (rather than in an
arbitrary expression).
llvm-svn: 112001
2010-08-24 23:58:17 +00:00
Douglas Gregor
45140a9040
In code-completion contexts where both types and other values are
...
present, prefer values to types, since it's more common to compute
with values than it is to declare new entities or perform type
casts. So, tweak the ranking of types vs. other declarations and
constants accordingly.
llvm-svn: 111998
2010-08-24 23:40:45 +00:00
John McCall
24d189484b
When trying to resolve the address of an overloaded expression,
...
only form pointers-to-member if the expression has the appropriate
form. This avoids assertions later on on invalid code, but also
allows us to properly resolve mixed-staticity overloads.
llvm-svn: 111987
2010-08-24 22:52:39 +00:00
Sebastian Redl
401b39a736
AST writer support for having specializations of templates from earlier in the chain. This ought to finish C++ chained PCH support.
...
llvm-svn: 111986
2010-08-24 22:50:24 +00:00
Sebastian Redl
aba202b430
AST reader support for having specializations of templates from earlier in the chain.
...
llvm-svn: 111985
2010-08-24 22:50:19 +00:00
Daniel Dunbar
d435275c59
Frontend: Add basic -H support.
...
- I didn't implement the GCC "multiple include guard" detection parts, because
it doesn't seem useful or obvious.
llvm-svn: 111983
2010-08-24 22:44:13 +00:00
Chris Lattner
576048657e
correct the -isystem option to not add the -isysroot path. Only the weird
...
-iwithsysroot flag should do that. This fixes rdar://8345942
llvm-svn: 111979
2010-08-24 22:27:37 +00:00
Ted Kremenek
5f0c066062
Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument). Fixes PR 7981.
...
llvm-svn: 111978
2010-08-24 22:24:51 +00:00
Douglas Gregor
ec00a26855
Implement code completion for preprocessor expressions and in macro
...
arguments.
llvm-svn: 111976
2010-08-24 22:20:20 +00:00
Chris Lattner
4b2164cab8
Implement -iwithsysroot, an apple extension which is a close cousin of -isystem.
...
Instead of implementing -isystem, I accidentally implemented this cousin. Next
up is to implement -isystem right.
llvm-svn: 111966
2010-08-24 21:09:16 +00:00
Tom Care
a460311710
Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
...
- Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment)
- BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list
- Remove unnecessary ignore of implicit casts
- Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings
- Updated test cases with deliberate self-assignments
- Fixed bug with C++ references and pseudoconstants
- Added test case for C++ references and pseudoconstants
llvm-svn: 111965
2010-08-24 21:09:07 +00:00
John McCall
5c32be0053
Move some of SemaOverload's API to various places in Overload.h, and kill
...
some of it off completely.
llvm-svn: 111957
2010-08-24 20:38:10 +00:00
Douglas Gregor
127851084d
Implement preprocessor code completion where a macro name is expected,
...
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.
llvm-svn: 111954
2010-08-24 20:21:13 +00:00
Douglas Gregor
3a7ad25eb6
Introduce basic code-completion support for preprocessor directives,
...
e.g., after a "#" we'll suggest #if, #ifdef, etc.
llvm-svn: 111943
2010-08-24 19:08:16 +00:00
John McCall
afad82e4d0
Sema doesn't need these STL headers.
...
llvm-svn: 111926
2010-08-24 17:40:45 +00:00
Douglas Gregor
cd87859346
Teach InheritingConcreteTypeLoc to play nicely with dyn_cast.
...
llvm-svn: 111916
2010-08-24 15:53:44 +00:00
Douglas Gregor
117db7e95a
Parse all kinds of declarations as part of a linkage-specification,
...
from Francois Pichet! Fixes PR7754.
llvm-svn: 111912
2010-08-24 14:14:45 +00:00
John McCall
c5990644b0
It turns out that this template is only instantiated at one type.
...
llvm-svn: 111908
2010-08-24 09:05:15 +00:00
John McCall
cc14d1fd23
More header elimination. The goal of all this is to allow Parser to
...
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.
llvm-svn: 111907
2010-08-24 08:50:51 +00:00
John McCall
bfd822ce64
Remove a header dependency from Sema.h at the cost of some type safety.
...
If someone wants to fix this some other way....
llvm-svn: 111905
2010-08-24 07:32:53 +00:00
John McCall
de6836a384
Struggle mightily against header inclusion in Sema.h.
...
llvm-svn: 111904
2010-08-24 07:21:54 +00:00
John McCall
dadc575b1e
OwningExprResult -> ExprResult. This patch brought to you by
...
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result
llvm-svn: 111903
2010-08-24 06:29:42 +00:00
John McCall
e172be555d
Fold ASTOwningResult back into ActionResult.
...
llvm-svn: 111902
2010-08-24 06:09:16 +00:00
John McCall
ba7bf59503
Abstract out passing around types and kill off ActionBase.
...
llvm-svn: 111901
2010-08-24 05:47:05 +00:00
Douglas Gregor
99fa264a67
Provide code completion results for the context-sensitive Objective-C
...
keywords "in", "out", "inout", "byref", "bycopy", and "oneway".
llvm-svn: 111884
2010-08-24 01:06:58 +00:00
Sebastian Redl
a4071b4fac
Write visible update blocks. No regressions in normal PCH functionality, but no tests for the chain yet.
...
llvm-svn: 111881
2010-08-24 00:50:09 +00:00
Sebastian Redl
d7dce0a44d
Read the UPDATE_VISIBLE record, and add its visible decls to the lookup tables. Also, free the lookup tables when destructing the ASTReader.
...
llvm-svn: 111880
2010-08-24 00:50:04 +00:00