]> granicus.if.org Git - clang/log
clang
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

15 years agoFix <rdar://problem/6445502> clang ObjC rewriter: _Block_release has wrong parameter...
Steve Naroff [Tue, 16 Dec 2008 15:50:30 +0000 (15:50 +0000)]
Fix <rdar://problem/6445502> clang ObjC rewriter: _Block_release has wrong parameter type in preamble

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

15 years agoPartial fix for qualified name lookup, such that the lookup of N in
Douglas Gregor [Tue, 16 Dec 2008 06:37:47 +0000 (06:37 +0000)]
Partial fix for qualified name lookup, such that the lookup of N in
N::X only skips those entities specified in C++ [basic.lookup.qual]p1.

Note that both EDG and GCC currently get this wrong. EDG has confirmed
that the bug will be fixed in a future version.

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

15 years agoImplement RegionStoreManager::Remove().
Zhongxing Xu [Tue, 16 Dec 2008 02:36:30 +0000 (02:36 +0000)]
Implement RegionStoreManager::Remove().

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

15 years agoDiagnose that ivars in current and super class may not
Fariborz Jahanian [Tue, 16 Dec 2008 01:08:35 +0000 (01:08 +0000)]
Diagnose that ivars in current and super class may not
be duplicates and a test case.

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

15 years agoMake name lookup when we're inside a declarator's scope, such as ClassName::func...
Douglas Gregor [Tue, 16 Dec 2008 00:38:16 +0000 (00:38 +0000)]
Make name lookup when we're inside a declarator's scope, such as ClassName::func, work with the new unqualified name lookup code. Test it with default arguments in out-of-line member definitions

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

15 years agoAdded a test for default arguments added to out-of-line member
Douglas Gregor [Tue, 16 Dec 2008 00:08:34 +0000 (00:08 +0000)]
Added a test for default arguments added to out-of-line member
functions. They work except that name lookup within the default
arguments needs to be deferred until the class definition is complete
(see FIXME in the test).

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

15 years agoDiagnose erroneous uses of out-of-line member definitions and scope
Douglas Gregor [Mon, 15 Dec 2008 23:53:10 +0000 (23:53 +0000)]
Diagnose erroneous uses of out-of-line member definitions and scope
specifiers. Specifically:
  * Determine when an out-of-line function definition does not match
    any declaration within the class or namespace (including coping
    with overloaded functions).
  * Complain about typedefs and parameters that have scope specifiers.
  * Complain about out-of-line declarations that aren't also
  definitions.
  * Complain about non-static data members being declared out-of-line.
  * Allow cv-qualifiers on out-of-line member function definitions.

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

15 years agoFix for PR3212: don't descend into C++ operator overloading code for C
Eli Friedman [Mon, 15 Dec 2008 22:34:21 +0000 (22:34 +0000)]
Fix for PR3212: don't descend into C++ operator overloading code for C
programs.

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

15 years agoMake error handling for va_start a bit more robust. Fixes PR3213.
Eli Friedman [Mon, 15 Dec 2008 22:05:35 +0000 (22:05 +0000)]
Make error handling for va_start a bit more robust.  Fixes PR3213.

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

15 years agoName of addLayoutToClass is confusing as no layout calculation
Fariborz Jahanian [Mon, 15 Dec 2008 21:58:08 +0000 (21:58 +0000)]
Name of addLayoutToClass is confusing as no layout calculation
is done. Layout is calculated lazily at code gen type.
This patch changes the name.

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

15 years agoPlace constructors and destructors into the DeclContext of the class,
Douglas Gregor [Mon, 15 Dec 2008 21:24:18 +0000 (21:24 +0000)]
Place constructors and destructors into the DeclContext of the class,
just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.

Diagnose the redeclaration of member functions.

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

15 years agoAnd a test case for my previous patch.
Fariborz Jahanian [Mon, 15 Dec 2008 20:39:58 +0000 (20:39 +0000)]
And a test case for my previous patch.

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

15 years agoCode gen. for ivar references; including bitfield
Fariborz Jahanian [Mon, 15 Dec 2008 20:35:07 +0000 (20:35 +0000)]
Code gen. for ivar references; including bitfield
ivars.

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

