summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a comment to a helper function.Chandler Carruth2010-12-121-0/+2
| | | | llvm-svn: 121632
* Sink the logic to suppress builtin operator overloads in the presence ofChandler Carruth2010-12-121-52/+52
| | | | | | | | | | | user-defined operator overloads on the same enumeral types to the one place where it is used. In theory this removes wasted computation from several paths through this code, but I'm not aware of a case where it actually matters. This is mostly for cleanliness. llvm-svn: 121630
* Reorder the cases in the switch to be more logically grouped (to my mind). IfChandler Carruth2010-12-121-34/+34
| | | | | | | others have another ordering they would prefer, I'm all ears, but this one made it much easier for me to find the group of operators I'm interested in. llvm-svn: 121629
* Remove the final goto from this switch making it explict which overload set isChandler Carruth2010-12-121-2/+3
| | | | | | added for binary operator&. llvm-svn: 121628
* Fold away completely identical code with simple fallthrough.Chandler Carruth2010-12-121-7/+2
| | | | llvm-svn: 121627
* Move and copy function calls around to remove the indirection through gotosChandler Carruth2010-12-121-14/+10
| | | | | | from the switch statement. llvm-svn: 121626
* Simplify the flow through the switch by explicitly listing the added overloadsChandler Carruth2010-12-121-13/+7
| | | | | | for a few cases. llvm-svn: 121625
* Fix 80-column violations and reflowing some code to facilitate those fixes.Chandler Carruth2010-12-121-48/+59
| | | | llvm-svn: 121624
* Begin the refactoring of how builtin operators are added to the overloadChandler Carruth2010-12-121-736/+842
| | | | | | | | | | | | | | candidate set. This breaks apart a huge switch + goto system into distinct methods on a class. It also places the current mess of tables and other static state used in the process within that class. This is still a work in progress. I did a few simplifications that jumped out at me as I went, but I plan to iterate on this a bit before it's truly clean. However, this is easily the most invasive chunk. I benchmarked it on all-std-headers.cpp and an internal testcase that has a major hotspot in overload resolution and saw no real performance impact. llvm-svn: 121623
* Enhance my implementation of //rdar ://8747333 in r121597 to allowFariborz Jahanian2010-12-111-19/+32
| | | | | | | | for declaration of property setter/getter in forward class extensions and also skip over propeties which are @dynamic. llvm-svn: 121617
* Any property declared in a class extension might have userFariborz Jahanian2010-12-102-3/+27
| | | | | | | | | | | declared setter or getter in current class extension or one of the other class extensions. Mark them as synthesized as property will be synthesized when property with same name is seen in the @implementation. This prevents bogus warning about unimplemented methods to be issued for these methods. Fixes // rdar://8747333 llvm-svn: 121597
* Keep the source location of the selector in ObjCMessageExpr.Argyrios Kyrtzidis2010-12-102-28/+35
| | | | llvm-svn: 121516
* Do not assert on shifts of Neon polynomial types.Bob Wilson2010-12-101-4/+2
| | | | | | | | Most Neon shift intrinsics do not have variants for polynomial types, but vsri_n and vsli_n do support them, and we need to properly range-check the shift immediates for them. llvm-svn: 121509
* Silence a few more uninitialized-value warningsDouglas Gregor2010-12-101-8/+8
| | | | llvm-svn: 121505
* Do not substitute template types if template has dependent contextPeter Collingbourne2010-12-101-2/+5
| | | | | | | | | We should not substitute template types if the template has a dependent context because the template argument stack is not yet fully formed. Instead, defer substitution until the template has a non-dependent context (i.e. instantiation of an outer template). llvm-svn: 121491
* Fix a compiler warning.Fariborz Jahanian2010-12-101-1/+2
| | | | llvm-svn: 121490
* Added ParenType type node.Abramo Bagnara2010-12-107-14/+66
| | | | llvm-svn: 121488
* It's kindof silly that ExtQuals has an ASTContext&, and we can use thatJohn McCall2010-12-106-18/+20
| | | | | | | | | | space better. Remove this reference. To make that work, change some APIs (most importantly, getDesugaredType()) to take an ASTContext& if they need to return a QualType. Simultaneously, diminish the need to return a QualType by introducing some useful APIs on SplitQualType, which is just a std::pair<const Type *, Qualifiers>. llvm-svn: 121478
* Use TypeAlignment constant rather than fixed alignment of 8Douglas Gregor2010-12-101-1/+2
| | | | llvm-svn: 121473
* Treat visibility on an enclosing namespace as a non-explicit source ofJohn McCall2010-12-102-9/+16
| | | | | | | | | | | visibility. Fixes PR8713. I've disabled a test which was testing that you can #pragma pop visibility to get out of a namespace's visibility attribute. We should probably just diagnose that as an error unless it's instrumental to someone's system headers. llvm-svn: 121459
* Bind the result of a property fetch to a temporary.John McCall2010-12-101-0/+4
| | | | llvm-svn: 121452
* Refactored/cleanedup ActOnFunctionDeclarator Fariborz Jahanian2010-12-091-521/+563
| | | | | | | and ActOnVariableDeclarator No functionality change. // rdar://8751949 llvm-svn: 121427
* Eliminate duplicate code completions for properties.Douglas Gregor2010-12-091-11/+25
| | | | llvm-svn: 121424
* Don't walk the translation unit context to produce protocol names whenDouglas Gregor2010-12-092-19/+40
| | | | | | | | | | global code completions are disabled (e.g., because they are cached). Also, make sure that forward-declared protocols are visited when we look for all visible names within a declaration context. Previously, we would end up with duplicate completions for protocols. llvm-svn: 121416
* Fix PR8760: IndirectFieldDecl Type was not updated during template ↵Francois Pichet2010-12-091-1/+2
| | | | | | instantiation. llvm-svn: 121363
* A typename specifier can end up referring to a unresolved usingDouglas Gregor2010-12-091-1/+18
| | | | | | | | declaration that is a value in ill-formed code. Instead of crashing, treat this as a dependent typename specifier and suggest that the using add "typename" into the using declaration. Fixes <rdar://problem/8740998>. llvm-svn: 121322
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-083-67/+18
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Bump up property conversion earlier in the initialization process. FixesJohn McCall2010-12-072-2/+6
| | | | | | the failed compile in PR8751. llvm-svn: 121192
* Fix PR8720 by printing an error message with a substring that the gcc ↵Rafael Espindola2010-12-071-0/+5
| | | | | | testsuite searches for. llvm-svn: 121137
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-078-33/+36
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121121
* Kill FullExpr, as it was not, in fact, used anywhere in the code base.John McCall2010-12-071-16/+0
| | | | | | | I'm not opposed to the idea in concept, but there's no point in preserving abortive experiments. llvm-svn: 121083
* Use Sema::MaybeCreateExprWithCleanups() only after we've checked for a ↵Douglas Gregor2010-12-073-15/+10
| | | | | | NULL/invalid expression llvm-svn: 121081
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-072-0/+104
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Objective-C pointer conversions to 'id' or qualified 'id' subsumeDouglas Gregor2010-12-061-0/+5
| | | | | | | | cv-qualification conversions. More specifically, there's an implicit cv-qualification conversion (even one that drops qualifiers) when converting to 'id' or qualified 'id'. Fixes <rdar://problem/8734046>. llvm-svn: 121047
* Split out a function to do lvalue conversion on objects; this is basicallyJohn McCall2010-12-061-42/+51
| | | | | | | | | | FunctionArrayLvalueConversion but without the function/array decay. Generally this is only appropriate for use sites that know the type of the expression and thus that it can't be subject to the decays. Also make sure we do lvalue-to-rvalue on the bases of ivar references. llvm-svn: 121035
* Remove a fixme which was fixed in a previous commit.Argyrios Kyrtzidis2010-12-061-2/+0
| | | | llvm-svn: 121029
* Do unary conversions on vararg arguments and *then* special-case float.John McCall2010-12-061-4/+3
| | | | | | Fixes PR8742. llvm-svn: 121022
* Use Sema's MarkDeclarationReferenced, which takes care of templates, instead ↵Argyrios Kyrtzidis2010-12-061-1/+1
| | | | | | | | of calling Decl's setUsed directly. Thanks to John for the hint! llvm-svn: 121014
* Use the source location of the parameter, when it makes sense, for ↵Argyrios Kyrtzidis2010-12-061-8/+10
| | | | | | diagnostics in HandleCleanupAttr. llvm-svn: 121013
* Un-templatetize this method. It's definition is out of line in the .cpp file,Chandler Carruth2010-12-061-54/+52
| | | | | | | | | | | | | so that's not a valid thing to do at all. Instead, switch to a ValueDecl argument, the template isn't really necessary here. When handling the types explicitly in the code, it becomes awkward to cerate the CXXBaseOrMemberInitializer object in so many places. Re-flow the code to calculate the Init expression first, and then create the initializer. If this is too gross, we can factor the init expression logic into helper functions, but it's not past my threshold yet. llvm-svn: 120997
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-069-39/+38
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Clarify the logic for when to build an overloaded binop. In particular,John McCall2010-12-061-17/+27
| | | | | | | | | build one when either of the operands calls itself type-dependent; previously we were building when one of the operand types was dependent, which is not always the same thing and which can lead to unfortunate inconsistencies later. Fixes PR8739. llvm-svn: 120990
* First pass at implementing the intent of ANSI C DR106.John McCall2010-12-042-2/+10
| | | | llvm-svn: 120904
* dyn_cast else unreachable -> castJohn McCall2010-12-041-4/+2
| | | | llvm-svn: 120902
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-043-60/+53
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Don't crash when initializing a subaggregate in C from a property r-value.John McCall2010-12-041-0/+1
| | | | llvm-svn: 120899
* Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn'tJohn McCall2010-12-041-4/+52
| | | | | | | be required, and then fix up some missing loads on overloaded-operator paths which that exposed. llvm-svn: 120896
* When deciding whether to complain about the type of a boolean condition, useJohn McCall2010-12-041-2/+2
| | | | | | the type of the expression *after* array/function decay. llvm-svn: 120895
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-047-73/+194
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Implement -cl-single-precision-constantPeter Collingbourne2010-12-041-0/+3
| | | | llvm-svn: 120877
OpenPOWER on IntegriCloud