Граф коммитов

2791 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 0ea76727ae 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
2008-12-15 19:56:42 +00:00
Ted Kremenek 55f7bcbda3 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
2008-12-15 18:51:00 +00:00
Fariborz Jahanian 9fbb609b90 Removed setRecordForDecl. Added a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61038 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 18:04:20 +00:00
Douglas Gregor 0874bd3198 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
2008-12-15 17:33:16 +00:00
Douglas Gregor 7df7b6bb80 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
2008-12-15 16:32:14 +00:00
Nuno Lopes f9d1e4bc60 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
2008-12-14 21:53:25 +00:00
Nuno Lopes 640b319914 minor WS fix for the previous commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61008 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-14 17:44:24 +00:00
Nuno Lopes 6d34ae5370 fix leakage of CXXSpecialName objects in DeclarationNameTable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61007 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-14 17:27:25 +00:00
Zhongxing Xu 2ef9372b72 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
2008-12-14 03:14:52 +00:00
Anders Carlsson e21269bcb7 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
2008-12-13 22:52:24 +00:00
Fariborz Jahanian aaa63a761c 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
2008-12-13 22:20:28 +00:00
Ted Kremenek 6eddeb1534 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
2008-12-13 21:49:13 +00:00
Fariborz Jahanian 60f8c868ff Add storage layout to ObjC classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 20:28:25 +00:00
Chris Lattner 9485d2382c 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
2008-12-13 20:12:40 +00:00
Ted Kremenek abb042f33e 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
2008-12-13 19:24:37 +00:00
Chris Lattner 71e38c4860 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
2008-12-13 18:58:59 +00:00
Sebastian Redl 798d119415 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
2008-12-13 16:23:55 +00:00
Sebastian Redl 1d922960e0 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
2008-12-13 15:32:12 +00:00
Ted Kremenek 41a2660377 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
2008-12-12 22:05:38 +00:00
Chris Lattner fdb548e822 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
2008-12-12 19:20:14 +00:00
Ted Kremenek 268ee7016a 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
2008-12-12 18:34:08 +00:00
Chris Lattner 42b83dde7c 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
2008-12-12 18:00:51 +00:00
Douglas Gregor 9d35097bc0 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
2008-12-12 08:25:50 +00:00
Anders Carlsson 5d46315ca3 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
2008-12-12 07:38:43 +00:00
Chris Lattner bc3e984221 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
2008-12-12 07:34:39 +00:00
Anders Carlsson dcc90d87e6 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
2008-12-12 07:19:02 +00:00
Chris Lattner 47a2b40b7a fix thought-o
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 07:14:34 +00:00
Chris Lattner 1f64805512 add a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60935 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 06:57:03 +00:00
Chris Lattner 28daa53db7 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
2008-12-12 06:55:44 +00:00
Chris Lattner ff871fb8f9 use smarter error recovery for do/while.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 06:35:28 +00:00
Chris Lattner 15ff1110c9 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
2008-12-12 06:31:07 +00:00
Chris Lattner 18914bcb22 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
2008-12-12 06:19:11 +00:00
Chris Lattner 42ece6424f minor refactoring of ParseParenExpression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60928 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12 06:00:12 +00:00
Anders Carlsson 17d28a3e0b 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
2008-12-12 05:52:00 +00:00
Chris Lattner 670a62cd1d 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
2008-12-12 05:35:08 +00:00
Chris Lattner 3534564044 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
2008-12-12 05:18:02 +00:00
Chris Lattner b0da923653 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
2008-12-12 05:05:20 +00:00
Chris Lattner cd08707a96 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
2008-12-12 04:56:04 +00:00
Douglas Gregor c9467cf4cf 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
2008-12-12 02:00:36 +00:00
Ted Kremenek fb645b6547 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
2008-12-11 23:36:38 +00:00
Sebastian Redl 20df9b7ab9 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
2008-12-11 22:51:44 +00:00
Ted Kremenek cd223444d1 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
2008-12-11 22:41:47 +00:00
Sebastian Redl d8c4e15138 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
2008-12-11 22:33:27 +00:00
Sebastian Redl 2f7ece7c77 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
2008-12-11 21:36:32 +00:00
Douglas Gregor e267ff35b2 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
2008-12-11 20:41:00 +00:00
Ted Kremenek 7415326dcb Remove unused ivar CurTokenIdx.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 20:39:48 +00:00
Sebastian Redl 43bc2a0973 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
2008-12-11 20:12:42 +00:00
Sebastian Redl 9a92034270 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
2008-12-11 19:48:14 +00:00
Sebastian Redl 61364dddc3 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
2008-12-11 19:30:53 +00:00
Douglas Gregor a4c46df1cd 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
2008-12-11 17:59:21 +00:00
Douglas Gregor 44b4321fea 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
2008-12-11 16:49:14 +00:00
Zhongxing Xu c5458622a3 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
2008-12-11 09:08:46 +00:00
Zhongxing Xu 3bb662a863 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
2008-12-11 02:27:34 +00:00
Anders Carlsson 5b1f3f0b21 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
2008-12-10 23:30:05 +00:00
Ted Kremenek bc0f6bc039 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
2008-12-10 23:20:59 +00:00
Douglas Gregor caaf29a087 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
2008-12-10 23:01:14 +00:00
Steve Naroff bc76dd06eb 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
2008-12-10 22:14:21 +00:00
Douglas Gregor 2988205cb3 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
2008-12-10 21:26:49 +00:00
Douglas Gregor 83f96f668d 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
2008-12-10 20:57:37 +00:00
Steve Naroff 4e78fd0a96 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
2008-12-10 20:07:25 +00:00
Ted Kremenek cf58e6249c 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
2008-12-10 19:40:23 +00:00
Steve Naroff c0febd58f5 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
2008-12-10 17:49:55 +00:00
Douglas Gregor 8935b8b490 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
2008-12-10 06:34:36 +00:00
Anders Carlsson 565c99f45e 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
2008-12-10 02:21:04 +00:00
Fariborz Jahanian 391d895370 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
2008-12-10 00:21:50 +00:00
Sebastian Redl effa8d1c97 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
2008-12-10 00:02:53 +00:00
Ted Kremenek 1d6c14bd27 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
2008-12-09 23:50:57 +00:00
Fariborz Jahanian 91b51a92f2 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
2008-12-09 22:43:22 +00:00
Ted Kremenek 7d71b296c7 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
2008-12-09 21:20:27 +00:00
Fariborz Jahanian fef30b5523 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
2008-12-09 20:23:04 +00:00
Sebastian Redl 15faa7fdfb 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
2008-12-09 20:22:58 +00:00
Ted Kremenek 2fda504dcc 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
2008-12-09 20:20:09 +00:00
Ted Kremenek bbfd07a0c9 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
2008-12-09 20:18:58 +00:00
Sebastian Redl 7f792faf0c 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
2008-12-09 19:36:21 +00:00
Steve Naroff 6082c62125 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
2008-12-09 19:36:17 +00:00
Chris Lattner c9f29c6185 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
2008-12-09 19:10:54 +00:00
Sebastian Redl 0e9eabca26 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
2008-12-09 13:15:23 +00:00
Zhongxing Xu 2fdf555af1 Add utility method. Remove an unused method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 10:51:19 +00:00
Ted Kremenek 159d2487e6 [static analyzer] Extend VLA size checking to look for undefined sizes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:44:16 +00:00
Ted Kremenek e0dbda1364 Fixed LiveVariables bug where we didn't consider block-level expressions that functioned as the size of a VLA to be live.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 00:14:14 +00:00
Fariborz Jahanian 447d7aeb94 Change condition under which 'retain'/'copy' are directly evaluated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60729 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 23:56:17 +00:00
Ted Kremenek efd5994d6a Add checking for zero-sized VLAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 22:47:34 +00:00
Chris Lattner 90b93d6f69 Fix PR3172: if we see an eof or } at the top level, reject it.
This is important because ParseDeclarationOrFunctionDefinition
skips to, but does not consume, an } on error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60719 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 21:59:01 +00:00
Chris Lattner 891dca671a improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60718 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 21:53:24 +00:00
Ted Kremenek 2c615660ec 'self.myIvar = nil' (properties) only releases myIvar when the property has kind 'assign'. This fixes <rdar://problem/6380411>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 21:44:15 +00:00
Steve Naroff b79c01ea32 ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories protocols.
Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize'



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 20:57:28 +00:00
Fariborz Jahanian ba45da8328 Changed 'readonly' 'retain/copy' diagnostics into
warning as it is allowed in gcc and will break projects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60710 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 19:28:10 +00:00
Fariborz Jahanian 9bfb2a2cbe Since we do not allow a readonly property to be 'copy'retain', we
must allow the continuation class to extend it to a 'readwrite'
and 'copy/retain'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 18:47:29 +00:00
Douglas Gregor f57172b24f Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it belongs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60708 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 18:40:42 +00:00
Zhongxing Xu e50897af8b fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 07:14:51 +00:00
Zhongxing Xu 00c028b4a1 fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 05:12:38 +00:00
Eli Friedman e9a0f43927 Workaround for PR3173. The fix is correct in the sense that if the enum
code were working correctly, it would be a no-op, but it's not really a 
proper fix.  That said, I don't really want to touch the enum code at 
the moment because I don't understand it very well, and this seems to 
be a relatively visible regression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60680 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 02:21:03 +00:00
Nuno Lopes a3d783b11f add missing gentoo c++ include paths
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 12:11:37 +00:00
Anders Carlsson 7fd1df2a87 Pass the VLA size expr range to the VLA diags
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 00:49:48 +00:00
Anders Carlsson 96e05bc090 Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 00:20:55 +00:00
Fariborz Jahanian 5dd4129011 Setters returning a typedef of 'void' should not cause error.
Bug reported by Chris L.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 23:12:49 +00:00
Fariborz Jahanian 1ac2bc4478 Use of properties declared in protocols in the category
via the category's protocol list1s, with appropriate
diagnsostics and a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60634 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 23:03:39 +00:00
Fariborz Jahanian 196d0ed5e1 Improve error reporting of property and setter/getter
type mimatches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60630 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 21:48:16 +00:00
Fariborz Jahanian ec604c8e1f Check for correct'void' return type for setter methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 21:11:37 +00:00
Anders Carlsson 9f1e5727e3 Add diagnostics for bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 20:33:04 +00:00
Anders Carlsson a75023d60f Simplify some diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 20:05:35 +00:00
Fariborz Jahanian 77e14bd3a7 Changed a 'FIXME' into new comment. Added a test case
testing declaration of properties in categories.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 19:59:02 +00:00
Ted Kremenek 759623efaf Add bandaid transfer function support for assignments involving ObjCKVCRefExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 02:39:30 +00:00
Fariborz Jahanian 567c8df364 Patch to diagnose a variety of misuse of property
attributes. Example would be, readonly, assign or
assign, copy, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 01:12:43 +00:00
Douglas Gregor 5c37de7885 Add support for calls to dependent names within templates, e.g.,
template<typename T> void f(T x) {
    g(x); // g is a dependent name, so don't even bother to look it up
    g(); // error: g is not a dependent name
  }

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60618 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-06 00:22:45 +00:00
Douglas Gregor 898574e749 Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60615 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 23:32:09 +00:00
Fariborz Jahanian 9482a4f0fe Fixed a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 22:36:19 +00:00
Fariborz Jahanian ae6f6fd152 This test checks for duplicate implementation of the same
property. It also checks for duplicate use of the same ivar
in two different iproperty implementations. It also caught
an error for a test case used in CodeGen :).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60610 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 22:32:48 +00:00
Fariborz Jahanian 8daab970b8 (instance/class) Method type checking between class and its implementation.
(instance/class) Method type checking between category and its implementation.
And a test case for all.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60598 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 18:18:52 +00:00
Douglas Gregor 72c3f314d9 Representation of template type parameters and non-type template
parameters, with some semantic analysis:
  - Template parameters are introduced into template parameter scope
  - Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates. 

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 18:15:24 +00:00
Anders Carlsson 49184b2916 Use VerifyIntegerConstantExpression instead of isIntegerConstantExpr. Fixes PR2963
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 16:33:57 +00:00
Anders Carlsson d407a76199 This wasn't such a good idea after all as it broke some tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 05:24:13 +00:00
Anders Carlsson b3fee0f064 Handle __builtin___CFStringMakeConstantString in Expr::Evaluate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60581 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 05:18:05 +00:00
Anders Carlsson 9e09f5d361 Make Sema::CheckForConstantInitializer use Expr::Evaluate. This fixes PR3130.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 05:09:56 +00:00
Ted Kremenek 562731eabb Add SymbolRef::print() and have SymbolicRegion::print() use this method instead of calling SymbolRef::getNumber().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60578 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 02:45:20 +00:00
Ted Kremenek 6d0e2d2f3c Use trait-based profiling of SymbolRefs, avoiding calling getNumber() (which will soon be removed).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 02:39:38 +00:00
Ted Kremenek 2dabd4372c Rename SymbolID to SymbolRef. This is a precursor to some overhauling of the representation of symbolic values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 02:27:51 +00:00
Zhongxing Xu ebed7971cf Rename: FindContext -> FindDeclVisibleInContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60574 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 01:57:57 +00:00
Fariborz Jahanian de7394157c Patch for diagnosing type mismatch between
methods in class and its implementation.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60573 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 01:35:25 +00:00
Ted Kremenek f3d416267e Remove SymbolDataContentsOf (unused).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 01:31:31 +00:00
Ted Kremenek 2ed14beed7 StoreManager::Retrieve and StoreManager::RemoveDeadBindings now take a GRState* argument instead of a Store. This allows them to use the GDM for storing other data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05 00:47:52 +00:00
Chris Lattner 371f258e61 change getCurFunctionDecl to skip through Block contexts to find
the containing block.  Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places.  This fixes rdar://6405429.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60564 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 23:50:19 +00:00
Chris Lattner ae0ee03fd9 instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on.  Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 23:20:07 +00:00
Fariborz Jahanian 06de37bade Output better diagnostics for continuation class
property attribute mis-specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:56:16 +00:00
Chris Lattner 8fc4dfb30e replace useNeXTRuntimeAsDefault with a generic hook that allows targets
to specify their default language options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:54:33 +00:00
Ted Kremenek 0e50b6e7c1 Remove unneeded assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60559 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:47:11 +00:00
Sebastian Redl 7f6623914e Code cleanup in new handling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:20:51 +00:00
Ted Kremenek 271b7af521 Use 'free' to release PerIDCache since it was allocated using calloc().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 22:09:37 +00:00
Ted Kremenek f5e8834747 Fix bug in attribute(nonnull) processing where not all of the parameter indices in nonnull(...) were actually processed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 19:38:33 +00:00
Sebastian Redl 636a7c42d4 Fix some diagnostics and enhance test cases. Now tests member new and ambiguous overloads.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 17:24:46 +00:00
Steve Naroff c77a636688 Several things...
- Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter().

