summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Represent an APValue based on a Decl as that Decl, rather than a DeclRefExprRichard Smith2011-11-121-0/+1
| | | | | | | | or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to static member functions and static data members are now emitted as constant expressions. llvm-svn: 144468
* Add a method in ASTMutationListener for the last use of Decl's ↵Argyrios Kyrtzidis2011-11-121-2/+5
| | | | | | | | [is/set]ChangedSinceDeserialization and remove them. llvm-svn: 144466
* [PCH] When completing an objc forward reference, do not serialize the chain ↵Argyrios Kyrtzidis2011-11-121-10/+6
| | | | | | | | | | | | | | | of its categories because it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its categories list when deserializing. Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization is bug inducing and kinda gross, we should phase it out. Fixes infinite loop in rdar://10418538. llvm-svn: 144465
* Remove unnecessary 'else's after 'return's.David Blaikie2011-11-121-1/+2
| | | | llvm-svn: 144464
* Add missing casts to AST.Eli Friedman2011-11-121-1/+8
| | | | llvm-svn: 144455
* Don't apply NRVO to over-aligned variables. The caller onlyJohn McCall2011-11-111-7/+23
| | | | | | guarantees alignment up to the ABI alignment of the return type. llvm-svn: 144364
* Be sure to insulate block literals from any cleanups in theirJohn McCall2011-11-111-0/+12
| | | | | | | enclosing full-expressions. It is somewhat amazing that this hasn't come up as a problem before. llvm-svn: 144362
* Make sure that restrict-qualifying an array actually adds a restrict ↵Eli Friedman2011-11-111-2/+1
| | | | | | qualifier. PR11354. (operator bool() is evil!) llvm-svn: 144355
* Move "Unqualified lookup into dependent bases of class templates" Microsoft ↵Francois Pichet2011-11-111-1/+1
| | | | | | specific behavior from -fms-extensions to -fms-compatibility. llvm-svn: 144341
* Implicit casts from rvalue to lvalue are not meaningful. Don't accidentally addRichard Smith2011-11-102-1/+2
| | | | | | | | | | them when performing a const conversion on the implicit object argument for a member operator call on an rvalue. No change to the testsuite: the test for this change is that the added assertion does not fire any more. llvm-svn: 144333
* Constant expression evaluation: support for evaluation of structs and unions ofRichard Smith2011-11-101-3/+3
| | | | | | | literal types, as well as derived-to-base casts for lvalues and derived-to-virtual-base casts. llvm-svn: 144265
* Removing unused initialization.David Blaikie2011-11-101-2/+1
| | | | llvm-svn: 144264
* There's no good reason to track temporaries in ExprWithCleanups,John McCall2011-11-105-35/+58
| | | | | | | but it is sometimes useful to track blocks. Do so. Also optimize the storage of these expressions. llvm-svn: 144263
* Don't crash when transforming an ill-formed pseudo-destructorDouglas Gregor2011-11-091-1/+1
| | | | | | expression. Fixes PR11339. llvm-svn: 144159
* Introduce proper spacing after the Objective-C parameter qualifiersDouglas Gregor2011-11-091-11/+6
| | | | | | (bycopy, inout, etc.). Fixes <rdar://problem/10402900>. llvm-svn: 144157
* Don't crash on invalid objc code.Argyrios Kyrtzidis2011-11-091-0/+5
| | | | llvm-svn: 144150
* objc: Don't crash on missing @interface decl.Fariborz Jahanian2011-11-081-6/+7
| | | | | | // rdar://10415026 llvm-svn: 144143
* objc-arc: 'readonly' property of retainable objectFariborz Jahanian2011-11-081-3/+2
| | | | | | type is strong by default too. // rdar://10410903 llvm-svn: 144118
* Mark the overloaded atomic builtins as having custom type checking,Douglas Gregor2011-11-081-8/+0
| | | | | | | | | which they do. This avoids all of the default argument promotions that we (1) don't want, and (2) undo during that custom type checking, and makes sure that we don't run into trouble during template instantiation. Fixes PR11320. llvm-svn: 144110
* Check pointer types for arguments of Neon load/store macros. rdar://9958031Bob Wilson2011-11-081-3/+54
| | | | | | | | | | | The Neon load/store intrinsics need to be implemented as macros to avoid hiding alignment attributes on the pointer arguments, and the macros can only evaluate those pointer arguments once (in case they have side effects), so it has been hard to get the right type checking for those pointers. I tried various alternatives in the arm_neon.h header, but it's much more straightforward to just check directly in Sema. llvm-svn: 144075
* Revert r143972, which didn't actually compile under -Wnon-virtual-dtor.Matt Beaumont-Gay2011-11-081-3/+2
| | | | | | (TIL: -Wnon-virtual-dtor is not in -Wall.) llvm-svn: 144058
* Clean up type flags for overloaded Neon builtins. No functional change.Bob Wilson2011-11-081-23/+21
| | | | | | | | | This patch just adds a simple NeonTypeFlags class to replace the various hardcoded constants that had been used until now. Unfortunately I couldn't figure out a good way to avoid duplicating that class between clang and TableGen, but since it's small and rarely changes, that's not so bad. llvm-svn: 144054
* There are some crazy cases that LookupMethodInReceiverTypeJohn McCall2011-11-071-1/+8
| | | | | | | | | doesn't duplicate, but they all surface as implicit properties. It's also a useful optimization to not duplicate the implicit getter lookup. So, trust the getter lookup that was already done in these cases. llvm-svn: 144031
* constexpr: static data members declared constexpr are required to have anRichard Smith2011-11-072-36/+17
| | | | | | | | initializer; all other constexpr variables are merely required to be initialized. In particular, a user-provided constexpr default constructor can be used for such initialization. llvm-svn: 144028
* When we notice that a member function is defined with "= delete" or "=Douglas Gregor2011-11-072-6/+22
| | | | | | | | | | | | default", make a note of which is used when creating the initial declaration. Previously, we would wait until later to handle default/delete as a definition, but this is too late: when adding the declaration, we already treated the declaration as "user-provided" when in fact it was merely "user-declared". Fixes PR10861 and PR10442, along with a bunch of FIXMEs. llvm-svn: 144011
* When applying ARC __weak to a non-objc pointer, do not give error thatArgyrios Kyrtzidis2011-11-071-1/+1
| | | | | | | | | __weak is unsupported by the deployment target, since it is going to be ignored anyway. Makes it easier for incremental migration from GC. llvm-svn: 143975
* Better fix for -Wnon-virtual-dtorMatt Beaumont-Gay2011-11-071-2/+3
| | | | llvm-svn: 143972
* Drastically simplify the mapping from the declaration corresponding toDouglas Gregor2011-11-071-66/+40
| | | | | | | | | | | | | | | | | | | | | | | | the injected-class-name of a class (or class template) to the declaration that results from substituting the given template arguments. Previously, we would actually perform a substitution into the injected-class-name type and then retrieve the resulting declaration. However, in certain, rare circumstances involving deeply-nested member templates, we would get the wrong substitution arguments. This new approach just matches up the declaration with a declaration that's part of the current context (or one of its parents), which will either be an instantiation (during template instantiation) or the declaration itself (during the definition of the template). This is both more efficient (we're avoiding a substitution) and more correct (we can't get the template arguments wrong in the member-template case). Fixes <rdar://problem/9676205>. Reinstated, now that we have the fix in r143967. llvm-svn: 143968
* Appease -Wnon-virtual-dtorMatt Beaumont-Gay2011-11-071-0/+2
| | | | llvm-svn: 143965
* Rip out CK_GetObjCProperty.John McCall2011-11-073-22/+0
| | | | llvm-svn: 143910
* Make sure when setting AttributesAsWritten of a property that they do notArgyrios Kyrtzidis2011-11-061-4/+9
| | | | | | include ownership qualifiers from the type. llvm-svn: 143885
* Unbreak gcc build.Benjamin Kramer2011-11-061-1/+1
| | | | | | For some reason clang and msvc accept this, but gcc doesn't. llvm-svn: 143872
* Change the AST representation of operations on Objective-CJohn McCall2011-11-066-238/+729
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* In ARC, when applying an ownership to a non-objc pointer, instead of ignoring itArgyrios Kyrtzidis2011-11-041-3/+31
| | | | | | | | | create an attributed type with same type as the original type. We effectively retain the source info that an ownership attribute was present but the attribute is ignored by not modifying the type that it was applied to. llvm-svn: 143736
* Revert r143551. It is causing g++.dg/template/crash52.C test failure.Devang Patel2011-11-041-40/+66
| | | | llvm-svn: 143725
* objc: fixed enum type is supported in objc mode.Fariborz Jahanian2011-11-041-0/+1
| | | | | | | Fixes a bug where enumerator type is not this fixed type. // rdar://10381507 llvm-svn: 143724
* In C++ keep unavailable function calls in the AST, like in C/ObjC.Argyrios Kyrtzidis2011-11-041-0/+7
| | | | | | This allows the migrator to visit and fix them. llvm-svn: 143699
* Extend IsSimplyAccessible to check for Objective-C instance variableDouglas Gregor2011-11-031-1/+41
| | | | | | accessibility. Fixes <rdar://problem/3727335>. llvm-svn: 143635
* Class can't be null in this contextDouglas Gregor2011-11-031-1/+1
| | | | llvm-svn: 143618
* Refactor Sema::IsSimplyAccessible slightly, to work on a DeclContext rather ↵Douglas Gregor2011-11-032-16/+19
| | | | | | than a class llvm-svn: 143615
* When we're checking a friend function template in an out-of-line classDouglas Gregor2011-11-032-1/+13
| | | | | | | | | | definition, we may not have a scope corresponding to the namespace where that friend function template actually lives. Work around this issue by faking up a scope with the appropriate DeclContext. This is a bit of a hack, but it fixes <rdar://problem/10204947>. llvm-svn: 143614
* Add a printing policy flag to suppress printing "<anonymous>::" priorDouglas Gregor2011-11-031-0/+1
| | | | | | | | | to types. Enable this flag for code completion, where knowing whether something is in an anonymous or inline namespace is actually not useful, since you don't have to type it anyway. Fixes <rdar://problem/10208818>. llvm-svn: 143599
* Don't build member initializers for zero-length or incomplete arrays,Douglas Gregor2011-11-021-8/+27
| | | | | | | and don't try to destroy them, either. Fixes <rdar://problem/10228639>. llvm-svn: 143584
* back out changes in r143399 and r143475.Fariborz Jahanian2011-11-021-3/+0
| | | | | | | rvale-references are captured by reference in blocks. // rdar://9971124. llvm-svn: 143583
* Fix various minor issues find via unreachable code warnings, fromDouglas Gregor2011-11-021-4/+0
| | | | | | Ahmed Charles! llvm-svn: 143569
* Drastically simplify the mapping from the declaration corresponding toDouglas Gregor2011-11-021-66/+40
| | | | | | | | | | | | | | | | | | | | | | the injected-class-name of a class (or class template) to the declaration that results from substituting the given template arguments. Previously, we would actually perform a substitution into the injected-class-name type and then retrieve the resulting declaration. However, in certain, rare circumstances involving deeply-nested member templates, we would get the wrong substitution arguments. This new approach just matches up the declaration with a declaration that's part of the current context (or one of its parents), which will either be an instantiation (during template instantiation) or the declaration itself (during the definition of the template). This is both more efficient (we're avoiding a substitution) and more correct (we can't get the template arguments wrong in the member-template case). Fixes <rdar://problem/9676205>. llvm-svn: 143551
* objc: warn if a readonly property has a setter attribute too.Fariborz Jahanian2011-11-011-0/+5
| | | | | | // rdar://10357768 llvm-svn: 143518
* When we run into a constructor or destructor that is defined in theDouglas Gregor2011-11-012-5/+15
| | | | | | | | wrong class, make sure to drop it immediately; we don't want that constructor to be available within the DeclContext. Fixes <rdar://problem/9677163>. llvm-svn: 143506
* When we see an out-of-line definition of a member class template thatDouglas Gregor2011-11-011-1/+3
| | | | | | | does not match any declaration in the class (or class template), be sure to mark it as invalid. Fixes PR10924 / <rdar://problem/10119422>. llvm-svn: 143504
* Find copy constructor needed to copy an rvalue referenceFariborz Jahanian2011-11-011-1/+4
| | | | | | c++ object into block descriptor. // rdar://9971124 llvm-svn: 143475
OpenPOWER on IntegriCloud