15 years agoPreprocessor: Allocate MacroInfo objects using a BumpPtrAllocator instead using new...
Ted Kremenek [Mon, 15 Dec 2008 19:56:42 +0000 (19:56 +0000)]
Preprocessor: Allocate MacroInfo objects using a BumpPtrAllocator instead using new/delete.  This speeds up -Eonly on Cocoa.h using the regular lexer by 1.8% and the PTHLexer by 3%.

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

15 years agoFix regression in handling sizeof(void) in the static analyzer.
Ted Kremenek [Mon, 15 Dec 2008 18:51:00 +0000 (18:51 +0000)]
Fix regression in handling sizeof(void) in the static analyzer.

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

15 years agoRemoved setRecordForDecl. Added a FIXME.
Fariborz Jahanian [Mon, 15 Dec 2008 18:04:20 +0000 (18:04 +0000)]
Removed setRecordForDecl. Added a FIXME.

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

15 years agoDon't double-destroy constructors defined out-of-line. This is a
Douglas Gregor [Mon, 15 Dec 2008 17:33:16 +0000 (17:33 +0000)]
Don't double-destroy constructors defined out-of-line. This is a
half-solution; the real solution is coming when constructors and
destructors are treated like all other functions by ActOnDeclarator.

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

15 years agoCreate new EnumDecl nodes for redeclarations of enums, linking them
Douglas Gregor [Mon, 15 Dec 2008 16:32:14 +0000 (16:32 +0000)]
Create new EnumDecl nodes for redeclarations of enums, linking them
together in the same way that we link RecordDecl/CXXRecordDecl nodes.

Unify ActOnTag and ActOnTagStruct.

Fixes PR clang/2753.

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

15 years agodont call iterator::end() on every cycle and dont read already-deleted memory
Nuno Lopes [Sun, 14 Dec 2008 21:53:25 +0000 (21:53 +0000)]
dont call iterator::end() on every cycle and dont read already-deleted memory

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

15 years agominor WS fix for the previous commit
Nuno Lopes [Sun, 14 Dec 2008 17:44:24 +0000 (17:44 +0000)]
minor WS fix for the previous commit

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

15 years agofix leakage of CXXSpecialName objects in DeclarationNameTable
Nuno Lopes [Sun, 14 Dec 2008 17:27:25 +0000 (17:27 +0000)]
fix leakage of CXXSpecialName objects in DeclarationNameTable

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

15 years agoI think we should getRValueType here. The lvaluetype of an array region is 'pointer...
Zhongxing Xu [Sun, 14 Dec 2008 03:14:52 +0000 (03:14 +0000)]
I think we should getRValueType here. The lvaluetype of an array region is 'pointer to array'.

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

15 years agoUpdated checker build.
Ted Kremenek [Sun, 14 Dec 2008 01:25:59 +0000 (01:25 +0000)]
Updated checker build.

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

15 years agoStore the size of the EH stack inside each BreakContinue struct so we know when a...
Anders Carlsson [Sat, 13 Dec 2008 22:52:24 +0000 (22:52 +0000)]
Store the size of the EH stack inside each BreakContinue struct so we know when a break/continue won't cross a try block.

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

15 years agoPatch for ObjCIvarRefExpr containing the field
Fariborz Jahanian [Sat, 13 Dec 2008 22:20:28 +0000 (22:20 +0000)]
Patch for ObjCIvarRefExpr containing the field
matching the storage layout for this ivar

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

15 years agoMemRegion:
Ted Kremenek [Sat, 13 Dec 2008 21:49:13 +0000 (21:49 +0000)]
MemRegion:
- Overhauled the notion of "types" for TypedRegions.  We now distinguish between the "lvalue" of a region (via getLValueRegion()) and the "rvalue" of a region (va getRValueRegion()).  Since a region represents a chunk of memory it has both, but we were conflating these concepts in some cases, leading to some insidious bugs.
- Removed AnonPointeeType, partially because it is unused and because it doesn't have a clear notion of lvalue vs rvalue type.  We can add it back once there is a need for it and we can resolve its role with these concepts.