- Implement FIXME: for pretty printing ObjCPropertyRefExpr's.

- Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the ".").
 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 16:24:46 +00:00
Daniel Dunbar 86ccea05f6 Mention an optimization opportunity pointed out by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 09:05:45 +00:00
Ted Kremenek c48ea6e51d Revamp RegionStoreManager::RemoveDeadBindings. This method now does a complete mark-and-sweep of the store, removing dead regions and recording the set of live and dead symbols appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 02:08:27 +00:00
Ted Kremenek de63bdcb52 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 02:06:04 +00:00
Zhongxing Xu 0b242ecdd5 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 01:12:41 +00:00
Sebastian Redl 3a5013cab1 Correct CodeGen assumption that LongTy == Int32Ty in a few places. This makes several CodeGenObjC tests pass on 64-bit by fixing assertions. This doesn't mean that the result is actually what the GNU runtime expects, though.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04 00:10:55 +00:00
Sebastian Redl d457589fc6 Fix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This should satisfy compilers and language lawyers alike.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 23:17:54 +00:00
Sebastian Redl b5a57a69e5 Overload resolution for the operator new function. Member version is still untested.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 20:26:15 +00:00
Ted Kremenek d7ff4874cb BasicConstraintManager:
- Fix nonsensical logic in AssumeSymGE. When comparing 'sym >= constant' and the
  constant is the maximum integer value, add the constraint that 'sym ==
  constant' when the path is deemed feasible.  All other cases are feasible.
