summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* After a lengthy design discussion, add support for "ownership attributes" ↵Ted Kremenek2010-07-311-3/+172
| | | | | | for malloc/free checking. Patch by Andrew McGregor! llvm-svn: 109939
* Correctly deal with using names for both functions and structs in chained PCH.Sebastian Redl2010-07-301-0/+10
| | | | llvm-svn: 109871
* Tighten the rules when deciding if an ivar must beFariborz Jahanian2010-07-301-3/+15
| | | | | | | auto-synthesized (nonfragile-abi2 specific). Fixes radar 8251648. llvm-svn: 109866
* Fixed typedef inside extern "C".Abramo Bagnara2010-07-302-30/+10
| | | | llvm-svn: 109865
* If a TST_typename has a null type, mark the declarator invalid. PreventsJohn McCall2010-07-301-2/+4
| | | | | | some downstream crashes, among them rdar://problem/8229840. llvm-svn: 109850
* Wire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.Nate Begeman2010-07-291-0/+2
| | | | llvm-svn: 109814
* Tigthen the condition for issung ivar shadowingFariborz Jahanian2010-07-291-1/+2
| | | | | | | variables to those in file scope (nonfragile-abi2). Fixes radar 8248681. llvm-svn: 109758
* When dynamic_cast'ing from a type to itself, fill in the cast kindDouglas Gregor2010-07-291-0/+1
| | | | | | with CK_NoOp. Fixes PR7727. llvm-svn: 109757
* When taking the address of a value of Objective-C object type (e.g.,Douglas Gregor2010-07-291-0/+2
| | | | | | | one because we're referencing a variable of type NSString &), the resulting type is an ObjCObjectPointerType. llvm-svn: 109753
* Allow a looser form of compatibility checking (which ignoresDouglas Gregor2010-07-291-3/+5
| | | | | | | qualifiers) when checking a K&R function definition against a previous prototype. Fixes <rdar://problem/8193107>. llvm-svn: 109751
* When deleting a value of class type, make sure that type is completeDouglas Gregor2010-07-291-0/+4
| | | | | | before looking for conversions to pointer type. Fixes <rdar://problem/8248780>. llvm-svn: 109749
* Don't set out-of-line template specialization/definition informationDouglas Gregor2010-07-282-4/+4
| | | | | | | for AST nodes that aren't actually out-of-line (i.e., require a nested-name-specifier). Fixes <rdar://problem/8204126>. llvm-svn: 109704
* Don't die when a member access refers to a non-class member via aDouglas Gregor2010-07-281-0/+3
| | | | | | qualified name. Fixes <rdar://problem/8231724>. llvm-svn: 109682
* When performing code completion for a case statement in a switch whoseDouglas Gregor2010-07-282-4/+25
| | | | | | | condition is not of enumeration type, provide code-completion results containing all values of integral or enumeral type. llvm-svn: 109677
* Enable expression transformations in the current-instantiationDouglas Gregor2010-07-281-9/+0
| | | | | | | rebuilder, i.e., remove a silly short-sighted hack from long ago. Thanks to Abramo Bagnara for the test case/bug report! llvm-svn: 109583
* When a nested-name-specifier refers into a current instantiation that hasDouglas Gregor2010-07-281-6/+13
| | | | | | | | dependent bases, construct a dependent nested-name-specifier rather than complaining that the name could not be found within the current instantiation itself. Fixes PR7725. llvm-svn: 109582
* Fix a minor crash bug with constructs like Obj.Class::ENUM_VALUE.Eli Friedman2010-07-271-4/+4
| | | | llvm-svn: 109537
* PR7724: Don't try to evaluate value-dependent expressions.Eli Friedman2010-07-271-1/+1
| | | | llvm-svn: 109532
* Revert r109428 "Hoist argument type checking into CheckFormatHandler. This ↵Michael J. Spencer2010-07-271-53/+41
| | | | | | | | is prep for scanf format" Got errors about ASTContext being undefined with Visual Studio 2010. llvm-svn: 109491
* Minor code simplification.Dan Gohman2010-07-261-2/+1
| | | | llvm-svn: 109443
* Fix namespace polution.Dan Gohman2010-07-264-1/+12
| | | | llvm-svn: 109440
* Hoist argument type checking into CheckFormatHandler. This is prep for ↵Ted Kremenek2010-07-261-41/+53
| | | | | | | | scanf format string argument type checking. llvm-svn: 109428
* Consolidate #args checking for scanf/printf format strings.Ted Kremenek2010-07-261-30/+31
| | | | llvm-svn: 109427
* Make sure that implicit qualification and derived-to-base conversions of ↵Sebastian Redl2010-07-261-4/+8
| | | | | | xvalues preserve xvalue-ness. Unfortunately I have no idea how to test this property; there doesn't seem to be a syntactical construct that triggers such a conversion and still allows the distinction between prvalues and xvalues to be made. llvm-svn: 109406
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-263-19/+19
| | | | llvm-svn: 109396
* Kill off the last Destroy method in the AST libraryDouglas Gregor2010-07-251-6/+0
| | | | llvm-svn: 109378
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-2515-83/+15
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Remove dead code.Eli Friedman2010-07-241-3/+0
| | | | llvm-svn: 109358
* PR7698: Make sure we correctly handle the initialization of an array withEli Friedman2010-07-241-4/+1
| | | | | | dependent size. llvm-svn: 109356
* turn down the logical bitwise confusion warning to not warn Chris Lattner2010-07-241-11/+14
| | | | | | | | | when the RHS of the ||/&& is ever 0 or 1. This handles a variety of creative idioms for "true" used in C programs and fixes many false positives at the expense of a few false negatives. This fixes rdar://8230351. llvm-svn: 109314
* Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.John McCall2010-07-241-0/+21
| | | | | | Diagnose attempts to do this under the GNU or fragile NeXT runtimes. llvm-svn: 109298
* Be careful; even though we had a proper name at the beginning ofDouglas Gregor2010-07-241-1/+1
| | | | | | | Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating has a useful name. <rdar://problem/8229910> llvm-svn: 109296
* We never want to pop the translation unit DC, so assert if this happens.John McCall2010-07-231-0/+1
| | | | llvm-svn: 109280
* Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.Fariborz Jahanian2010-07-231-0/+2
| | | | | | Radar 8218839. llvm-svn: 109272
* Fix for PR7694: make sure to pass in a RecordType to CheckBaseClassAccess;Eli Friedman2010-07-231-1/+1
| | | | | | | fixes crashes on both valid and invalid code. The diagnostic here could potentially be improved, but it's good enough as-is. llvm-svn: 109257
* Vectors are not integer types, so the type system should not classifyDouglas Gregor2010-07-234-20/+24
| | | | | | | | | | | them as such. Type::is(Signed|Unsigned|)IntegerType() now return false for vector types, and new functions has(Signed|Unsigned|)IntegerRepresentation() cover integer types and vector-of-integer types. This fixes a bunch of latent bugs. Patch from Anton Yartsev! llvm-svn: 109229
* Remove unneeded iostream include.Bill Wendling2010-07-231-2/+0
| | | | llvm-svn: 109219
* Warn when property ivar lookup finds a global variableFariborz Jahanian2010-07-221-2/+31
| | | | | | | of same name. In nonfragile-abi2, lookup accesses a synthesized ivar. This is a transition warning. Radar 8225011. llvm-svn: 109197
* atch for implementation of objective-c's -WselectorFariborz Jahanian2010-07-225-35/+79
| | | | | | | warning flag in clang. Little more to do for a PCH issue. Radar 6507158. llvm-svn: 109129
* Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's ↵Ted Kremenek2010-07-211-1/+1
| | | | | | | | | | | | behavior. Note that GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now Clang's behavior is more strict in this case, but more consistent. We will need to see how much this fires on real code and determine whether this case should be downgraded to a warning. Fixes <rdar://problem/8213093>. llvm-svn: 109033
* Added extra check when looking for location of '=' inFariborz Jahanian2010-07-211-2/+3
| | | | | | a copy initialization. llvm-svn: 109025
* Fix source location of the initializer in Fariborz Jahanian2010-07-212-3/+6
| | | | | | | a copy initialization. Back out hack in objc rewriter. fixes radar 8213998. llvm-svn: 109024
* Hookup checking for invalid length modifiers in scanf format strings.Ted Kremenek2010-07-201-3/+11
| | | | llvm-svn: 108907
* Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace andTed Kremenek2010-07-201-6/+9
| | | | | | | derived 'PrintfConversionSpecifier' from this class. We will do the same for 'ScanfConversionSpecifier'. llvm-svn: 108903
* Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and ↵Ted Kremenek2010-07-201-1/+1
| | | | | | printf checking). llvm-svn: 108900
* Rename diagnostic so that it can be reused with scanf checking. No ↵Ted Kremenek2010-07-201-1/+1
| | | | | | functionality change. llvm-svn: 108896
* Hide FunctionTemplateDecl's specializations folding set as implementation ↵Argyrios Kyrtzidis2010-07-201-18/+10
| | | | | | | | | | | detail and introduce FunctionTemplateDecl::findSpecialization. Redeclarations of specializations will not cause the previous decl to be removed from the set, the set will keep the canonical decl. findSpecialization will return the most recent redeclaration. llvm-svn: 108834
* Hide the specializations folding sets of ClassTemplateDecl as an ↵Argyrios Kyrtzidis2010-07-202-71/+24
| | | | | | | | | | | | | implementation detail (InsertPos leaks though) and add methods to its interface for adding/finding specializations. Simplifies its users a bit and we no longer need to replace specializations in the folding set with their redeclarations. We just return the most recent redeclarations. As a bonus, it fixes http://llvm.org/PR7670. llvm-svn: 108832
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-2010-67/+134
| | | | llvm-svn: 108807
* Don't warn when a '%%' or '%*d' (scanf) is used in a format string with ↵Ted Kremenek2010-07-191-22/+26
| | | | | | | | positional arguments, since these don't actually consume an argument. llvm-svn: 108757
OpenPOWER on IntegriCloud