StoreManager:
- Overhauled StoreManager::CastRegion.  It expects an *lvalue* type for a region.  This is actually what motivated the overhaul to the MemRegion type mechanism.  It also no longer returns an SVal; we can just return a MemRegion*.
- BasicStoreManager::CastRegion now overlays an "AnonTypedRegion" for pointer-pointer casts.  This matches with the MemRegion changes.
- Similar changes to RegionStore, except I've added a bunch of FIXMEs where it wasn't 100% clear where we should use TypedRegion::getRValueRegion() or TypedRegion::getLValueRegion().

AuditCFNumberCreate check:
- Now blasts through AnonTypedRegions that may layer the original memory region, thus checking if the actually memory block is of the appropriate type.  This change was needed to work with the changes to StoreManager::CastRegion.

GRExprEngine::VisitCast:
- Conform to the new interface of StoreManager::CastRegion.

Tests:
- None of the analysis tests fail now for using the "basic store".
- Disabled the tests 'array-struct.c' and 'rdar-6442306-1.m' pending further testing and bug fixing.

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

15 years agoAdd storage layout to ObjC classes.
Fariborz Jahanian [Sat, 13 Dec 2008 20:28:25 +0000 (20:28 +0000)]
Add storage layout to ObjC classes.

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

15 years agoeliminate the isCXXNamedOperator function and some string compares and
Chris Lattner [Sat, 13 Dec 2008 20:12:40 +0000 (20:12 +0000)]
eliminate the isCXXNamedOperator function and some string compares and
use identifierinfo instead.  Patch by Chris Goller!

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

15 years agoTemporarily XFAIL these tests.
Ted Kremenek [Sat, 13 Dec 2008 19:27:01 +0000 (19:27 +0000)]
Temporarily XFAIL these tests.

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

15 years agoA series of cleanups/fixes motivated by <rdar://problem/6442306>:
Ted Kremenek [Sat, 13 Dec 2008 19:24:37 +0000 (19:24 +0000)]
A series of cleanups/fixes motivated by <rdar://problem/6442306>:

GRExprEngine (VisitCast):
- When using StoreManager::CastRegion, always use the state and value it returns to generate the next node.  Failure to do so means that region values returned that don't require the state to be modified will get ignored.

MemRegion:
- Tighten the interface for ElementRegion.  Now ElementRegion can only be created with a super region that is a 'TypedRegion' instead of any MemRegion.  Code in BasicStoreManager/RegionStoreManager already assumed this, but it would result in a dynamic assertion check (and crash) rather than just having the compiler forbid the construction of such regions.
- Added ElementRegion::getArrayRegion() to return the 'typed version' of an ElementRegion's super region.
- Removed bogus assertion in ElementRegion::getType() that assumed that the super region was an AnonTypedRegion.  All that matters is that it is a TypedRegion, which is now true all the time by design.

BasicStore:
- Modified getLValueElement() to check if the 'array' region is a TypedRegion before creating an ElementRegion.  This conforms to the updated interface for ElementRegion.

RegionStore:
- In ArrayToPointer() gracefully handle things we don't reason about, and only create an ElementRegion if the array region is indeed a TypedRegion.

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

15 years agodisable Anders' recent VLA patch, this fixes PR3209.
Chris Lattner [Sat, 13 Dec 2008 18:58:59 +0000 (18:58 +0000)]
disable Anders' recent VLA patch, this fixes PR3209.

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

15 years agoSome utilities for using the smart pointers in Actions, especially Sema. Convert...
Sebastian Redl [Sat, 13 Dec 2008 16:23:55 +0000 (16:23 +0000)]
Some utilities for using the smart pointers in Actions, especially Sema. Convert a few functions.

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

15 years agoConvert remaining expression parsers to smart pointers. Now on to the Action connection.
Sebastian Redl [Sat, 13 Dec 2008 15:32:12 +0000 (15:32 +0000)]
Convert remaining expression parsers to smart pointers. Now on to the Action connection.

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

