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

15 years agoAdd test of enumerator types
Douglas Gregor [Fri, 12 Dec 2008 07:27:10 +0000 (07:27 +0000)]
Add test of enumerator types

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

15 years agoAdd map of VLA types and their sizes
Anders Carlsson [Fri, 12 Dec 2008 07:19:02 +0000 (07:19 +0000)]
Add map of VLA types and their sizes

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

15 years agosilence warning in release-asserts mode about unused variable, also
Chris Lattner [Fri, 12 Dec 2008 07:16:09 +0000 (07:16 +0000)]
silence warning in release-asserts mode about unused variable, also
move comment into assert message.

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

15 years agofix thought-o
Chris Lattner [Fri, 12 Dec 2008 07:14:34 +0000 (07:14 +0000)]
fix thought-o

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

15 years agomerge these testcases into one file.
Chris Lattner [Fri, 12 Dec 2008 07:01:24 +0000 (07:01 +0000)]
merge these testcases into one file.

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

15 years agoadd a fixme.
Chris Lattner [Fri, 12 Dec 2008 06:57:03 +0000 (06:57 +0000)]
add a fixme.

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

15 years agoimplement rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e.
Chris Lattner [Fri, 12 Dec 2008 06:55:44 +0000 (06:55 +0000)]
implement rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e.

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

15 years agouse smarter error recovery for do/while.
Chris Lattner [Fri, 12 Dec 2008 06:35:28 +0000 (06:35 +0000)]
use smarter error recovery for do/while.

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

15 years agoapply the new error recovery smarts we have for if's to while's and switch's.
Chris Lattner [Fri, 12 Dec 2008 06:31:07 +0000 (06:31 +0000)]
apply the new error recovery smarts we have for if's to while's and switch's.

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

15 years agorename recovery-3 to recovery.c
Chris Lattner [Fri, 12 Dec 2008 06:21:41 +0000 (06:21 +0000)]
rename recovery-3 to recovery.c

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

15 years agomerge recovery-1 into recovery-3.
Chris Lattner [Fri, 12 Dec 2008 06:21:18 +0000 (06:21 +0000)]
merge recovery-1 into recovery-3.

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

15 years agomerge recovery-2.c into recovery-3.c.
Chris Lattner [Fri, 12 Dec 2008 06:19:11 +0000 (06:19 +0000)]
merge recovery-2.c into recovery-3.c.

Substantially improve error recovery after broken if conditions by
parsing the full if when we have a semantic error instead of using
parser recovery techniques to recover from a semantic error.

This fixes rdar://6094870 - spurious error after invalid 'if' condition

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

15 years agominor refactoring of ParseParenExpression
Chris Lattner [Fri, 12 Dec 2008 06:00:12 +0000 (06:00 +0000)]
minor refactoring of ParseParenExpression

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

15 years agoadd expected diag
Chris Lattner [Fri, 12 Dec 2008 05:59:56 +0000 (05:59 +0000)]
add expected diag

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

15 years agoadd ownership.h to xcode project
Chris Lattner [Fri, 12 Dec 2008 05:54:54 +0000 (05:54 +0000)]
add ownership.h to xcode project

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

15 years agoWork in preparation for VLAs. Make sure to restore the stack if necessary (Saving...
Anders Carlsson [Fri, 12 Dec 2008 05:52:00 +0000 (05:52 +0000)]
Work in preparation for VLAs. Make sure to restore the stack if necessary (Saving the stack isn't implemented right now :)

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

15 years agoFix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue
Chris Lattner [Fri, 12 Dec 2008 05:35:08 +0000 (05:35 +0000)]
Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue

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

15 years agoTestcase for something that already works. Clang agrees with Comeau,
Chris Lattner [Fri, 12 Dec 2008 05:25:55 +0000 (05:25 +0000)]
Testcase for something that already works.  Clang agrees with Comeau,
and this makes sense.  likely a gcc bug that it doesn't diagnose the bad
restrict.

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

15 years agoadd codegen support for __func__ and friends, producing the same
Chris Lattner [Fri, 12 Dec 2008 05:18:02 +0000 (05:18 +0000)]
add codegen support for __func__ and friends, producing the same
output that GCC does.  rdar://6440297

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

15 years agofix rdar://6097892 - gcc incompat: clang rejects __func__, __FUNCTION__, and __PRETTY...
Chris Lattner [Fri, 12 Dec 2008 05:05:20 +0000 (05:05 +0000)]
fix rdar://6097892 - gcc incompat: clang rejects __func__, __FUNCTION__, and __PRETTY_FUNCTION__ outside func

Yeah, this is "useful".

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

15 years agoImplement rdar://6138816 - [sema] named bitfields cannot have 0 width
Chris Lattner [Fri, 12 Dec 2008 04:56:04 +0000 (04:56 +0000)]
Implement rdar://6138816 - [sema] named bitfields cannot have 0 width

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

15 years agoIn C++, set the type of each of the enumerators in an enumeration to
Douglas Gregor [Fri, 12 Dec 2008 02:00:36 +0000 (02:00 +0000)]
In C++, set the type of each of the enumerators in an enumeration to
the type of the enumeration once the enumeration has been defined.

Fix the overloading test-case to properly create enums that promote
the way we want them to.

Implement C++0x promotions from enumeration types to long
long/unsigned long long. We're using these promotions in Carbon.h
(since long long is a common extension).

Fixes PR clang/2954: http://llvm.org/bugs/show_bug.cgi?id=2954

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

15 years agoPTH:
Ted Kremenek [Thu, 11 Dec 2008 23:36:38 +0000 (23:36 +0000)]
PTH:
- Added a side-table per each token-cached file with the preprocessor conditional stack.  This tracks what #if's are matched with what #endifs and where their respective tokens are in the PTH file.  This will allow for quick skipping of excluded conditional branches in the Preprocessor.
- Performance testing shows the addition of this information (without actually utilizing it) leads to no performance regressions.

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

15 years agoadd annotation
Chris Lattner [Thu, 11 Dec 2008 23:11:52 +0000 (23:11 +0000)]
add annotation

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

15 years agoConvert a big bunch of expression parsers to use smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 22:51:44 +0000 (22:51 +0000)]
Convert a big bunch of expression parsers to use smart pointers.

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

15 years agoPTHLexer: Keep track of the location of the last '#' token and provide the means...
Ted Kremenek [Thu, 11 Dec 2008 22:41:47 +0000 (22:41 +0000)]
PTHLexer: Keep track of the location of the last '#' token and provide the means to jump ahead in the token stream.

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

15 years agoConvert some more expression parsers to use smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 22:33:27 +0000 (22:33 +0000)]
Convert some more expression parsers to use smart pointers.

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

