Steve Naroff
9fa72ef7e8
Fix <rdar://problem/6435842> clang ObjC rewriter: #include Block.h, Block_private.h or come up with #define to prevent double-definition
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 19:43:14 +00:00
Sebastian Redl
61364dddc3
Convert a number of statement parsers to smart pointers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 19:30:53 +00:00
Steve Naroff
f4312dc9b6
Fix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and blocks don't work together
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 19:29:16 +00:00
Douglas Gregor
a4c46df1cd
Actually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 17:59:21 +00:00
Douglas Gregor
44b4321fea
Unifies the name-lookup mechanisms used in various parts of the AST
...
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).
* Implement C++ qualified name lookup in terms of lookup into
DeclContext.
* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)
* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.
* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).
* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 16:49:14 +00:00
Zhongxing Xu
c5458622a3
Identify AnonPointeeRegion by the symbol that is concretized.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60870 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 09:08:46 +00:00
Zhongxing Xu
3bb662a863
AnonPointeeRegions are now identified by the MemRegion of the pointer pointing
...
to them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 02:27:34 +00:00
Ted Kremenek
83df2d2301
Updated checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 00:20:13 +00:00
Anders Carlsson
5abfe2c236
Add another complex promotion test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 23:57:51 +00:00
Anders Carlsson
5b1f3f0b21
Make sure to promote expressions of the form (floating point + complex integer) correctly, to (complex floating point + complex floating point)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 23:30:05 +00:00
Ted Kremenek
bc0f6bc039
PreprocessorLexer (and subclasses):
...
- Added virtual method 'getSourceLocation()' (no arguments) that gets the location of the next "observable" location (e.g., next character, next token).
PPLexerChange.cpp:
- Implemented FIXME by using PreprocessorLexer::getSourceLocation() to get the location in the file we are returning to after lexing a #included file. This appears to be slightly faster than having the branch (i.e., 'if(CurLexer)'). It's also not a really hot part of the Preprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60860 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 23:20:59 +00:00
Douglas Gregor
caaf29a087
Added a warning when referencing an if's condition variable in the
...
"else" clause, e.g.,
if (int X = foo()) {
} else {
if (X) { // warning: X is always zero in this context
}
}
Fixes rdar://6425550 and lets me think about something other than
DeclContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 23:01:14 +00:00
Steve Naroff
bc76dd06eb
The "real" fix for <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,
...
Commit r60845 was premature.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60852 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 22:14:21 +00:00
Douglas Gregor
2988205cb3
Fix PR clang/3175: CheckAddressOfOperand does not handle references to class vars
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 21:26:49 +00:00
Douglas Gregor
83f96f668d
Some cleanups to the dependent-types commit, as suggested by Sebastian
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 20:57:37 +00:00
Steve Naroff
4e78fd0a96
Fix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 20:07:25 +00:00
Ted Kremenek
cf58e6249c
Declare PerIDCache as IdentifierInfo** instead of void*. This is just cleaner. No performance change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 19:40:23 +00:00
Steve Naroff
c0febd58f5
Fix <rdar://problem/6418623> Bogus block type compatibility warning.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 17:49:55 +00:00
Steve Naroff
e58ee0ca7c
Fix regression caused by fixing <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60839 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 14:53:27 +00:00
Douglas Gregor
8935b8b490
Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60830 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 06:34:36 +00:00
Anders Carlsson
565c99f45e
Append an extra newline to the module inline asm if it's not empty.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 02:21:04 +00:00
Ted Kremenek
4dc506cbbc
Updated checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 00:50:24 +00:00
Fariborz Jahanian
391d895370
Patch to allow a getter call using property dot-syntax notation.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 00:21:50 +00:00
Sebastian Redl
effa8d1c97
Modify the move emulation according to the excellent design of Howard Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 00:02:53 +00:00
Ted Kremenek
1d6c14bd27
Fix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer an AnonTypedRegion on top of it.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 23:50:57 +00:00
Fariborz Jahanian
91b51a92f2
Prevent bogus warning on unimplemented setter/getter when user
...
has added declaration of these methods in its @interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60803 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 22:43:22 +00:00
Ted Kremenek
7d71b296c7
Have BasicStoreManager::getLValueElement() have logic similar to BasicStoreManager::getLValueField() (i.e., don't just return the 'base' as the SVal)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 21:20:27 +00:00
Steve Naroff
d82565fee6
Add testcase for commit r60781.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60793 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 20:59:16 +00:00
Fariborz Jahanian
fef30b5523
Support for implementation of property in the case where
...
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 20:23:04 +00:00
Sebastian Redl
15faa7fdfb
Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResult
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 20:22:58 +00:00
Ted Kremenek
2fda504dcc
Add preliminary CFG support for @throw. We basically treat it like a return statement.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60790 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 20:20:09 +00:00
Ted Kremenek
bbfd07a0c9
In GRExprEngine treat @throw as an 'abort' that ends the current path. This is a temporary solution.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 20:18:58 +00:00
Sebastian Redl
7f792faf0c
Lay the groundwork for converting the entire parser-sema chain to smart pointers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 19:36:21 +00:00
Steve Naroff
6082c62125
Sema::ActOnMethodDeclaration(): Make sure we perform the default function/array conversion for parameter types.
...
This fixes <rdar://problem/6424064> checker on xcode: (possible bad AST) can the type of a method parameter really have "isFunctionType() == true"?
and http://llvm.org/bugs/show_bug.cgi?id=2997 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 19:36:17 +00:00
Chris Lattner
c9f29c6185
Fix a serious null termination bug found by David Chisnall!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 19:10:54 +00:00
Sebastian Redl
8b9ad38dab
Fill in C++ status table for expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 14:40:01 +00:00
Sebastian Redl
0e9eabca26
Consistently use smart pointers for stmt and expr nodes in parser local variables.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 13:15:23 +00:00
Steve Naroff
b619d957b0
Fix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties
...
More fancy footwork to cope with rewriting property 'setters'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 12:56:34 +00:00
Zhongxing Xu
0bc27eab20
initialize member variable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 12:26:46 +00:00
Zhongxing Xu
2fdf555af1
Add utility method. Remove an unused method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 10:51:19 +00:00
Ted Kremenek
159d2487e6
[static analyzer] Extend VLA size checking to look for undefined sizes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:44:16 +00:00
Ted Kremenek
ca9bab0dcb
Update Driver to new interface for LiveVariables.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:17:51 +00:00
Ted Kremenek
8322d6a4fc
Add zero-sized VLA check test case.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:14:48 +00:00
Ted Kremenek
e0dbda1364
Fixed LiveVariables bug where we didn't consider block-level expressions that functioned as the size of a VLA to be live.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:14:14 +00:00
Fariborz Jahanian
447d7aeb94
Change condition under which 'retain'/'copy' are directly evaluated.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60729 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 23:56:17 +00:00
Ted Kremenek
efd5994d6a
Add checking for zero-sized VLAs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 22:47:34 +00:00
Ted Kremenek
26b58cd65f
Incorporate MissingDealloc_IBOutlet.m test case into MissingDealloc.m
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60722 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 22:05:43 +00:00
Ted Kremenek
63de736356
Incorporate MissingDeallc_SEL.m test case into MissingDealloc.m
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60721 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 22:01:50 +00:00
Ted Kremenek
e0bb804cee
Add test case for <rdar://problem/6380411>.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 21:59:21 +00:00
Chris Lattner
90b93d6f69
Fix PR3172: if we see an eof or } at the top level, reject it.
...
This is important because ParseDeclarationOrFunctionDefinition
skips to, but does not consume, an } on error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60719 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 21:59:01 +00:00