- Improve AssumeSymGT. When comparing 'sym > constant' and constant is the
  maximum integer value we know the path is infeasible.
- Add test case for this enhancement to AssumeSymGT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60490 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 19:06:30 +00:00
Ted Kremenek 73abd133ae BasicConstraintManager:
- Fix nonsensical logic in AssumeSymLE. When comparing 'sym <= constant' and the
  constant is the minimum integer value, add the constraint that 'sym ==
  constant' when the path is deemed feasible.  All other cases are feasible.
- Improve AssumeSymLT to address <rdar://problem/6407949>.  When comparing
  'sym < constant' and constant is the minimum integer value we know the
  path is infeasible.
- Add test case for <rdar://problem/6407949>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 18:56:12 +00:00
Sebastian Redl cb354721a6 Fix typo in index operator overloading.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 16:32:40 +00:00
Anders Carlsson 98883e1e69 If a global var decl has an initializer, make sure to always set its linkage to external.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 05:51:23 +00:00
Ted Kremenek 6183e4815a PTH:
Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*.  This leads to a 4% speedup at -fsyntax-only using PTH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:16:39 +00:00
Ted Kremenek 0c6a77bc1f - Remove PTHManager.cpp. Move all of its functions to PTHLexer.cpp since some of the internal methods are used by PTHLexer (their implementations are intertwined.) This enables some important inlining opportunities at -O3.
- Don't construct an std::vector<Token> prior to feeding PTH tokens to the Preprocessor.  Stream them off the PTH file directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 00:38:03 +00:00
Sebastian Redl 6fec64874f Correct pretty printing of array new expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 22:08:59 +00:00
Ted Kremenek 6137dc99ef Preprocessor:
- Added method "setPTHManager" that will be called by the driver to install
  a PTHManager for the Preprocessor.