15 years agoConvert selected expression parsers to use smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 21:36:32 +0000 (21:36 +0000)]
Convert selected expression parsers to use smart pointers.

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

15 years agoRename a local predicate to avoid confusion with Type::isBlockPointerType().
Steve Naroff [Thu, 11 Dec 2008 21:05:33 +0000 (21:05 +0000)]
Rename a local predicate to avoid confusion with Type::isBlockPointerType().

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

15 years agoFixup generated code for imported block decl refs.
Steve Naroff [Thu, 11 Dec 2008 20:51:38 +0000 (20:51 +0000)]
Fixup generated code for imported block decl refs.
Found while investigating <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_destroy.

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

15 years agoAddress some comments on the name lookup/DeclContext patch from Chris
Douglas Gregor [Thu, 11 Dec 2008 20:41:00 +0000 (20:41 +0000)]
Address some comments on the name lookup/DeclContext patch from Chris

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

15 years agoRemove unused ivar CurTokenIdx.
Ted Kremenek [Thu, 11 Dec 2008 20:39:48 +0000 (20:39 +0000)]
Remove unused ivar CurTokenIdx.

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

15 years agoConvert the remaining statement parsers to smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 20:12:42 +0000 (20:12 +0000)]
Convert the remaining statement parsers to smart pointers.

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

15 years agoConvert some more statement parsers to smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 19:48:14 +0000 (19:48 +0000)]
Convert some more statement parsers to smart pointers.

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

15 years agoFix <rdar://problem/6435842> clang ObjC rewriter: #include Block.h, Block_private...
Steve Naroff [Thu, 11 Dec 2008 19:43:14 +0000 (19:43 +0000)]
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

15 years agoConvert a number of statement parsers to smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 19:30:53 +0000 (19:30 +0000)]
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

15 years agoFix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and blocks...
Steve Naroff [Thu, 11 Dec 2008 19:29:16 +0000 (19:29 +0000)]
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

15 years agoActually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_i...
Douglas Gregor [Thu, 11 Dec 2008 17:59:21 +0000 (17:59 +0000)]
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

15 years agoUnifies the name-lookup mechanisms used in various parts of the AST
Douglas Gregor [Thu, 11 Dec 2008 16:49:14 +0000 (16:49 +0000)]
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

15 years agoIdentify AnonPointeeRegion by the symbol that is concretized.
Zhongxing Xu [Thu, 11 Dec 2008 09:08:46 +0000 (09:08 +0000)]
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

15 years agoAnonPointeeRegions are now identified by the MemRegion of the pointer pointing
Zhongxing Xu [Thu, 11 Dec 2008 02:27:34 +0000 (02:27 +0000)]
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

15 years agoUpdated checker build.
Ted Kremenek [Thu, 11 Dec 2008 00:20:13 +0000 (00:20 +0000)]
Updated checker build.

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

15 years agoAdd another complex promotion test.
Anders Carlsson [Wed, 10 Dec 2008 23:57:51 +0000 (23:57 +0000)]
Add another complex promotion test.

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

15 years agoMake sure to promote expressions of the form (floating point + complex integer) corre...
Anders Carlsson [Wed, 10 Dec 2008 23:30:05 +0000 (23:30 +0000)]
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

15 years agoPreprocessorLexer (and subclasses):
Ted Kremenek [Wed, 10 Dec 2008 23:20:59 +0000 (23:20 +0000)]
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