15 years agostdlib.h is the wrong header for printf, and introduces test-breaking definitions...
Sebastian Redl [Sat, 13 Dec 2008 15:31:28 +0000 (15:31 +0000)]
stdlib.h is the wrong header for printf, and introduces test-breaking definitions of inlines on Linux

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

15 years agoAdd /Za to all MSVC build of a clang libraries.
Cedric Venet [Sat, 13 Dec 2008 11:00:04 +0000 (11:00 +0000)]
Add /Za to all MSVC build of a clang libraries.
This allow to use the new move emulation for smart pointer by disabling language extension.

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

15 years agoPTH: Added minor 'sibling jumping' optimization for iterating over the side table...
Ted Kremenek [Fri, 12 Dec 2008 22:05:38 +0000 (22:05 +0000)]
PTH: Added minor 'sibling jumping' optimization for iterating over the side table used for fast preprocessor block skipping.  This has a minor performance improvement when preprocessing Cocoa.h, but can have some wins in pathologic cases.

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

15 years agoFix <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_...
Steve Naroff [Fri, 12 Dec 2008 21:05:34 +0000 (21:05 +0000)]
Fix <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_destroy.

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

15 years agofix a buggy fall through that caused a crash-on-invalid. rdar://6248081
Chris Lattner [Fri, 12 Dec 2008 19:20:14 +0000 (19:20 +0000)]
fix a buggy fall through that caused a crash-on-invalid.  rdar://6248081

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

15 years agoAdd test case for using mmintrin (and making sure that inlining is
Daniel Dunbar [Fri, 12 Dec 2008 19:12:02 +0000 (19:12 +0000)]
Add test case for using mmintrin (and making sure that inlining is
working with and without debug info).

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

15 years agoForce i[0-9]86 to i386 when using LLVM_HOSTTRIPLE.
Daniel Dunbar [Fri, 12 Dec 2008 18:34:35 +0000 (18:34 +0000)]
Force i[0-9]86 to i386 when using LLVM_HOSTTRIPLE.

Only use major part of OS version when on darwin and modifying OS part
of target triple.

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

15 years agoAdded PTH optimization to not process entire blocks of tokens that appear in skipped...
Ted Kremenek [Fri, 12 Dec 2008 18:34:08 +0000 (18:34 +0000)]
Added PTH optimization to not process entire blocks of tokens that appear in skipped preprocessor blocks.  This improves PTH speed by 6%.  The code for this optimization itself is not very optimized, and will get cleaned up.

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

15 years agoEnhance PTH preprocessor-condition-block side table to track #elseinformation as...
Ted Kremenek [Fri, 12 Dec 2008 18:31:09 +0000 (18:31 +0000)]
Enhance PTH preprocessor-condition-block side table to track #elseinformation as well.

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

15 years agoImplement the final (hopefully) wrinkle to i-c-e + builtin_constant_p
Chris Lattner [Fri, 12 Dec 2008 18:00:51 +0000 (18:00 +0000)]
Implement the final (hopefully) wrinkle to i-c-e + builtin_constant_p
processing: it allows arbitrary foldable constants as the operand of ?: when
builtin_constant_p is the condition.

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

15 years agoEnable out-of-line definitions of C++ constructors and destructors
Douglas Gregor [Fri, 12 Dec 2008 08:25:50 +0000 (08:25 +0000)]
Enable out-of-line definitions of C++ constructors and destructors

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

15 years agoImplement allocation and sizeof VLAs. This is very basic for now.
Anders Carlsson [Fri, 12 Dec 2008 07:38:43 +0000 (07:38 +0000)]
Implement allocation and sizeof VLAs. This is very basic for now.

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

15 years agordar://6060752 - don't warn about trigraphs in bcpl-style comments
Chris Lattner [Fri, 12 Dec 2008 07:34:39 +0000 (07:34 +0000)]
rdar://6060752 - don't warn about trigraphs in bcpl-style comments

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

15 years agofix breakage I introduced in r60938
Chris Lattner [Fri, 12 Dec 2008 07:33:52 +0000 (07:33 +0000)]
fix breakage I introduced in r60938

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