- Fixed some comments.
- Added EnterSourceFileWithPTH to mirror EnterSourceFileWithLexer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:46:31 +00:00
Ted Kremenek be1ee79d20 Added PTHManager, a utility class that will be used by Preprocessor to lazily create PTHLexer objects for pre-tokenized files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60436 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:45:05 +00:00
Fariborz Jahanian f3cd3fd859 More type-checking of setter/getter methods. This is still
work in prgress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:39:49 +00:00
Sebastian Redl bcf293bb63 Add better comments to ::new parsing. Thanks to Doug for the review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 17:10:24 +00:00
Sebastian Redl 500386194c Make RegionStoreManager::InitializeArray safe against array sizes that don't have pointer width.
This may be the case on 64-bit systems. Whether that fact is a bug is a different question, but it's easy to cure the symptom.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:47:35 +00:00
Sebastian Redl fb4ccd7152 Make the parser handle ::new and ::delete correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60421 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:35:44 +00:00
Eli Friedman 09af4d9728 Update cmake build; patch by Csaba Hruska.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:23:30 +00:00
Eli Friedman 8de8d1d3f2 Fix for PR3150: obvious copy-paste bug in
ScalarExprEmitter::VisitBinLOr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:02:46 +00:00
Sebastian Redl cee63fbf0e Handle new by passing the Declaration to the Action, not a processed type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 14:43:59 +00:00
Ted Kremenek 04f9d468f7 Add FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 01:26:07 +00:00
Eli Friedman a385b3c9c4 Disabling this code due to regression on test/CodeGen/bitfield.c. See
PR3152.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 01:17:45 +00:00
Douglas Gregor 26236e8b75 A little more scaffolding for parsing templates:
- Template parameter scope to hold the template parameters
  - Template parameter context for parsing declarators
  - Actions for template type parameters and non-type template
    parameters



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 00:41:28 +00:00
Fariborz Jahanian b85cce6498 This patch corrects problem in searching for a setter/getter method for
a property. Previous scheme of seaching in interface's list of methods
would not work because this list is not yet constructed. This is in preparation
for doing semantic check on viability of setter/getter method declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 00:19:12 +00:00
Douglas Gregor adcac8824a Basic support for parsing templates, from Andrew Sutton
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 23:54:00 +00:00
Douglas Gregor cb43d99952 Improve error recovery when parsing a function definition fails
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 23:03:32 +00:00
Douglas Gregor e89b02823a Initialize storage class even if we got an erroneous mutable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 22:46:22 +00:00
Douglas Gregor bec1c9d6f3 Objective-C keywords are not always identifiers. Some are also C++ keywords
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 21:46:47 +00:00
Steve Naroff d40910b581 -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
-Start adding support for rewriting @synthesize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 20:33:01 +00:00
Douglas Gregor 19ac6ff24e Use EmitInt, not Emit, to emit unsigned values
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60364 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 19:45:16 +00:00
Daniel Dunbar c1571453de Add LangOptions marker for assembler-with-cpp mode and use to define
__ASSEMBLER__ properly. Patch from Roman Divacky (with minor
formatting changes). Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:55:22 +00:00
Douglas Gregor a4745616eb Parse the exception-specification throw(...), a Microsoft extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:00:20 +00:00
Douglas Gregor 28d6cba4c4 Define NULL to __null in C++, so that it's guaranteed to have the same size as a pointer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 17:20:57 +00:00
Anders Carlsson 4fdfb0965b Generate the correct results for the comma expression. Fixes PR3123.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 06:44:05 +00:00
Anders Carlsson d26527708b Revert change that made isNullPointerConstant start emitting warnings. We don't want that :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60333 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 06:28:23 +00:00
Anders Carlsson 64712f196b Change more code over to using the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:46:24 +00:00
Anders Carlsson 4b3f9c06d5 Change more code over to using the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:42:14 +00:00
Anders Carlsson f35d35a231 Use the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:31:41 +00:00
Anders Carlsson 07b5cc0f40 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:25:52 +00:00
Anders Carlsson 4000ea685a Add Sema::isNullPointerConstant which extwarns if necessary. Use it in Sema::CheckConditionalOperands.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:17:22 +00:00
Anders Carlsson efa9b3877e Add a new variant of isNullConstantExpr that returns an EvalResult.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:13:57 +00:00
Anders Carlsson d3a61d5ec5 Use VerifyIntegerConstantExpression for case values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:13:02 +00:00
Anders Carlsson 027f62ec18 Emit the correct diagnostic when a comma is in an ICE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:07:06 +00:00
Anders Carlsson e21555e666 Add Sema::VerifyIntegerConstantExpression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 19:50:32 +00:00
Anders Carlsson 0e8acbbba7 Change the diagnostics that the evaluator reports to be of type NOTE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 18:37:00 +00:00
Anders Carlsson f0c1e4b679 Replace the isEvaluated bool with a ShortCircuit int, making it easier to handle recursion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 18:26:25 +00:00
Anders Carlsson 82206e267c Pass the expression to the Error and Extension methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 18:14:57 +00:00
Anders Carlsson 5b45d4ef1e Add a new variant of Evaluate and reimplement the old Evaluate in terms of the new.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 16:58:53 +00:00
Anders Carlsson fcb4d09531 General cleanup, evaluate the RHS of a logical op even if the LHS will give us the result.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 16:51:17 +00:00
Anders Carlsson 54da049661 EvalInfo now holds a reference to an EvalResult struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 16:38:33 +00:00
Zhongxing Xu 6987c7b741 Add support for initializing array with string literal.
This fixes PR3127
http://llvm.org/bugs/show_bug.cgi?id=3127


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 05:49:49 +00:00
Eli Friedman 994ffef435 Fix for PR2969: generate a memcpy from a constant for constant
initializers.  llvm-gcc appears to be more aggressive, but incorrect, 
for constructs like "const int a[] = {1,2,3};"; that said, current 
optimizers will do the appropriate optimizations when safe.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60270 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 02:11:09 +00:00
Eli Friedman 4310ff6d8b Minor update to CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60269 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 01:46:21 +00:00
Zhongxing Xu 0395b5d498 To be consistent, make the index of the ElementRegion always signed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 12:05:04 +00:00
Douglas Gregor 2d8b273470 Implement the GNU __null extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 04:51:27 +00:00
Chris Lattner 5cf243a883 Switch QualType to use llvm::PointerIntPair internally to do the pointer
bitmangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:37:31 +00:00
Zhongxing Xu 96cb9fb620 Fix a serious bug.
When initialized, the index of the ElementRegion was unsigned. But the index
value of the ArraySubscriptExpr is signed. This inconsistency caused the value
of the array element retrieved to be UnknownVal despite it was initialized to
symbolic.

