Steve Naroff
cb04e88580
Some fixups to the previous objc/blocks rewriter smerge.
...
llvm-svn: 58262
2008-10-27 18:50:14 +00:00
Ted Kremenek
5778acf5e8
- Move ExprIterator to Stmt.h so that it can be used by classes defined in Stmt.h
...
- Implement child_begin() and child_end() for AsmStmt. Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement.
- Use ExprIterator for performing iteration over input/output operands.
llvm-svn: 58261
2008-10-27 18:40:21 +00:00
Steve Naroff
677ab3ab45
Integrate the blocks and objc rewriters.
...
llvm-svn: 58253
2008-10-27 17:20:55 +00:00
Sebastian Redl
344fc3db3f
Fix some invalid casts that are detected by Sema now or soon.
...
llvm-svn: 58252
2008-10-27 16:34:21 +00:00
Zhongxing Xu
ad4c3ded0d
Add store option to scan-build and ccc-analyzer.
...
llvm-svn: 58248
2008-10-27 14:26:32 +00:00
Zhongxing Xu
144d7554c4
Use ASTContext::getCanonicalType() to get TypedRegion's type.
...
llvm-svn: 58247
2008-10-27 13:35:03 +00:00
Zhongxing Xu
7b700575dd
An ElementRegion is really a typed region. Its super region's type has to be ArrayType.
...
llvm-svn: 58245
2008-10-27 13:17:02 +00:00
Douglas Gregor
89ebcb9d8d
When destroying a translation unit, deallocate its owned declarations in reverse order, because there may be dependencies among the declarations.
...
llvm-svn: 58244
2008-10-27 12:50:38 +00:00
Zhongxing Xu
36d4ade4be
We cannot get precise lvalue for symbolic base array region.
...
llvm-svn: 58243
2008-10-27 12:23:17 +00:00
Steve Naroff
c6db58a6bd
Replace common diagnostic with a convenience function.
...
This simplifies debug of this particular diagnostic (and removes some code clutter).
llvm-svn: 58242
2008-10-27 11:34:16 +00:00
Steve Naroff
1d4a9a31b6
Fix <rdar://problem/6315646> clang on xcode: error: invalid operands to binary expression ('id<NSTableViewDelegate>' and 'XCExtendedArrayController *').
...
There is still a bug here (as the FIXME in the test case indicates). Prior to this patch, the bug would generate an error. Now, we simply do nothing (which is less harmful until we can get it right). The complete bug fix will require changing ASTContext::mergeTypes(), which I'd like to defer for now.
llvm-svn: 58241
2008-10-27 10:33:19 +00:00
Zhongxing Xu
bb18b57f53
Get the canonical type for struct initialization. The original code would crash on TypedefType.
...
llvm-svn: 58236
2008-10-27 09:24:07 +00:00
Zhongxing Xu
b32af436df
Add test for SCA region store.
...
llvm-svn: 58235
2008-10-27 09:21:27 +00:00
Zhongxing Xu
7a2ce566bc
Add test for SCA region store.
...
llvm-svn: 58234
2008-10-27 09:19:25 +00:00
Zhongxing Xu
d7c44059d4
Only loc::MemRegionVal can be modified. This avoids crashing in RegionStore when a function pointer is used as an argument.
...
llvm-svn: 58233
2008-10-27 09:00:08 +00:00
Chris Lattner
66a740e66e
Rename Characteristic_t to CharacteristicKind
...
llvm-svn: 58224
2008-10-27 01:19:25 +00:00
Chris Lattner
69f9bc24f4
Fix the definition of __builtin_va_list on PPC, which was set to the V4 ABI, not the
...
darwin or AIX abis. This fixes PR2904.
llvm-svn: 58222
2008-10-27 01:11:29 +00:00
Chris Lattner
084bc32e0d
make codegen reject initializes with designators, like this:
...
t.c:1:13: error: cannot codegen this designators yet
int a[10] = {2, 4, [8]=9, 10};
^~~~~~~~~~~~~~~~~
llvm-svn: 58220
2008-10-26 23:53:12 +00:00
Chris Lattner
07d754acf1
Remember whether an initlist had a designator in the AST.
...
llvm-svn: 58218
2008-10-26 23:43:26 +00:00
Chris Lattner
248388e313
pass designators into sema. This completes parser-level designator
...
support as far as I know.
llvm-svn: 58217
2008-10-26 23:35:51 +00:00
Chris Lattner
9a53fdc23e
implement some more FIXMEs, by rejecting more bogus stuff in
...
objc mode.
llvm-svn: 58216
2008-10-26 23:29:41 +00:00
Chris Lattner
46dcba6d2d
add some simple designator testcases. Reject things like this:
...
struct foo Y[10] = {
[4] .arr [2] 4 // expected-error {{expected '=' or another designator}}
};
because the "missing equals" extension only is valid if there
is exactly one array designator.
llvm-svn: 58215
2008-10-26 23:22:23 +00:00
Chris Lattner
8aafd35c79
improve comments, build array and array range designator nodes,
...
fix an obscure memory leak.
llvm-svn: 58213
2008-10-26 23:06:54 +00:00
Chris Lattner
7243245a58
improve comments, build a Designation for field designators and
...
improve diagnostic for a malformed field designator.
llvm-svn: 58212
2008-10-26 22:59:19 +00:00
Chris Lattner
e2b5e87f58
restructure ParseInitializerWithPotentialDesignator to make it
...
easier to understand and hack on, no functionality change.
llvm-svn: 58210
2008-10-26 22:49:49 +00:00
Chris Lattner
dde6543731
improve MayBeDesignationStart to do the entire determination
...
about whether a leading identifier is a designator.
llvm-svn: 58207
2008-10-26 22:41:58 +00:00
Chris Lattner
3fa9239f41
inline the decision logic that chooses between an assign expr and brace
...
initializer, avoiding an extra level of calls for silly things like
'int x = 4'.
llvm-svn: 58206
2008-10-26 22:38:55 +00:00
Chris Lattner
f3e58e2ebc
This patch continues parser-level implementation of designators:
...
1. It introduces new parser level abstractions for designators
that are used to communicate between parser and sema.
2. This fixes a FIXME where "identifier ':'" was considered to be
a designator even if it wasn't the first in a designator list.
3. In the "identifier ':'" case, it actually builds the designator
representation.
llvm-svn: 58205
2008-10-26 22:36:07 +00:00
Chris Lattner
0c02460038
minor cleanups
...
llvm-svn: 58203
2008-10-26 21:46:13 +00:00
Sebastian Redl
5cba81afb3
Allow \n for newlines in expected error messages.
...
llvm-svn: 58198
2008-10-26 19:05:16 +00:00
Argyrios Kyrtzidis
22a3735398
Don't give a default argument to ASTContext::getFunctionType for the TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call.
...
-Remove the default argument.
-Update all call sites of ASTContext::getFunctionType.
llvm-svn: 58187
2008-10-26 16:43:14 +00:00
Zhongxing Xu
60de6c6c63
Remove loc::StringLiteralVal. Now we allocate regions for string literals in the Store.
...
llvm-svn: 58182
2008-10-26 02:27:21 +00:00
Zhongxing Xu
bf47dc85fe
Simplify ArrayToPointer conversion. Actually the only thing we need to do is to get the first element region. It is not necessary to care about the kind of the base array region.
...
llvm-svn: 58181
2008-10-26 02:23:57 +00:00
Oscar Fuentes
07d9f9a6ec
CMake: Builds and installs clang binary and libs (no docs yet). It
...
must be under the `tools' subdirectory of the LLVM *source* tree.
llvm-svn: 58180
2008-10-26 00:56:18 +00:00
Ted Kremenek
3773bbce54
Use string literal for format string specifier; this prevents ErrMsg from being interpretted as a format string specifier.
...
llvm-svn: 58150
2008-10-25 20:19:34 +00:00
Ted Kremenek
e69a1fa342
Do not crash when performing VisitLValue on union types.
...
This fixes PR 2948.
llvm-svn: 58148
2008-10-25 20:09:21 +00:00
Zhongxing Xu
195839dd53
Add a note file for SCA module. Is it the right place?
...
llvm-svn: 58140
2008-10-25 14:56:36 +00:00
Zhongxing Xu
0d2706f6b8
Add code for get the lvalue for string literals. Now we return a StringRegion
...
for StringLiteral lvalue evaluation, instead of directly returning a
loc::StringLiteralVal by the Environment.
llvm-svn: 58138
2008-10-25 14:18:57 +00:00
Zhongxing Xu
d1aac353e5
Add StringRegion to MemRegions.
...
llvm-svn: 58137
2008-10-25 14:13:41 +00:00
Zhongxing Xu
80422b07c5
Add StringLiteral test code.
...
llvm-svn: 58136
2008-10-25 14:11:23 +00:00
Zhongxing Xu
ad20b671fc
Now we can handle arrays.
...
llvm-svn: 58135
2008-10-25 10:26:46 +00:00
Nuno Lopes
36a04c8268
2nd try to fix leakage of the module provider. note that moduleprovider takes ownership of the module
...
llvm-svn: 58128
2008-10-24 23:27:18 +00:00
Nuno Lopes
a39a4cec35
fix leaking of the module provider
...
llvm-svn: 58127
2008-10-24 22:51:00 +00:00
Ted Kremenek
bb913f2369
Updated checker build.
...
llvm-svn: 58125
2008-10-24 22:34:49 +00:00
Argyrios Kyrtzidis
962c20e6f3
Add a quote from the standard about the type of 'this'.
...
llvm-svn: 58124
2008-10-24 22:28:18 +00:00
Argyrios Kyrtzidis
98ca36f009
Unbreak the test by.. removing a space. (clang protested that -verify only works on single input files).
...
llvm-svn: 58123
2008-10-24 22:25:11 +00:00
Daniel Dunbar
fa0caca6d2
Add initial dependency file generation support. Patch by Kovarththanan
...
Rajaratnam, with some updates and formatting changes.
llvm-svn: 58122
2008-10-24 22:12:41 +00:00
Argyrios Kyrtzidis
22c40fa285
-Add support for cv-qualifiers after function declarators.
...
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.
llvm-svn: 58120
2008-10-24 21:46:40 +00:00
Daniel Dunbar
c157586598
Add ViewVC link from web page.
...
llvm-svn: 58119
2008-10-24 21:31:50 +00:00
Ted Kremenek
4bc52fdd75
Generalize searching for the keyword "leak" in a bug type.
...
llvm-svn: 58115
2008-10-24 21:23:51 +00:00