summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the getDiagnosticLevel check since it doesn't buy us much.Argyrios Kyrtzidis2010-11-181-3/+1
| | | | llvm-svn: 119719
* In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (seeCraig Silverstein2010-11-181-3/+8
| | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to rjmccall for all the coaching! Approved by rjmccall llvm-svn: 119697
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-1810-224/+416
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev2010-11-181-0/+5
| | | | llvm-svn: 119678
* -Rename -Wargument-larger-than -> -Wlarge-by-value-copyArgyrios Kyrtzidis2010-11-181-3/+7
| | | | | | | | | -Improve the diagnostic message -Add some comments Suggestions by Chris. llvm-svn: 119594
* Introduce option -Wargument-larger-than[=N] which warns about function ↵Argyrios Kyrtzidis2010-11-171-1/+37
| | | | | | | | | | definitions if they take by-value or return by-value any POD that is larger than some threshold (default is 64 bytes). Implements rdar://8548050. llvm-svn: 119583
* Do not produce "purely informative" code completion results forDouglas Gregor2010-11-171-22/+35
| | | | | | | Objective-C message sends, which have only whitespace in their TypedText chunk. Such results have no purpose. llvm-svn: 119569
* Warn if direct accessing synthesized ivar backing the property inFariborz Jahanian2010-11-171-1/+7
| | | | | | nonofragile-abi2. Fixes //rdar://8673791 llvm-svn: 119543
* Don't emit warn_logical_and_in_logical_or for cases like "a && b || 0".Argyrios Kyrtzidis2010-11-171-6/+19
| | | | llvm-svn: 119540
* Don't emit warn_logical_and_in_logical_or for macros. Fixes rdar://8678458Argyrios Kyrtzidis2010-11-171-1/+1
| | | | llvm-svn: 119537
* Don't warn for parentheses for the '&&' inside '||' for cases like:Argyrios Kyrtzidis2010-11-171-11/+52
| | | | | | | | | | | | assert(a || b && "bad"); since this is safe. This way we avoid a big source of such warnings which in this case are practically useless. Note that we don't handle *all* cases where precedence wouldn't matter because of constants since this is a bit costly to check, and IMO clarifying precedence with parentheses is good for readability in general. llvm-svn: 119533
* Drop the warning about __attribute__((may_alias)) being usedDan Gohman2010-11-171-6/+0
| | | | | | | on a non-type declaration, as GCC permits it on variables too. This fixes PR8635. llvm-svn: 119517
* a metric ton of refactoring later, Sema::getLocationOfStringLiteralByte Chris Lattner2010-11-171-63/+3
| | | | | | | | no longer depends on Preprocessor, so we can move it out of Sema into a nice new StringLiteral::getLocationOfByte method that can be used by any AST client. llvm-svn: 119481
* propagate preprocessor out of StringLiteralParser. It is nowChris Lattner2010-11-171-2/+2
| | | | | | possible to create one without a preprocessor. llvm-svn: 119476
* push use of Preprocessor out farther.Chris Lattner2010-11-171-5/+2
| | | | llvm-svn: 119471
* push use of Preprocessor out of getOffsetOfStringByte Chris Lattner2010-11-171-1/+3
| | | | llvm-svn: 119470
* refactor the interface to StringLiteralParser::getOffsetOfStringByte,Chris Lattner2010-11-171-1/+1
| | | | | | pushing the dependency on the preprocessor out a bit. llvm-svn: 119468
* For an Objective-C @synthesize statement, e.g.,Douglas Gregor2010-11-171-3/+5
| | | | | | | | | @synthesize foo = _foo; keep track of the location of the ivar ("_foo"). Teach libclang to visit the ivar as a member reference. llvm-svn: 119447
* Front-end support for __attribute__((may_alias)). This is notDan Gohman2010-11-172-1/+18
| | | | | | yet hooked up to anything yet. llvm-svn: 119407
* Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922Argyrios Kyrtzidis2010-11-161-3/+23
| | | | llvm-svn: 119381
* Implements __block API for c++ objects. There is stillFariborz Jahanian2010-11-161-10/+14
| | | | | | | issue with runtime which I am discussing it with Blaine. This is wip (so no test yet). llvm-svn: 119368
* Fix PR8625 and correctly interpret member-calls to static members whenChandler Carruth2010-11-161-6/+10
| | | | | | | | | | | | producing warnings. This feels really fragile, and I've not audited all other argument index-based warnings. I suspect we'll grow this bug on another warning eventually. It might be nice to adjust the argument indices when building up the attribute AST node, as we already have to remember about the 'this' argument within that code to produce correct errors. llvm-svn: 119340
* Re-work the handling of implicit 'this' arguments and silly GCC-style attributeChandler Carruth2010-11-161-19/+56
| | | | | | | | | | | | | | | | argument indexes. This handles the offsets in a consistent manner for all of the attributes which I saw working with these concepts. I've also added tests for the attribute that motivated this: nonnull. I consolidated the tests for format attributes into one file, and fleshed them out a bit to trigger more of the warning cases. Also improved the quality of some of the diagnostics that occur with invalid argument indices. The only really questionable change here is supporting the implicit this argument for the ownership attribute. I'm not sure it's really a sensible concept there, but implemented the logic for consistency. llvm-svn: 119339
* Improve diagnostic for calling non-const method on const object. Fixes ↵Argyrios Kyrtzidis2010-11-161-1/+17
| | | | | | rdar://7743000 llvm-svn: 119336
* Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall2010-11-162-4/+2
| | | | llvm-svn: 119331
* Kill off the remaining places which generate CK_Unknown casts.John McCall2010-11-163-18/+36
| | | | llvm-svn: 119326
* Add an ExternalASTSource hook to complete a type on demand.John McCall2010-11-161-5/+8
| | | | llvm-svn: 119316
* Add support for "neon_vector_type" and "neon_polyvector_type" attributesBob Wilson2010-11-163-0/+71
| | | | | | | | to create the special Neon vector types. These are intended to be used in Clang's version of <arm_neon.h> to define special Neon vector types that will be mangled according to ARM's ABI. llvm-svn: 119301
* Fix a comment typo.Bob Wilson2010-11-161-1/+1
| | | | llvm-svn: 119298
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-151-0/+8
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Implement C++0x [temp.func.order]p3 (aka DR532) properly. InDouglas Gregor2010-11-151-5/+33
| | | | | | | | | | | | | particular, we only add the implement object parameter type if only one of the function templates is a non-static member function template. Moreover, since this DR differs from existing practice in C++98/03, this commit implements the existing practice (which ignores the first parameter of the function template that is not the non-static member function template) in C++98/03 mode. llvm-svn: 119145
* Yes, vector conversions are bitcasts.John McCall2010-11-151-3/+3
| | | | llvm-svn: 119141
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-159-150/+291
| | | | llvm-svn: 119138
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-141-30/+128
| | | | | | | | | | implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. llvm-svn: 119036
* When complaining about ambiguous overload resolution for a unary orDouglas Gregor2010-11-131-6/+10
| | | | | | binary operator, provide the types. llvm-svn: 119008
* When we're type-checking the result of calling a conversion functionDouglas Gregor2010-11-131-2/+9
| | | | | | | | | | (while computing user conversion sequences), make sure that a result of class type is a complete class type. Had we gone through ActOnCallExpr, this would have happened when we built the CallExpr. Fixes PR8425. llvm-svn: 119005
* Introduce five new cast kinds for various conversions into andJohn McCall2010-11-131-26/+42
| | | | | | between complex types. llvm-svn: 118994
* Bring UsualArithmeticConversionsType back into Sema and cast theJohn McCall2010-11-131-10/+244
| | | | | | | operands appropriately. There are a lot of missing complex-related cast kinds. llvm-svn: 118993
* Pre-compute all possible usual-arithmetic-conversions results for theJohn McCall2010-11-131-26/+85
| | | | | | | | | | promoted arithmetic types for which builtin operator candidates are emitted. A few of these need further analysis. Removes all the uses of UsualArithmeticConversionsType except the core function in SemaExpr.cpp. llvm-svn: 118988
* Store the list of arithmetic types as a static array of member pointersJohn McCall2010-11-131-23/+39
| | | | | | | instead of copying them all out at the start. Not a significant optimization. llvm-svn: 118967
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-134-17/+30
| | | | llvm-svn: 118966
* Implement C++ [over.match.funcs]p4 as it concerns partial ordering ofDouglas Gregor2010-11-121-4/+40
| | | | | | function templates. Fixes PR8130. llvm-svn: 118944
* Replace one hack with a different hack: strip out the ObjectTypeJohn McCall2010-11-122-210/+244
| | | | | | | | | parameters to the Transform*Type functions and instead call out the specific cases where an object type and the unqualified lookup results are important. Fixes an assert and failed compile on a testcase from PR7248. llvm-svn: 118887
* When performing initialization of a copy of a temporary object, useDouglas Gregor2010-11-121-3/+5
| | | | | | | direct-initialization (rather than copy-initialization) to initialize the temporary, allowing explicit constructors. Fixes PR8342. llvm-svn: 118880
* Undo a refactor-o and base the bitfield-truncation warning on theJohn McCall2010-11-111-1/+5
| | | | | | | uncoerced value. Also, whitelist bool bitfields, which aren't really a truncation. llvm-svn: 118778
* Extend the bitfield-truncation warning to initializations.John McCall2010-11-112-39/+68
| | | | | | rdar://problem/8652606 llvm-svn: 118773
* Unnest; no functionality change.John McCall2010-11-111-42/+42
| | | | llvm-svn: 118753
* Adding couple of Block API, a bug fix andFariborz Jahanian2010-11-111-6/+8
| | | | | | a test change, all for blocks. wip. llvm-svn: 118745
* When -Wconversion computes the range of a type, it uses the (bit-)range John McCall2010-11-101-19/+40
| | | | | | | | | | | of the enumerators rather than the actual expressible range. This is great when dealing with opaque *values* of that type, but when computing the range of the type for purposes of converting *into* it, it produces warnings in cases we don't care about (e.g. enum_t x = 500;). Divide the logic into these two cases and use the more conservative range for targets. llvm-svn: 118735
* Add a variant of GCC-style vector types for ARM NEON.Bob Wilson2010-11-104-12/+12
| | | | | | | | | NEON vector types need to be mangled in a special way to comply with ARM's ABI, similar to some of the AltiVec-specific vector types. This patch is mostly just renaming a bunch of "AltiVecSpecific" things, since they will no longer be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum. llvm-svn: 118724
OpenPOWER on IntegriCloud