This is only a hack. Real fix of this problem is required.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60207 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 08:41:39 +00:00
Zhongxing Xu d5b499d43c Code cleanup. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60206 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 08:34:30 +00:00
Zhongxing Xu 353cbe134c Use std::make_pair instead of std::pair's ctor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60205 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 03:55:52 +00:00
Sebastian Redl e206532197 Fix order of evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60160 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:28:14 +00:00
Zhongxing Xu f0bc50eaa3 Factory objects should not be temporary. It caches all objects in the set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60151 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 06:08:40 +00:00
Zhongxing Xu d548479442 RegionViewMap factory is actually not used. All GDMs should use factories from
GDMContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 06:03:03 +00:00
Daniel Dunbar 4fe66aa202 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 03:47:29 +00:00
Zhongxing Xu 8fd9b3508a Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 02:39:34 +00:00
Zhongxing Xu 5abf03bbb9 Add license comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 02:19:10 +00:00
Zhongxing Xu 22438a8dfe Add support for pluggable components of static analyzer.
- Creator function pointers are saved in ManagerRegistry.
 - The Register* class is used to notify ManagerRegistry new module is 
   available.
 - AnalysisManager queries ManagerRegistry for configurable module. Then it
   passes them to GRExprEngine, in turn to GRStateManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 01:55:08 +00:00
