Commit Graph

7009 Commits

Author SHA1 Message Date
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
Ted Kremenek
920406b5ca Use "followsFundamentalRule" to determine if an instance method allocates memory.
llvm-svn: 58114
2008-10-24 21:22:44 +00:00
Ted Kremenek
01acb6284e followsFundamentalRule() returns true if "alloc" or "new" appear at the beginning of the string, not anywhere within it.
llvm-svn: 58112
2008-10-24 21:18:08 +00:00
Ted Kremenek
8d8a14a3fc Expand bubble size by 50%.
llvm-svn: 58111
2008-10-24 21:17:16 +00:00
Ted Kremenek
6e09d8f632 Implicit conversions from arrays can also be conversions to references (will add a test case shortly).
llvm-svn: 58110
2008-10-24 21:10:49 +00:00
Ted Kremenek
14e6350dcc This test no longer is marked XFAIL.
Enhance test to include a case where a tracked object escapes because it is stored to a local ivar through a method dispatch to 'self.'

llvm-svn: 58109
2008-10-24 20:33:56 +00:00
Ted Kremenek
03466c2273 Issue warnings about owned objects returned from a method that does not match the established Cocoa naming conventions.
llvm-svn: 58108
2008-10-24 20:32:50 +00:00
Ted Kremenek
f3be44f191 Added method "getSelfRegion" to Store. This method returns the region associated with the "this" or "self" object (C++ and Objective-C respectively).
llvm-svn: 58107
2008-10-24 20:32:16 +00:00
Ted Kremenek
8921d930d4 Added region ObjCObjectRegion that represents an instance of an Objective-C object.
llvm-svn: 58106
2008-10-24 20:30:08 +00:00
Douglas Gregor
3dfef1f2a3 Move viewInheritance to CXXRecordDecl, and make sure it builds in Release mode, too
llvm-svn: 58105
2008-10-24 19:53:54 +00:00
Douglas Gregor
a8aa7a08b8 PR2942: FunctionDecls by typedef crash the C++ front-end
llvm-svn: 58100
2008-10-24 18:09:54 +00:00
Sebastian Redl
67604aeedf Test commit
llvm-svn: 58099
2008-10-24 17:45:08 +00:00
Steve Naroff
614c490866 Add another file to VC++ project.
llvm-svn: 58098
2008-10-24 16:53:41 +00:00
Douglas Gregor
70dc759f14 Make QualTypeOrdering::operator() const
llvm-svn: 58097
2008-10-24 16:48:10 +00:00