15 years agoAdded a warning when referencing an if's condition variable in the
Douglas Gregor [Wed, 10 Dec 2008 23:01:14 +0000 (23:01 +0000)]
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

15 years agoThe "real" fix for <rdar://problem/6424347> clang on xcode: Assertion failed: (0...
Steve Naroff [Wed, 10 Dec 2008 22:14:21 +0000 (22:14 +0000)]
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

15 years agoFix PR clang/3175: CheckAddressOfOperand does not handle references to class vars
Douglas Gregor [Wed, 10 Dec 2008 21:26:49 +0000 (21:26 +0000)]
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

15 years agoSome cleanups to the dependent-types commit, as suggested by Sebastian
Douglas Gregor [Wed, 10 Dec 2008 20:57:37 +0000 (20:57 +0000)]
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

15 years agoFix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected...
Steve Naroff [Wed, 10 Dec 2008 20:07:25 +0000 (20:07 +0000)]
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

15 years agoDeclare PerIDCache as IdentifierInfo** instead of void*. This is just cleaner. ...
Ted Kremenek [Wed, 10 Dec 2008 19:40:23 +0000 (19:40 +0000)]
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

15 years agoFix <rdar://problem/6418623> Bogus block type compatibility warning.
Steve Naroff [Wed, 10 Dec 2008 17:49:55 +0000 (17:49 +0000)]
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

15 years agoFix regression caused by fixing <rdar://problem/6429113> clang ObjC rewriter: crash...
Steve Naroff [Wed, 10 Dec 2008 14:53:27 +0000 (14:53 +0000)]
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

15 years agoUse a scoped object to manage entry/exit from a parser scope rather than explicitly...
Douglas Gregor [Wed, 10 Dec 2008 06:34:36 +0000 (06:34 +0000)]
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

15 years agoAppend an extra newline to the module inline asm if it's not empty.
Anders Carlsson [Wed, 10 Dec 2008 02:21:04 +0000 (02:21 +0000)]
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

15 years agoUpdated checker build.
Ted Kremenek [Wed, 10 Dec 2008 00:50:24 +0000 (00:50 +0000)]
Updated checker build.

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

15 years agoPatch to allow a getter call using property dot-syntax notation.
Fariborz Jahanian [Wed, 10 Dec 2008 00:21:50 +0000 (00:21 +0000)]
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

15 years agoModify the move emulation according to the excellent design of Howard Hinnant. Makes...
Sebastian Redl [Wed, 10 Dec 2008 00:02:53 +0000 (00:02 +0000)]
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

15 years agoFix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer...
Ted Kremenek [Tue, 9 Dec 2008 23:50:57 +0000 (23:50 +0000)]
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

15 years agoPrevent bogus warning on unimplemented setter/getter when user
Fariborz Jahanian [Tue, 9 Dec 2008 22:43:22 +0000 (22:43 +0000)]
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

15 years agoHave BasicStoreManager::getLValueElement() have logic similar to BasicStoreManager...
Ted Kremenek [Tue, 9 Dec 2008 21:20:27 +0000 (21:20 +0000)]
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

15 years agoAdd testcase for commit r60781.
Steve Naroff [Tue, 9 Dec 2008 20:59:16 +0000 (20:59 +0000)]
Add testcase for commit r60781.

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

15 years agoSupport for implementation of property in the case where
Fariborz Jahanian [Tue, 9 Dec 2008 20:23:04 +0000 (20:23 +0000)]
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

15 years agoKick out the proof-of-concept ASTOwner and replace it with ASTOwningResult
Sebastian Redl [Tue, 9 Dec 2008 20:22:58 +0000 (20:22 +0000)]
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

15 years agoAdd preliminary CFG support for @throw. We basically treat it like a return statement.
Ted Kremenek [Tue, 9 Dec 2008 20:20:09 +0000 (20:20 +0000)]
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

15 years agoIn GRExprEngine treat @throw as an 'abort' that ends the current path. This is a...
Ted Kremenek [Tue, 9 Dec 2008 20:18:58 +0000 (20:18 +0000)]
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

15 years agoLay the groundwork for converting the entire parser-sema chain to smart pointers.
Sebastian Redl [Tue, 9 Dec 2008 19:36:21 +0000 (19:36 +0000)]
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

15 years agoSema::ActOnMethodDeclaration(): Make sure we perform the default function/array conve...
Steve Naroff [Tue, 9 Dec 2008 19:36:17 +0000 (19:36 +0000)]
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

15 years agoFix a serious null termination bug found by David Chisnall!
Chris Lattner [Tue, 9 Dec 2008 19:10:54 +0000 (19:10 +0000)]
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

15 years agoFill in C++ status table for expressions.
Sebastian Redl [Tue, 9 Dec 2008 14:40:01 +0000 (14:40 +0000)]
Fill in C++ status table for expressions.

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

15 years agoConsistently use smart pointers for stmt and expr nodes in parser local variables.
Sebastian Redl [Tue, 9 Dec 2008 13:15:23 +0000 (13:15 +0000)]
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

15 years agoFix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks...
Steve Naroff [Tue, 9 Dec 2008 12:56:34 +0000 (12:56 +0000)]
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