Douglas Gregor 7ca09760ee Add implicit conversions for Objective-C qualified ids, e.g.,
id<P0>

The intended overloading behavior of these entities isn't entirely
clear, and GCC seems to have some strange limitations (e.g., the
inability to overload on id<P0> vs. id<P1>). We'll want to revisit
these semantics and determine just how Objective-C++ overloading
should really work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 01:19:21 +00:00
Douglas Gregor bf40818928 Cleanup formatting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:52:49 +00:00
Douglas Gregor 63a9490b27 Don't complain about block pointer to void* conversions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:44:28 +00:00
Ted Kremenek 82a500b141 PTHLexer now owns the Token vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:38:24 +00:00
Douglas Gregor 071f2aec57 Support block pointer conversions in C++. I'm storing the test case locally until we can enable blocks in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:15:41 +00:00
Douglas Gregor cb7de523cc Implement implicit conversions for Objective-C specific types, e.g.,
converting a pointer to one Objective-C interface into a pointer to another
Objective-C interface, and conversions with 'id'. The semantics seems
to match GCC, although they seem somewhat ad hoc.

Fixed a few cases where we assumed the C++ definition of isObjectType,
but were getting the C definition, causing failures in trouble with
conversions to void pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 23:31:11 +00:00
Argyrios Kyrtzidis 314fe782fd Attempt to unravel the if/else mess in Parser::ParseDirectDeclarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:40:03 +00:00
Fariborz Jahanian 6010bca98a Code gen for aggregate-valued properties and a test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:36:09 +00:00
Argyrios Kyrtzidis 44802cc435 Add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 21:51:07 +00:00
Argyrios Kyrtzidis 4bdd91c09f Implement some suggestions by Daniel:
-Change Parser::ParseCXXScopeSpecifier to MaybeParseCXXScopeSpecifier
-Remove Parser::isTokenCXXScopeSpecifier and fold it into MaybeParseCXXScopeSpecifier
-Rename Parser::TryAnnotateScopeToken to TryAnnotateCXXScopeToken and only allow it to be called when in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 21:41:52 +00:00
Fariborz Jahanian b16308f1b3 Removed a FIXME. Added a test case for anonymous category.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 20:33:54 +00:00
Fariborz Jahanian 8cf0bb3c2a Set default property attributes on each property.
Implemented anonymous category (also know as continuation class)
used to override main class's property attribute. This is work in 
propgress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 20:01:34 +00:00
Anders Carlsson 4d6e8dd587 Convert incomplete array types before emitting debug info for them, fixes PR3134.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 17:40:42 +00:00
Douglas Gregor 7ffd0defb9 Fix a minor typo in the handling of the conditional operator for Objective-C interface pointers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 06:43:45 +00:00
Douglas Gregor 0a39668d6a Tweak the new ResolveOverloadedCallFn to just return a FunctionDecl. It makes ActOnCallExpr simpler
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 06:01:48 +00:00
Douglas Gregor f6b89691d2 Move the overloading logic of Sema::ActOnCallExpr to a separate function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:54:23 +00:00
Nuno Lopes cfe257198c remove debug-only assertion in the complex float evaluator as it makes some real apps crash
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60069 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:39:53 +00:00
Daniel Dunbar ab4c91c708 Only call TryAnnotateScopeToken when parsing C++.
- This improves -parse-noop of Carbon.h by +2%, and I believe
   compensates for the majority of the performance regression in r58913.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60063 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 23:05:24 +00:00
