]> granicus.if.org Git - clang/log
clang
15 years agofix 80-col violation.
Zhongxing Xu [Sun, 21 Dec 2008 04:46:06 +0000 (04:46 +0000)]
fix 80-col violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61306 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement alignof for vla types.
Anders Carlsson [Sun, 21 Dec 2008 03:48:05 +0000 (03:48 +0000)]
Implement alignof for vla types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61305 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse utility method.
Zhongxing Xu [Sun, 21 Dec 2008 03:46:11 +0000 (03:46 +0000)]
Use utility method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61304 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd ASTContext::getBaseElementType and use it in CodeGenFunction::EmitArraySubscriptExpr.
Anders Carlsson [Sun, 21 Dec 2008 03:44:36 +0000 (03:44 +0000)]
Add ASTContext::getBaseElementType and use it in CodeGenFunction::EmitArraySubscriptExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61303 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCommit the right version of the test
Anders Carlsson [Sun, 21 Dec 2008 03:40:32 +0000 (03:40 +0000)]
Commit the right version of the test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61302 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure to emit the size expression for sizeof(type)
Anders Carlsson [Sun, 21 Dec 2008 03:33:21 +0000 (03:33 +0000)]
Make sure to emit the size expression for sizeof(type)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61301 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse utility methods. No functional change.
Zhongxing Xu [Sun, 21 Dec 2008 03:31:01 +0000 (03:31 +0000)]
Use utility methods. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61300 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove unused function.
Zhongxing Xu [Sun, 21 Dec 2008 03:26:05 +0000 (03:26 +0000)]
Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61299 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR3246: an empty clobber list is the empty string, not a null
Eli Friedman [Sun, 21 Dec 2008 01:15:32 +0000 (01:15 +0000)]
Fix for PR3246: an empty clobber list is the empty string, not a null
string.

That said, we should probably try and track down the correct clobber
lists for the targets that don't have them (PPC, ARM, and Sparc),
so that we can generate correct code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61298 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDid not mean to commit this.
Anders Carlsson [Sun, 21 Dec 2008 00:16:32 +0000 (00:16 +0000)]
Did not mean to commit this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61296 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle VLA indexing
Anders Carlsson [Sun, 21 Dec 2008 00:11:23 +0000 (00:11 +0000)]
Handle VLA indexing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61295 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support for member references (E1.E2, E1->E2) with C++ semantics,
Douglas Gregor [Sat, 20 Dec 2008 23:49:58 +0000 (23:49 +0000)]
Add support for member references (E1.E2, E1->E2) with C++ semantics,
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.

Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61294 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFinish up saving original parameter type and
Fariborz Jahanian [Sat, 20 Dec 2008 23:29:59 +0000 (23:29 +0000)]
Finish up saving original parameter type and
using it in ObjC's method parameter encoding.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61293 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExtend the unsupported error to include break and continue, and fix a
Eli Friedman [Sat, 20 Dec 2008 23:18:29 +0000 (23:18 +0000)]
Extend the unsupported error to include break and continue, and fix a
warning by using an unsigned index.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61292 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake VLAs usable, and make basic usage work correctly. Also, add a
Eli Friedman [Sat, 20 Dec 2008 23:11:59 +0000 (23:11 +0000)]
Make VLAs usable, and make basic usage work correctly.  Also, add a
simple test that actually does VLA codegen.

