summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Handle ands with 0 and shifts by 0 correctly. These aren'tDan Gohman2009-04-252-2/+32
| | | | | | common, but indvars shouldn't crash on them. This fixes PR4054. llvm-svn: 70051
* Fix indexing error in PCHStmtReader::VisitArraySubscriptExpr().Steve Naroff2009-04-251-1/+1
| | | | llvm-svn: 70046
* Add PCH support for ObjCMessageExpr (needed to build Mail).Steve Naroff2009-04-254-7/+55
| | | | llvm-svn: 70044
* Fixup comment.Steve Naroff2009-04-251-1/+1
| | | | llvm-svn: 70040
* Fix a major bug in PCHReader::ReadSelectorBlock().Steve Naroff2009-04-252-7/+8
| | | | | | Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris. llvm-svn: 70039
* Fix g++-4.4.0 warning, it was causing llvm-nm to fail on wrapped BC files:Torok Edwin2009-04-252-1/+10
| | | | | | | | | | | | Path.cpp:59: warning: case label value exceeds maximum value for type magic[0] is a (signed) char, but some case values are unsigned (e.g. 0xde). When magic[0] was 0xde, the switch has taken the default branch instead of case 0xde branch. Apparently this was the behaviour with older versions of gcc too, but not with g++. Now g++-4.4 behaves as gcc, and ignores unsigned case values out of range signed range. llvm-svn: 70038
* Do not share a single unknown val# for all the live ranges merged into a ↵Evan Cheng2009-04-253-23/+32
| | | | | | physical sub-register live interval. When coalescer is merging in clobbered virtaul register live interval into a physical register live interval, give each virtual register val# a separate val# in the physical register live interval. Otherwise, the coalescer would have lost track of the definitions information it needs to make correct coalescing decisions. llvm-svn: 70026
* Change SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to Chris Lattner2009-04-256-33/+16
| | | | | | | | | | | | | | | | | | | | | | | | | always return a non-null QualType + error bit. This fixes a bunch of cases that didn't check for null result (and could thus crash) and eliminates some crappy code scattered throughout sema. This also improves the diagnostics in the recursive struct case to eliminate a bogus second error. It also cleans up the case added to function.c by forming a proper function type even though the declarator is erroneous, allowing the parameter to be added to the function. Before: t.c:2:1: error: unknown type name 'unknown_type' unknown_type f(void*P) ^ t.c:4:3: error: use of undeclared identifier 'P' P+1; ^ After: t.c:2:1: error: unknown type name 'unknown_type' unknown_type f(void*P) ^ llvm-svn: 70023
* change a couple more c++ sema methods to be based on isinvalid bits.Chris Lattner2009-04-254-37/+33
| | | | llvm-svn: 70022
* various "is invalid" cleanups for C++ ctors/dtors.Chris Lattner2009-04-254-56/+59
| | | | llvm-svn: 70021
* This is a pretty big cleanup for how invalid decl/type are handle.Chris Lattner2009-04-2514-187/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of a bunch of random InvalidDecl bools in sema, changing us to use the following approach: 1. When analyzing a declspec or declarator, if an error is found, we set a bit in Declarator saying that it is invalid. 2. Once the Decl is created by sema, we immediately set the isInvalid bit on it from what is in the declarator. From this point on, sema consistently looks at and sets the bit on the decl. This gives a very clear separation of concerns and simplifies a bunch of code. In addition to this, this patch makes these changes: 1. it renames DeclSpec::getInvalidType() -> isInvalidType(). 2. various "merge" functions no longer return bools: they just set the invalid bit on the dest decl if invalid. 3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator methods now set invalid on the decl returned instead of returning an invalid bit byref. 4. In SemaType, refering to a typedef that was invalid now propagates the bit into the resultant type. Stuff declared with the invalid typedef will now be marked invalid. 5. Various methods like CheckVariableDeclaration now return void and set the invalid bit on the decl they check. There are a few minor changes to tests with this, but the only major bad result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this next. llvm-svn: 70020
* Fixed the gep example for i16 type indices.Sanjiv Gupta2009-04-251-1/+1
| | | | llvm-svn: 70019
* Revert my PCH change. I'm happy nowDouglas Gregor2009-04-251-1/+1
| | | | llvm-svn: 70018
* Temporarily try to build with PCH by default. Revert this change onceDouglas Gregor2009-04-251-1/+1
| | | | | | we see what trouble it causes. llvm-svn: 70017
* fix PR4049, a crash on invalid, by making sema install the right number of Chris Lattner2009-04-253-14/+34
| | | | | | | | | | | | | | | | | | | | | parameters in a functiondecl, even if the decl is invalid and has a confusing Declarator. On the testcase, we now emit one beautiful diagnostic: t.c:2:1: error: unknown type name 'unknown_type' unknown_type f(void*) ^ GCC 4.0 produces: t.c:2: error: syntax error before ‘f’ t.c: In function ‘f’: t.c:2: error: parameter name omitted and GCC 4.2: t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’ llvm-svn: 70016
* rename getNumParmVarDeclsFromType back to getNumParams(),Chris Lattner2009-04-253-31/+23
| | | | | | | | | remove a special case that was apparently for typeof() and generalize the code in SemaDecl that handles typedefs to handle any sugar type (including typedef, typeof, etc). Improve comment to make it more clear what is going on. llvm-svn: 70015
* add a new helper function to FunctionDecl instead of it beingChris Lattner2009-04-252-5/+13
| | | | | | static in Decl.cpp. llvm-svn: 70014
* in:Chris Lattner2009-04-252-10/+5
| | | | | | | | | | typedef void foo(void); We get a typedef for a functiontypeproto with no arguments, not one with one argument and type void. This means the code being removed in SemaDecl is dead. llvm-svn: 70013
* Driver: -mkernel disables default use of unwind tables (although IDaniel Dunbar2009-04-251-1/+2
| | | | | | don't yet understand where this is happening in llvm-gcc). llvm-svn: 70012
* set NewFD->setInvalidDecl() in one place, sharing code and ensuring thatChris Lattner2009-04-251-15/+6
| | | | | | functions with prototypes get the bit. llvm-svn: 70011
* Driver: -mkernel and -fapple-kext imply -mno-red-zone.Daniel Dunbar2009-04-251-1/+3
| | | | llvm-svn: 70010
* Fix pointer addressing and array subscripting of Objective-C interfaceDaniel Dunbar2009-04-253-5/+82
| | | | | | | | | | | types. - I broke this in the switch to representing interfaces with opaque types. - <rdar://problem/6822660> clang crashes on subscript of interface in 32-bit mode llvm-svn: 70009
* Hook up attribute 'objc_ownership_retain' to the analyzer. This attribute allowsTed Kremenek2009-04-253-4/+15
| | | | | | | users to specify that a method's argument is visibly retained (reference count incremented). llvm-svn: 70008
* Make sure that the consumer sees all interested decls. This fixes PreviewDouglas Gregor2009-04-252-15/+34
| | | | llvm-svn: 70007
* Change LowerCallResult method so that CCValAssign::BCvt can be used withBob Wilson2009-04-251-16/+16
| | | | | | f64 types. This is not used for anything yet. llvm-svn: 70006
* Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked upTed Kremenek2009-04-258-2/+32
| | | | | | | | to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function increments the reference count of a passed object. llvm-svn: 70005
* reject explicit pointer arithmetic on interface pointers in 64-bit objc ABIChris Lattner2009-04-243-15/+42
| | | | llvm-svn: 70004
* When we de-serialize an Objective-C protocol, hand it to the AST consumer so ↵Douglas Gregor2009-04-241-0/+3
| | | | | | that we can create metadata llvm-svn: 70003
* Hook up __attribute__((objc_ownership_returns)) to the retain/release checker.Ted Kremenek2009-04-242-8/+49
| | | | llvm-svn: 70002
* Add new checker-specific attribute 'objc_ownership_returns'. This isn't hookedTed Kremenek2009-04-247-1/+57
| | | | | | | up to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function returns an owned an Objective-C object. llvm-svn: 70001
* Add CXXExprWithCleanupAnders Carlsson2009-04-244-0/+54
| | | | llvm-svn: 70000
* fix the sizeof error recovery issue (sizeof-interface.m:attributeRuns)Chris Lattner2009-04-243-7/+14
| | | | | | | | by correctly propagating the fact that the type was invalid up to the attributeRuns decl, then returning an ExprError when attributeRuns is formed (like we do for normal declrefexprs). llvm-svn: 69998
* Fix a pasto in the lookup of instance methods in the global poolDouglas Gregor2009-04-241-2/+2
| | | | llvm-svn: 69996
* Once the protocol list has been loaded from the PCH file, add it toDouglas Gregor2009-04-241-0/+1
| | | | | | the Objective-C interface. llvm-svn: 69993
* Fix the same false positive reported in PR 2542 and <rdar://problem/6793409>Ted Kremenek2009-04-242-5/+87
| | | | | | involving an NSAnimation object delegating its release to a delegate method. llvm-svn: 69992
* Fix two small but very nasty bugs in the PCH writer for method pools:Douglas Gregor2009-04-241-5/+10
| | | | | | | | | | | | (1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since the reader assumes that bucket data is aligned on 4-byte boundaries. (2) Don't emit the number of factory methods twice. This was throwing off the data counts and therefore causing lookups to fail. I've added asserts so that this class of error cannot happen again. llvm-svn: 69991
* Fix PR 4057, a crash doing float->char const folding.Dale Johannesen2009-04-242-3/+22
| | | | | | | | This particular one is undefined behavior (although this isn't related to the crash), so it will no longer do it at compile time, which seems better. llvm-svn: 69990
* PCH support for the global method pool (= instance and factory methodDouglas Gregor2009-04-2414-29/+534
| | | | | | | | pools, combined). The methods in the global method pool are lazily loaded from an on-disk hash table when Sema looks into its version of the hash tables. llvm-svn: 69989
* Minor refactoring. No intended change in behavior.Fariborz Jahanian2009-04-241-3/+3
| | | | llvm-svn: 69988
* Add PCH support for #import.Steve Naroff2009-04-248-38/+105
| | | | llvm-svn: 69987
* Minor refactoring: pass selector to getCommonMethodSummary(). No functionalityTed Kremenek2009-04-241-9/+7
| | | | | | change. llvm-svn: 69985
* retain/release checker: more hacks to workaround false positives cause byTed Kremenek2009-04-241-2/+21
| | | | | | | delegates. When a reference counted object is passed as to a 'void*' argument to a method stop tracking the reference count. llvm-svn: 69984
* Sentence case bug name.Ted Kremenek2009-04-241-1/+1
| | | | llvm-svn: 69983
* retain/release checker:Ted Kremenek2009-04-242-21/+182
| | | | | | | | | | | - Fix summary lookup for class methods to now use the (optional) ObjCInterfaceDecl associated with a message expression. This removes a long-standing FIXME. - Partial fix for <rdar://problem/6062730> by stop tracking objects that are passed to [NSObject performSelector]. These methods are often used for delegates, which the analyzer doesn't reason about well yet. llvm-svn: 69982
* Make CXXTemporaryObjectExpr inherit from CXXConstructExpr.Anders Carlsson2009-04-242-46/+8
| | | | llvm-svn: 69981
* Avoid issuing spurious errors as side-effect of diagnosingFariborz Jahanian2009-04-242-2/+21
| | | | | | application of sizeof on an interface. llvm-svn: 69980
* Minor refactoring. No change in functionality.Fariborz Jahanian2009-04-241-2/+1
| | | | llvm-svn: 69979
* Adjust a comment to reflect what the code does. Splitting a 64-bit argumentBob Wilson2009-04-241-1/+1
| | | | | | | between registers and the stack may be required with the APCS ABI, but it isn't tied to using a particular version of the ARM architecture. llvm-svn: 69978
* Fix up some problems with getCopyToReg and getCopyFromReg nodes beingBob Wilson2009-04-241-8/+12
| | | | | | | | | chained and "flagged" together. I also made a few changes to handle the chain and flag values more consistently. I found these problems by inspection so I'm not aware of anything that breaks because of them (thus no testcase). llvm-svn: 69977
* Use a bigger hammer to coerce subversion into english.Gabor Greif2009-04-241-1/+1
| | | | | | Patch by Benjamin Kramer! llvm-svn: 69976
OpenPOWER on IntegriCloud