Anders Carlsson ad3d6917da Handle returning complex types that get coerced. Fixes PR3131
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 22:21:48 +00:00
Sebastian Redl a55e52c080 Use RAII objects to ensure proper destruction of expression and statement AST nodes in the parser in most cases, even on error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 22:21:31 +00:00
Daniel Dunbar 71fcec9abf Fix 80-col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:53:21 +00:00
Fariborz Jahanian 31afbf02a3 Refactored checking on readonly property into a method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:48:26 +00:00
Fariborz Jahanian 6669db9d80 Patch to allow over-riding of readonly property to
a writable property in one of its category.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:56:43 +00:00
Anders Carlsson c9ad94e12a Remove more #ifdeffed code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:16:39 +00:00
Anders Carlsson 704e4907ee Remove the #ifdeffed out code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:10:10 +00:00
Nuno Lopes 43d0ffdace remove unused var
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60018 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 12:23:46 +00:00
Douglas Gregor 0fe7bea6fc Simple parsing of exception specifications, with no semantic analysis yet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60005 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 03:22:00 +00:00
Daniel Dunbar ddd3e8b90a Comment fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 00:20:22 +00:00
Fariborz Jahanian e793a6ec16 Patch to remove bogus waring when a property declaration
is imported from a protocol into the implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59988 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 22:16:00 +00:00
Sebastian Redl 618e5c0470 Remove an empty if and add a reminder for when we implement C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 21:45:59 +00:00
Ted Kremenek d017243919 Fix CFG bug where the 'increment' block for a 'for' statement would not be
properly reversed once constructed.

