summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Convert SemaCXXScopeSpec.cpp to pass a callback object to CorrectTypo,Kaelyn Uhrain2012-01-121-3/+22
| | | | | | improvng the typo correction results in certain situations. llvm-svn: 148052
* objc: do not warn when converting to a const id qualfied by itsFariborz Jahanian2012-01-121-1/+3
| | | | | | list of protools. // rdar://10669694 llvm-svn: 148051
* Convert SemaInit.cpp to pass a callback object to CorrectTypo.Kaelyn Uhrain2012-01-121-7/+25
| | | | | | | And once again improve the typo correction results in certain situations just by moving the existing checks on the correction. llvm-svn: 148037
* In Objective-C++, actually compute the base type of a member accessDouglas Gregor2012-01-122-12/+23
| | | | | | | | expression for an Objective-C object or pointer type, so that we don't attempt to treat the member name as a template. Fixes <rdar://problem/10672501>. llvm-svn: 148028
* Add IsImplicit field in ObjCMessageExpr that is true when the messageArgyrios Kyrtzidis2012-01-122-36/+57
| | | | | | | | | | was constructed, e.g. for a property access. This allows the selector identifier locations machinery for ObjCMessageExpr to function correctly, in that there are not real locations to handle/report for such a message. llvm-svn: 148013
* Fix some edge cases with C++ casts and placeholder expressions.Eli Friedman2012-01-121-12/+15
| | | | llvm-svn: 147984
* objective-c: fixes a regression in looking up namesFariborz Jahanian2012-01-121-2/+5
| | | | | | | in class extensions and categories by recent refactoring of objc class ASTs. // rdar://1066654 llvm-svn: 147982
* Improve the diagnostic when trying to redefine a typedef with aDouglas Gregor2012-01-111-1/+12
| | | | | | variably-modified type. llvm-svn: 147973
* Fix the caching in CorrectTypo so that other non-keyword identifiersKaelyn Uhrain2012-01-112-2/+4
| | | | | | | | | | | | | | are still added if the cached correction fails validation. Also fix a copy-and-paste error in a comment from my previous commit. Finally, add an example of the benefit the typo correction callback adds to TryNamespaceTypoCorrection--which happens to also tickle the above caching problem, as the only way a non-namespace Decl would be added to the possible corrections is if it was cached as the correction for a previous instance of the same typo where the typo was corrected to a non-namespace via a different code path. llvm-svn: 147968
* minor refactoring to improve compile-time performance.Fariborz Jahanian2012-01-111-2/+2
| | | | llvm-svn: 147963
* Add initial callback object support to Sema::CorrectTypo.Kaelyn Uhrain2012-01-112-103/+182
| | | | | | | | | Also includes two examples of the callback: a wrapper/replacement for the CorrectTypoContext enum, and a conversion of the two calls to CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable improvement to the typo correction, as demonstrated in the added test). llvm-svn: 147962
* objc-arc: evaluate 'readonly' property with no knownFariborz Jahanian2012-01-111-6/+55
| | | | | | | life-time to that of its backing 'ivar's lifetime. // rdar://10558871 llvm-svn: 147956
* C11 allows typedefs to be redefined. Implement this in C11 mode, andDouglas Gregor2012-01-111-4/+2
| | | | | | | downgrade the default-error warning to an ExtWarn in C90/99. <rdar://problem/10668057> llvm-svn: 147925
* Start refactoring code for capturing variables and 'this' so that it is ↵Eli Friedman2012-01-114-57/+57
| | | | | | shared between lambda expressions and block literals. llvm-svn: 147917
* Do placeholder conversions on array bounds in both declarators andJohn McCall2012-01-112-4/+14
| | | | | | new-expressions. llvm-svn: 147900
* When something goes wrong in type-checking a namespace definition, make the ↵Douglas Gregor2012-01-101-1/+5
| | | | | | namespace declaration invalid llvm-svn: 147882
* objc-arc: fixes a crash when trying to find out retaining cycleFariborz Jahanian2012-01-101-4/+12
| | | | | | ownership of property sent to 'super'. // rdar://10640891 llvm-svn: 147868
* Remove a set, but unused variable. Found with GCC's warning.Chandler Carruth2012-01-101-4/+1
| | | | llvm-svn: 147864
* Implement the missing pieces of Evaluate for _Complex types. With that ↵Eli Friedman2012-01-101-1/+2
| | | | | | complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.) llvm-svn: 147840
* Per John's comment, it makes sense to ask isLambda on any CXXRecordDecl; ↵Eli Friedman2012-01-101-1/+0
| | | | | | make sure that's safe. Get rid of a check which is now unnecessary in Sema::getFunctionLevelDeclContext(). llvm-svn: 147837
* Update C++11 scoped enumeration support to match the final proposal:Richard Smith2012-01-103-3/+15
| | | | | | | | - reject definitions of enums within friend declarations - require 'enum', not 'enum class', for non-declaring references to scoped enumerations llvm-svn: 147824
* objc++: patch for IRgen for atomic properties ofFariborz Jahanian2012-01-101-2/+6
| | | | | | | c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 llvm-svn: 147817
* Don't crash with -Wlarge-by-value-copy and a dependent type. PR11726.Eli Friedman2012-01-091-2/+2
| | | | llvm-svn: 147812
* Fix "note" of a duplicate explicit instantiation definition following a ↵Nico Weber2012-01-091-9/+20
| | | | | | specialization. llvm-svn: 147798
* Always allow redefinition of typedefs when modules are enabled. ThisDouglas Gregor2012-01-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | is important because it's fairly common for headers (especially system headers) to want to provide only those typedefs needed for that particular header, based on some guard macro, e.g., #ifndef _SIZE_T #define _SIZE_T typedef long size_t; #endif which is repeated in a number of headers. The guard macro protects against duplicate definitions. However, this means that only the first occurrence of this pattern actually defines size_t, so the submodule corresponding to this header has the only visible definition. If a user then imports a different submodule from the same module, size_t will be known but not visible, and therefore cannot be used. By allowing redefinition of typedefs, each header that wants to define size_t can do so independently, so it will be available in the corresponding submodules. llvm-svn: 147775
* Made unknown builtin diagnostic remappable.Abramo Bagnara2012-01-091-1/+1
| | | | llvm-svn: 147774
* Fixed TypeofExpr AST and code generation.Abramo Bagnara2012-01-071-19/+0
| | | | llvm-svn: 147730
* Switch NamespaceDecl from its own hand-rolled redeclaration chain overDouglas Gregor2012-01-072-86/+76
| | | | | | | | | | | | to Redeclarable<NamespaceDecl>, so that we benefit from the improveed redeclaration deserialization and merging logic provided by Redeclarable<T>. Otherwise, no functionality change. As a drive-by fix, collapse the "inline" bit into the low bit of the original namespace/anonymous namespace, saving 8 bytes per NamespaceDecl on x86_64. llvm-svn: 147729
* More lambda work: semantic analysis of capturing 'this'. It's a bit ↵Eli Friedman2012-01-076-35/+88
| | | | | | complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.) llvm-svn: 147723
* Lambdas: semantic analysis of explicit captures.Eli Friedman2012-01-071-5/+78
| | | | | | This patch (and some of my other commits related to lambdas) is heavily based off of John Freeman's work-in-progress patches. llvm-svn: 147706
* Suppress -Wunused-value within macros from system headers.Matt Beaumont-Gay2012-01-062-14/+10
| | | | | | | Along the way, move a helper function from SemaChecking.cpp to a more accessible home in SourceManager. llvm-svn: 147692
* During name lookup, use redecl_iterator to walk over the redeclarationDouglas Gregor2012-01-061-23/+6
| | | | | | | | | | | | | chain to determine whether any declaration of the given entity is visible, eliminating the redundant (and less efficient) getPreviousDeclaration() implementation. This tweak uncovered an omission in the handling of RedeclarableTemplateDecl, where we weren't making sure to search for additional redeclarations of a template in other module files. Things would be cleaner if RedeclarableTemplateDecl actually used Redeclarable. llvm-svn: 147687
* Improvements to the uninitialized variable warning: Check if the constructorRafael Espindola2012-01-061-5/+12
| | | | | | | call is elidable or if the constructor is trivial instead of checking if it is user declared. llvm-svn: 147652
* More lambda work. Fixes a minor bug Richard pointed out, makes lookup for ↵Eli Friedman2012-01-063-14/+62
| | | | | | lambda parameters work correctly, recording more information into the AST. llvm-svn: 147650
* David Blaikie and Chandler would like us to diagnoseRichard Smith2012-01-061-2/+1
| | | | | | | | int f(); in function scopes under -Wvexing-parse, so now we do. llvm-svn: 147649
* Tweak to r147599 for PR10828: Move the check from the parser into sema, and useRichard Smith2012-01-061-0/+19
| | | | | | | the Semantic Powers to only warn on class types (or dependent types), where the constructor or destructor could do something interesting. llvm-svn: 147642
* Minor refactoring of sentinel warning on blocks. Add a test for this warning.Eli Friedman2012-01-062-10/+5
| | | | llvm-svn: 147641
* After further discussion, rename attribute ↵Ted Kremenek2012-01-054-10/+10
| | | | | | 'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'. llvm-svn: 147622
* Tweak the fix to PR8977: an empty expression-list represents value ↵Eli Friedman2012-01-052-8/+14
| | | | | | initialization, not default initialization. Fixes PR11712. llvm-svn: 147620
* More lambda work. Tweak the Sema interface slightly. Start adding the ↵Eli Friedman2012-01-055-18/+71
| | | | | | pieces to build the lambda class and its call operator. Create an actual scope for the lambda body. llvm-svn: 147595
* When we're performing name lookup for a tag, we still allow ourselvesDouglas Gregor2012-01-051-2/+2
| | | | | | | | | | | | | | | | | | to see hidden declarations because every tag lookup is effectively a redeclaration lookup. For example, image that struct foo; is declared in a submodule that is known but hasn't been imported. If someone later writes struct foo *foo_p; then "struct foo" is either a reference or a redeclaration. To keep the redeclaration chains sound, we treat it like a redeclaration for name-lookup purposes. llvm-svn: 147588
* Minor cleanup; no functional change.Eli Friedman2012-01-051-3/+2
| | | | llvm-svn: 147582
* The value of a const weak variable is not an integer constant.John McCall2012-01-052-1/+16
| | | | llvm-svn: 147575
* Rename attribute 'objc_suppress_autosynthesis' to ↵Ted Kremenek2012-01-042-2/+2
| | | | | | 'objc_disable_automatic_synthesis'. llvm-svn: 147567
* Store the submodules of a module in source order, as they are storedDouglas Gregor2012-01-041-3/+3
| | | | | | | | in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
* objc: When issuing warning for missing synthesis forFariborz Jahanian2012-01-041-0/+9
| | | | | | | properties in classes declared with objc_suppress_autosynthesis attribute, pinpoint location of the said class in a note. llvm-svn: 147562
* Add an APValue representation for the difference between two ↵Eli Friedman2012-01-041-1/+1
| | | | | | | | | | address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer. With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary. Fixes PR11705. llvm-svn: 147561
* Implement declaration merging for typedefs loaded from disjointDouglas Gregor2012-01-041-21/+20
| | | | | | | | | | | modules, so long as the typedefs refer to the same underlying type. This ensures that the typedefs end up in the same redeclaration chain. To test this, fix name lookup for C/Objective-C to properly deal with multiple declarations with the same name in the same scope. llvm-svn: 147533
* Process attributes in explicit function template instantiations. Fixes part ofRafael Espindola2012-01-041-0/+3
| | | | | | PR11690. llvm-svn: 147523
* Add an explicit LambdaExprContext to Declarator, to parallel ↵Eli Friedman2012-01-042-4/+15
| | | | | | BlockLiteralContext. Use it to ensure semantic analysis of types isn't confused by the lack of a type specifier. llvm-svn: 147522
OpenPOWER on IntegriCloud