Note that despite the fact that the alloca isn't in the entry block, it
should dominate all uses; this is guaranteed by the restrictions on goto
into VLA scope in C99.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61291 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle typedefs to VLAs (Emit the size expr when we encounter the typedef
Anders Carlsson [Sat, 20 Dec 2008 21:51:53 +0000 (21:51 +0000)]
Handle typedefs to VLAs (Emit the size expr when we encounter the typedef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61290 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCheck the entire StackSaveValues stack for VLAs when dealing with goto and return...
Anders Carlsson [Sat, 20 Dec 2008 21:33:38 +0000 (21:33 +0000)]
Check the entire StackSaveValues stack for VLAs when dealing with goto and return statements. Noticed by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61289 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure to generate code for arguments that have a variably modified type.
Anders Carlsson [Sat, 20 Dec 2008 21:28:43 +0000 (21:28 +0000)]
Make sure to generate code for arguments that have a variably modified type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61288 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd case for the new AST node.
Fariborz Jahanian [Sat, 20 Dec 2008 21:06:28 +0000 (21:06 +0000)]
Add case for the new AST node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61287 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agointroducing ParmVarWithOriginalTypeDecl class to
Fariborz Jahanian [Sat, 20 Dec 2008 20:56:12 +0000 (20:56 +0000)]
introducing ParmVarWithOriginalTypeDecl class to
keep track of the original parameter decl. types.
This is work in progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61286 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange EmitVLASize to take a QualType that must be a variably modified type.
Anders Carlsson [Sat, 20 Dec 2008 20:46:34 +0000 (20:46 +0000)]
Change EmitVLASize to take a QualType that must be a variably modified type.

Emit the size even if the declared type is a variably modified type. This lets us handle

void f(int n) {
  int (*a)[n];

  printf("size: %d\n", sizeof(*a));
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61285 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSplit up emitting of VLA sizes and getting the size of a VLA.
Anders Carlsson [Sat, 20 Dec 2008 20:27:15 +0000 (20:27 +0000)]
Split up emitting of VLA sizes and getting the size of a VLA.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61284 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some ErrorUnsupported calls and turn on VLA codegen again.
Anders Carlsson [Sat, 20 Dec 2008 19:33:21 +0000 (19:33 +0000)]
Add some ErrorUnsupported calls and turn on VLA codegen again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61283 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStrangely enough, name of ObjC class is not encoded into the
Fariborz Jahanian [Sat, 20 Dec 2008 19:17:01 +0000 (19:17 +0000)]
Strangely enough, name of ObjC class is not encoded into the
full encoding of the class which has an ivar of pointer to this
class. Its name is encoded in the type for the ivar in the
ivar-list metadata. This patch conforms to the above rule.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61282 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement checks for bool in increment and decrement.
Sebastian Redl [Sat, 20 Dec 2008 09:35:34 +0000 (09:35 +0000)]
Implement checks for bool in increment and decrement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61275 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLazy bingding for region-store manager.
Zhongxing Xu [Sat, 20 Dec 2008 06:32:12 +0000 (06:32 +0000)]
Lazy bingding for region-store manager.
* Now Bind() methods take and return GRState* because binding could
  also alter GDM.
* No variables are initialized except those declared with initial
  values.
* failed C test cases are due to bugs in RemoveDeadBindings(),
which removes constraints that is still alive. This will be fixed in later
patch.
* default value of array and struct regions will be implemented in later patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61274 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Sat, 20 Dec 2008 02:16:48 +0000 (02:16 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61273 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6454568>: BugReporter should correctly handle switch statements...
Ted Kremenek [Sat, 20 Dec 2008 01:41:43 +0000 (01:41 +0000)]
Fix <rdar://problem/6454568>: BugReporter should correctly handle switch statements with no default case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61270 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoavoid using a typedef that isn't always included from headers.
Chris Lattner [Fri, 19 Dec 2008 23:51:20 +0000 (23:51 +0000)]
avoid using a typedef that isn't always included from headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61269 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore encoding support. This time for
Fariborz Jahanian [Fri, 19 Dec 2008 23:34:38 +0000 (23:34 +0000)]
More encoding support. This time for
@encode of classes and bitfields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61268 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGet rid of the old Expr::Evaluate variant.
Anders Carlsson [Fri, 19 Dec 2008 20:58:05 +0000 (20:58 +0000)]
Get rid of the old Expr::Evaluate variant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61260 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPass -fblocks to clang
Anders Carlsson [Fri, 19 Dec 2008 20:56:23 +0000 (20:56 +0000)]
Pass -fblocks to clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61258 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a missing @end. Why didn't this get diagnosed?
Douglas Gregor [Fri, 19 Dec 2008 19:16:37 +0000 (19:16 +0000)]
Add a missing @end. Why didn't this get diagnosed?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61256 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSupport more implicit conversions for Objective-C types. Addresses <rdar://problem...
Douglas Gregor [Fri, 19 Dec 2008 19:13:09 +0000 (19:13 +0000)]
Support more implicit conversions for Objective-C types. Addresses <rdar://problem/6458293>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61255 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest case for my last @encode patch.
Fariborz Jahanian [Fri, 19 Dec 2008 17:45:06 +0000 (17:45 +0000)]
Test case for my last @encode patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61247 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAllow downcasts of pointers to Objective-C interfaces, with a
Douglas Gregor [Fri, 19 Dec 2008 17:40:08 +0000 (17:40 +0000)]
Allow downcasts of pointers to Objective-C interfaces, with a
warning. This matches GCC's behavior and addresses
<rdar://problem/6458293>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61246 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR3234
Anders Carlsson [Fri, 19 Dec 2008 17:27:57 +0000 (17:27 +0000)]
Fix for PR3234

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61245 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Fri, 19 Dec 2008 00:19:19 +0000 (00:19 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61233 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSeveral@encode bug fixes for ObjC.
Fariborz Jahanian [Fri, 19 Dec 2008 00:14:49 +0000 (00:14 +0000)]
Several@encode bug fixes for ObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61231 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate Xcode project.
Ted Kremenek [Fri, 19 Dec 2008 00:03:48 +0000 (00:03 +0000)]
Update Xcode project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61230 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some more implicit conversions for Objective-C++
Douglas Gregor [Thu, 18 Dec 2008 23:43:31 +0000 (23:43 +0000)]
Add some more implicit conversions for Objective-C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61229 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded test case for suppressing leak warnings for reference-counted objects passed...
Ted Kremenek [Thu, 18 Dec 2008 23:40:58 +0000 (23:40 +0000)]
Added test case for suppressing leak warnings for reference-counted objects passed by-reference to an unknown function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61227 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix regression when invalidating reference-counts for objects passed-by-reference...
Ted Kremenek [Thu, 18 Dec 2008 23:34:57 +0000 (23:34 +0000)]
Fix regression when invalidating reference-counts for objects passed-by-reference to a function/method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61224 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't define __STDC__ when compiling with -fms-extensions
Steve Naroff [Thu, 18 Dec 2008 22:37:25 +0000 (22:37 +0000)]
Don't define __STDC__ when compiling with -fms-extensions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61223 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't check initializers when there are dependent types or type-dependent expressions...
Douglas Gregor [Thu, 18 Dec 2008 21:49:58 +0000 (21:49 +0000)]
Don't check initializers when there are dependent types or type-dependent expressions involved

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61212 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUltrasimplistic sketch for the parsing of C++ template-ids. This won't
Douglas Gregor [Thu, 18 Dec 2008 19:37:40 +0000 (19:37 +0000)]
Ultrasimplistic sketch for the parsing of C++ template-ids. This won't
become useful or correct until we (1) parse template arguments
correctly, (2) have some way to turn template-ids into types,
declarators, etc., and (3) have a real representation of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61208 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse '&' to test StartOfLine flag.
Ted Kremenek [Thu, 18 Dec 2008 18:15:29 +0000 (18:15 +0000)]
Use '&' to test StartOfLine flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61205 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemoved a slot in ObjCMemRegExpr used in
Fariborz Jahanian [Thu, 18 Dec 2008 17:29:46 +0000 (17:29 +0000)]
Removed a slot in ObjCMemRegExpr used in
code gen which did not belong there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61203 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix http://llvm.org/bugs/show_bug.cgi?id=3189.
Steve Naroff [Thu, 18 Dec 2008 15:50:41 +0000 (15:50 +0000)]
Fix http://llvm.org/bugs/show_bug.cgi?id=3189.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61202 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a simple fast-path for the common case of [] and [4] in
Chris Lattner [Thu, 18 Dec 2008 07:27:21 +0000 (07:27 +0000)]
add a simple fast-path for the common case of [] and [4] in
array size declarators.  No need to go through all the trouble
of parsing crazy things like [static const 4] when most code
doesn't need it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61200 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename argument
Chris Lattner [Thu, 18 Dec 2008 07:07:10 +0000 (07:07 +0000)]
rename argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61199 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodisallow attributes in a few callers of ParseTypeQualifierListOpt,
Chris Lattner [Thu, 18 Dec 2008 07:02:59 +0000 (07:02 +0000)]
disallow attributes in a few callers of ParseTypeQualifierListOpt,
these completely ignore parsed attributes anyway, so don't try
to read them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61198 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoClean up the C89/C++ warnings about C99 array features to not
Chris Lattner [Thu, 18 Dec 2008 06:50:14 +0000 (06:50 +0000)]
Clean up the C89/C++ warnings about C99 array features to not
emit duplicate diags (some in parser and some in sema) and to
warn about use of typequals in array sizes.  This implements
PR2759.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61197 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd method used by ImmutableMap GDM specialization.
Zhongxing Xu [Thu, 18 Dec 2008 05:15:58 +0000 (05:15 +0000)]
Add method used by ImmutableMap GDM specialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61193 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAllow ABI to use StructRet even for scalar values.
Daniel Dunbar [Thu, 18 Dec 2008 04:52:14 +0000 (04:52 +0000)]
Allow ABI to use StructRet even for scalar values.
 - Update comment to reflect fact that StructRet is now supported for
   any type (modulo LLVM support).

 - No functionality change, no scalar types currently use this
   feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61192 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis is valid in C++.
Chris Lattner [Thu, 18 Dec 2008 02:03:48 +0000 (02:03 +0000)]
This is valid in C++.
void foo() { return foo(); }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61188 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMerge function-return.c into function.c
Chris Lattner [Thu, 18 Dec 2008 02:01:17 +0000 (02:01 +0000)]
Merge function-return.c into function.c

Fix PR2790 by making a warning an EXTWARN instead of EXTENSION.
Add a new EXTENSION warning for "return (some void expression);"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61187 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement PR3177 - "__extension__ union" not supported in C++ mode
Chris Lattner [Thu, 18 Dec 2008 01:12:00 +0000 (01:12 +0000)]
implement PR3177 - "__extension__ union" not supported in C++ mode

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61180 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Wed, 17 Dec 2008 23:55:41 +0000 (23:55 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61173 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRewrite PTHLexer::DiscardToEndOfLine() to not use GetToken and instead only read...
Ted Kremenek [Wed, 17 Dec 2008 23:52:11 +0000 (23:52 +0000)]
Rewrite PTHLexer::DiscardToEndOfLine() to not use GetToken and instead only read the bytes needed to determine if a token is not at the start of the line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61172 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix leakage of var's initializers
Nuno Lopes [Wed, 17 Dec 2008 23:39:55 +0000 (23:39 +0000)]
fix leakage of var's initializers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61171 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange PTHLexer::getSourceLocation() to not call GetToken() and instead just read...
Ted Kremenek [Wed, 17 Dec 2008 23:36:32 +0000 (23:36 +0000)]
Change PTHLexer::getSourceLocation() to not call GetToken() and instead just read the file offset in the token data buffer directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61170 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPTHLexer::isNextPPTokenLParen() no longer calls GetToken() and just reads the token...
Ted Kremenek [Wed, 17 Dec 2008 23:08:31 +0000 (23:08 +0000)]
PTHLexer::isNextPPTokenLParen() no longer calls GetToken() and just reads the token kind from the token data buffer.  This results in a minor speedup and reduces the dependency on GetToken().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61168 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelay semantic analysis of the C++ names casts when the subexpression is type-depende...
Douglas Gregor [Wed, 17 Dec 2008 22:52:20 +0000 (22:52 +0000)]
Delay semantic analysis of the C++ names casts when the subexpression is type-dependent or the destination type is dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61165 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix a few more memory leaks: clean the ASTRecordLayouts, ASTObjCInterfaces and ASTRec...
Nuno Lopes [Wed, 17 Dec 2008 22:30:25 +0000 (22:30 +0000)]
fix a few more memory leaks: clean the ASTRecordLayouts, ASTObjCInterfaces and ASTRecordForInterface maps

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61163 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOops, accidentally commited the wrong version of the test (original
Eli Friedman [Wed, 17 Dec 2008 22:22:03 +0000 (22:22 +0000)]
Oops, accidentally commited the wrong version of the test (original
commit r61160).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61162 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to re-implement duplicate ivar checking
Fariborz Jahanian [Wed, 17 Dec 2008 22:21:44 +0000 (22:21 +0000)]
Patch to re-implement duplicate ivar checking
(which will pass duplicate-ivar-check.m test again).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61161 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo proper recovery from an invalid switch condiition. Fixes PR3229.
Eli Friedman [Wed, 17 Dec 2008 22:19:57 +0000 (22:19 +0000)]
Do proper recovery from an invalid switch condiition.  Fixes PR3229.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61160 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCF-retain/release checker:
Ted Kremenek [Wed, 17 Dec 2008 21:50:35 +0000 (21:50 +0000)]
CF-retain/release checker:
- Fix regression reported in <rdar://problem/6452745>.  After a null check, null references to resources should not have a retain count.  This regression was caused by removing the call to "GRTransferFuncs::EvalAssume" in BasicConstraintManager.
- Added a test case to test this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61155 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis patch will build the Records lazily per Steve's comments.
Fariborz Jahanian [Wed, 17 Dec 2008 21:40:49 +0000 (21:40 +0000)]
This patch will build the Records lazily per Steve's comments.
Note that one test duplicate-ivar-check.m will fail because I
need to re-implement duplicate ivar checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61154 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a dropped word back
Chris Lattner [Wed, 17 Dec 2008 21:38:44 +0000 (21:38 +0000)]
add a dropped word back

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61152 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Wed, 17 Dec 2008 21:02:35 +0000 (21:02 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61151 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6451816>:
Ted Kremenek [Wed, 17 Dec 2008 19:42:34 +0000 (19:42 +0000)]
Fix <rdar://problem/6451816>:
- Because of the introduction of AnonTypedRegions when reasoning about casts, we
  had a regression in the "symbolication" of variable values passed-by-reference
  to a function. This is now fixed in CFRefCount.cpp (-checker-cfref) by
  blasting through the layer of AnonTypedRegions when symbolicating the value of
  the variable. This logic may get moved elsewhere. Note that this change
  affects only -checker-cfref and not -checker-simple; eventually this logic
  should get pulled out of CFRefCount.cpp into a more common place. All users
  use -checker-cfref by default, and -checker-simple should probably just be
  removed.
- Updated test 'Analysis/uninit-vals-ps.c' to only use -checker-cfref and added
  a test case for this regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61147 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd pretty-printing for AnonTypedRegion.
Ted Kremenek [Wed, 17 Dec 2008 19:25:50 +0000 (19:25 +0000)]
Add pretty-printing for AnonTypedRegion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61146 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoShadow CurPtr with a local variable in ReadToken.
Ted Kremenek [Wed, 17 Dec 2008 18:38:19 +0000 (18:38 +0000)]
Shadow CurPtr with a local variable in ReadToken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61145 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded comment to Steve's patch to clarify the case.
Fariborz Jahanian [Wed, 17 Dec 2008 18:25:24 +0000 (18:25 +0000)]
Added comment to Steve's patch to clarify the case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61144 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoConsolidated property check into property-typecheck-1.m file.
Fariborz Jahanian [Wed, 17 Dec 2008 17:55:55 +0000 (17:55 +0000)]
Consolidated property check into property-typecheck-1.m file.
Improved on property diagnostics.
Added a FIXME per Steve's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61141 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake the injected-class-name of a C++ class a separate RecordDecl from the class...
Douglas Gregor [Wed, 17 Dec 2008 16:48:01 +0000 (16:48 +0000)]
Make the injected-class-name of a C++ class a separate RecordDecl from the class itself, with a different scope. This eliminates some ownership issues, so that the RecordDecl only lives in a single context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61140 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the crufty reverse_decl_iterator
Douglas Gregor [Wed, 17 Dec 2008 16:32:39 +0000 (16:32 +0000)]
Remove the crufty reverse_decl_iterator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61139 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemoved the warning
Douglas Gregor [Wed, 17 Dec 2008 16:19:15 +0000 (16:19 +0000)]
Removed the warning

  warning: statement was disambiguated as declaration

because it is currently firing in cases where the declaration would
not actually parse as a statement. We'd love to bring this warning
back if we can make it more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61137 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove rewriter dependency on 'nil' macro (used when rewriting for(...))
Steve Naroff [Wed, 17 Dec 2008 14:24:39 +0000 (14:24 +0000)]
Remove rewriter dependency on 'nil' macro (used when rewriting for(...))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61135 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6450964> clang on xcode: Assertion failed: (RecordForDecl &&...
Steve Naroff [Wed, 17 Dec 2008 14:13:49 +0000 (14:13 +0000)]
Fix <rdar://problem/6450964> clang on xcode: Assertion failed: (RecordForDecl && "lookupFieldDeclForIvar no storage for class").

This was a recent regression caused by r61043 (related to code gen. for ivar references).

Fariborz, please review. I have some other concerns related to code generation for ivars that we can discuss later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61134 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodiagnose C99 6.9.1p5, C arguments in definitions that are lacking
Chris Lattner [Wed, 17 Dec 2008 07:32:46 +0000 (07:32 +0000)]
diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name.  This implements PR3208.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove the other Sema::ActOnLinkageSpec to SemaDeclCXX.
Chris Lattner [Wed, 17 Dec 2008 07:13:27 +0000 (07:13 +0000)]
Move the other Sema::ActOnLinkageSpec to SemaDeclCXX.
Move Sema::ActOnDefs to SemaDeclObjC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61126 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove Sema::ActOnLinkageSpec to SemaDeclCXX.
Chris Lattner [Wed, 17 Dec 2008 07:09:26 +0000 (07:09 +0000)]
Move Sema::ActOnLinkageSpec to SemaDeclCXX.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61125 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure that enumerators show up within the enumeration declaration. Fixes. PR...
Douglas Gregor [Wed, 17 Dec 2008 02:04:30 +0000 (02:04 +0000)]
Make sure that enumerators show up within the enumeration declaration. Fixes. PR clang/3220

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61116 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PrintParserCallbacks for the new ActOnLinkageSpec actions
Douglas Gregor [Wed, 17 Dec 2008 01:46:43 +0000 (01:46 +0000)]
Fix PrintParserCallbacks for the new ActOnLinkageSpec actions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61115 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSemantics of @protocol attributes.
Fariborz Jahanian [Wed, 17 Dec 2008 01:07:27 +0000 (01:07 +0000)]
Semantics of @protocol attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61114 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweaks to allow us to rewrite with -x=objective-c++ enabled.
Steve Naroff [Wed, 17 Dec 2008 00:20:22 +0000 (00:20 +0000)]
Tweaks to allow us to rewrite with -x=objective-c++ enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61113 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove debug stmt, sorry..
Nuno Lopes [Tue, 16 Dec 2008 22:59:47 +0000 (22:59 +0000)]
remove debug stmt, sorry..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61112 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR 3222: allow one to get the address of a global function in C++
Nuno Lopes [Tue, 16 Dec 2008 22:58:26 +0000 (22:58 +0000)]
fix PR 3222: allow one to get the address of a global function in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61111 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake linkage-specifications hold on to all of their declarations
Douglas Gregor [Tue, 16 Dec 2008 22:23:02 +0000 (22:23 +0000)]
Make linkage-specifications hold on to all of their declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61110 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix crash with -ast-dump in C++.
Eli Friedman [Tue, 16 Dec 2008 22:14:15 +0000 (22:14 +0000)]
Fix crash with -ast-dump in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61108 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd new GRWorkList class that uses two queues:
Ted Kremenek [Tue, 16 Dec 2008 22:13:33 +0000 (22:13 +0000)]
Add new GRWorkList class that uses two queues:
- one queue (FIFO) to queue up nodes at block entrances
- another queue (LIFO) to queue up other nodes
- The idea is to explore basic blocks to completion, but to do a BFS exploration of blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61106 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoProgramPoint:
Ted Kremenek [Tue, 16 Dec 2008 22:02:27 +0000 (22:02 +0000)]
ProgramPoint:
- Added four new ProgramPoint types that subclass PostStmt for use in
  GRExprEngine::EvalLocation:
  - PostOutOfBoundsCheckFailed
  - PostUndefLocationCheckFailed
  - PostNullCheckFailed
  - PostLocationChecksSucceed
  These were created because of a horribly subtle caching bug in EvalLocation
  where a node representing an "bug condition" in EvalLocation (e.g. a null
  dereference) could be re-used as the "non-bug condition" because the Store did
  not contain any information to differentiate between the two. The extra
  program points just disables any accidental caching between EvalLocation and
  its callers.

GRExprEngine:
- EvalLocation now returns a NodeTy* instead of GRState*.  This should be used as the "vetted" predecessor for EvalLoad/EvalStore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61105 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelay parsing of default arguments of member functions until the class
Douglas Gregor [Tue, 16 Dec 2008 21:30:33 +0000 (21:30 +0000)]
Delay parsing of default arguments of member functions until the class
is completely defined (C++ [class.mem]p2).

Reverse the order in which we process the definitions of member
functions specified inline. This way, we'll get diagnostics in the
order in which the member functions were declared in the class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61103 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSilence a couple more operator precedence warnings; this shouldn't
Eli Friedman [Tue, 16 Dec 2008 20:15:50 +0000 (20:15 +0000)]
Silence a couple more operator precedence warnings; this shouldn't
change the semantics.  Please correct this if the precedence was
actually supposed to be something different.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61099 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWarning fixes to operator precedence warnings.
Eli Friedman [Tue, 16 Dec 2008 20:06:41 +0000 (20:06 +0000)]
Warning fixes to operator precedence warnings.

Someone should double-check that I didn't somehow break ObjC
serialization; I think the change there actually changes the semantics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61098 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove tabs.
Nate Begeman [Tue, 16 Dec 2008 19:57:09 +0000 (19:57 +0000)]
Remove tabs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61097 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to check for ObjC's property type.
Fariborz Jahanian [Tue, 16 Dec 2008 17:51:01 +0000 (17:51 +0000)]
Patch to check for ObjC's property type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61090 91177308-0d34-0410-b5e6-96231b3b80d8