This fixes PR 3125:

http://llvm.org/bugs/show_bug.cgi?id=3125


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59982 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 20:50:24 +00:00
Sebastian Redl d14094db33 Remove some bad characters from comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59979 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 20:06:50 +00:00
Sebastian Redl ddee68bf6b Fix the fix of revision 59974. Now array-struct.c passes too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59975 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:39:40 +00:00
Sebastian Redl e95db4f2cd Fix crash of array bounds checking under 64-bit.
There might be other, similar bugs lurking there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:35:33 +00:00
Ted Kremenek a68c106ed2 Remove FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:27:06 +00:00
Zhongxing Xu baf03a7c0a Add support for AllocaRegion extent with GDM.
One design problem that is emerging is the signed-ness problem during static
analysis. Many unsigned value have to be converted into signed value because
it partipates in operations with signed values. 

On the other hand, we cannot blindly make all values occuring in static analysis
signed, because we do have cases where unsignedness is required, for example,
integer overflow detection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 09:44:56 +00:00
Zhongxing Xu 8b86273806 Add utility methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59956 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 09:38:21 +00:00
Zhongxing Xu 1ed8d4ba8e Cleanup code with utility method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59951 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 07:02:06 +00:00
Chris Lattner d162584991 Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first.  This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 06:25:27 +00:00
Chris Lattner d9d22dd9c9 Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:29:24 +00:00
Anders Carlsson e8a32b855c Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:23:59 +00:00
Zhongxing Xu 4b89e034a7 Strings are NULL terminated. So the region size should plus one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:16:01 +00:00
Anders Carlsson 35873c49ad The address of a variable is only constant if the variable has global storage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59939 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 04:41:22 +00:00
Anders Carlsson 4bbc0e05a7 Fix bug in the constant evaluator. Fixes PR3115.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59938 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 04:21:33 +00:00
Chris Lattner 39f34e97d6 Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 04:00:27 +00:00
Chris Lattner 8ec03f58c3 Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:54:41 +00:00
Chris Lattner bb49c3ee5d simplify this code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59935 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:52:59 +00:00
Chris Lattner 077bf5e2f4 Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector 
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:33:13 +00:00
Zhongxing Xu d0fd3b747c Add a comment about the signedness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59932 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 02:30:48 +00:00
Zhongxing Xu 6613d08a19 Add getSize() support for StringRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 02:18:56 +00:00