summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Warn if method for a deprecated method is implemented.Fariborz Jahanian2011-02-151-1/+40
| | | | | | | | | Warn if class for a deprecated class is implemented. Warn if category for a deprecated class is implemented. All under control of -Wdeprecated-implementations. // rdar://8973810. llvm-svn: 125545
* Don't crash on hierarchy static_casts which appear in variable initializers.John McCall2011-02-141-11/+29
| | | | | | PR9221. llvm-svn: 125532
* Change the context correctly when instantiating a static data member definition.John McCall2011-02-141-3/+3
| | | | llvm-svn: 125517
* Provide overload diagnostics when explicit casts involving class types fail.John McCall2011-02-141-15/+97
| | | | | | PR8626. llvm-svn: 125506
* When parsing an out-of-line member function declaration, we must delayJohn McCall2011-02-145-45/+69
| | | | | | | | | | | | | | | | | | | | | | access-control diagnostics which arise from the portion of the declarator following the scope specifier, just in case access is granted by friending the individual method. This can also happen with in-line member function declarations of class templates due to templated-scope friend declarations. We were really playing fast-and-loose before with this sort of thing, and it turned out to work because *most* friend functions are in file scope. Making us delay regardless of context exposed several bugs with how we were manipulating delay. I ended up needing a concept of a context that's independent of the declarations in which it appears, and then I actually had to make some things save contexts correctly, but delay should be much cleaner now. I also encapsulated all the delayed-diagnostics machinery in a single subobject of Sema; this is a pattern we might want to consider rolling out to other components of Sema. llvm-svn: 125485
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-142-0/+9
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actionsPeter Collingbourne2011-02-142-1/+15
| | | | llvm-svn: 125474
* Use hasSameType in one more, hopefully, last place.Fariborz Jahanian2011-02-131-2/+2
| | | | llvm-svn: 125468
* Some refactoring and using more modern APIs forFariborz Jahanian2011-02-131-57/+56
| | | | | | | implementation of co/contra-variance objc++ block pointers. // rdar://8979379. llvm-svn: 125467
* Give some convenient idiomatic accessors to Stmt::child_range andJohn McCall2011-02-133-10/+5
| | | | | | | Stmt::const_child_range, then make a bunch of places use them instead of the individual iterator accessors. llvm-svn: 125450
* Implement objective-c++'s block pointer type matching involvingFariborz Jahanian2011-02-122-1/+94
| | | | | | | types which are contravariance in argument types and covariance in return types. // rdar://8979379. llvm-svn: 125445
* Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!Peter Collingbourne2011-02-112-3/+21
| | | | llvm-svn: 125399
* Fix think-o I committed without testing, shameful.Daniel Dunbar2011-02-101-1/+1
| | | | llvm-svn: 125299
* Fix a gcc Wuninitialized false positive.Daniel Dunbar2011-02-101-1/+1
| | | | llvm-svn: 125298
* For -Woverloaded-virtual take into account canonical methods. Fixes ↵Argyrios Kyrtzidis2011-02-101-2/+3
| | | | | | rdar://8979966 & http://llvm.org/PR9182. llvm-svn: 125296
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-101-2/+0
| | | | llvm-svn: 125275
* Fix scoping of method declarations and issue Fariborz Jahanian2011-02-091-3/+20
| | | | | | | warning when same parameter name used multiple times. // rdar://8877730 llvm-svn: 125229
* AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actionsPeter Collingbourne2011-02-093-18/+88
| | | | llvm-svn: 125217
* AST, Sema, Serialization: keep track of cudaConfigureCallPeter Collingbourne2011-02-091-0/+13
| | | | llvm-svn: 125216
* Remove vtables from the Stmt hierarchy; this was pretty easy asJohn McCall2011-02-091-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | there were only three virtual methods of any significance. The primary way to grab child iterators now is with Stmt::child_range children(); Stmt::const_child_range children() const; where a child_range is just a std::pair of iterators suitable for being llvm::tie'd to some locals. I've left the old child_begin() and child_end() accessors in place, but it's probably a substantial penalty to grab the iterators individually now, since the switch-based dispatch is kindof inherently slower than vtable dispatch. Grabbing them together is probably a slight win over the status quo, although of course we could've achieved that with vtables, too. I also reclassified SwitchCase (correctly) as an abstract Stmt class, which (as the first such class that wasn't an Expr subclass) required some fiddling in a few places. There are somewhat gross metaprogramming hooks in place to ensure that new statements/expressions continue to implement getSourceRange() and children(). I had to work around a recent clang bug; dgregor actually fixed it already, but I didn't want to introduce a selfhosting dependency on ToT. llvm-svn: 125183
* NonTypeTemplateParmDecl is just a DeclaratorDecl, not a VarDecl.John McCall2011-02-091-62/+126
| | | | | | | Also, reorganize and make very explicit the logic for determining the value kind and type of a referenced declaration. llvm-svn: 125150
* When checking the 'weak' and 'weakref' attributes, look for non-externalJohn McCall2011-02-081-21/+40
| | | | | | | linkage rather than the presence of the 'static' storage class specifier. Fixes rdar://problem/8814626. llvm-svn: 125126
* In Sema::CheckShadow, get the DeclContext from the variable that we are checkingArgyrios Kyrtzidis2011-02-081-4/+3
| | | | | | | | instead from the Scope; Inner scopes in bodies don't have DeclContexts associated with them. Fixes http://llvm.org/PR9160 & rdar://problem/8966163. llvm-svn: 125097
* Support for objextive-c++ use of property-dot syntax as receiverFariborz Jahanian2011-02-082-6/+8
| | | | | | | in liu of a class method getter. // rdar://8962253 llvm-svn: 125094
* Sema::MaybeBindToTemporary() shouldn't treat any expression returningDouglas Gregor2011-02-081-11/+3
| | | | | | | | | a glvalue as a temporary. Previously, we were enumerating all of the cases that coul return glvalues and might be called with Sema::MaybeBindToTemporary(), but that was gross and we missed the Objective-C property reference case. llvm-svn: 125070
* dgregor accidentally killed this assert, but on investigation, it can fireJohn McCall2011-02-081-18/+10
| | | | | | on invalid code and we don't really care, so kill it harder. llvm-svn: 125068
* Support for objc use of property-dot syntax as receiverFariborz Jahanian2011-02-081-0/+4
| | | | | | | in liu of a class method getter. objc++ uses a different code path and is more involved (TBD). llvm-svn: 125061
* A few more tweaks to the blocks AST representation: John McCall2011-02-073-78/+149
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)Anton Yartsev2011-02-071-0/+2
| | | | llvm-svn: 125000
* Improve our uniquing of file entries when files are re-saved or areDouglas Gregor2011-02-051-2/+0
| | | | | | | | | | | | | | overridden via remapping. Thus, when we create a "virtual" file in the file manager, we still stat() the real file that lives behind it so that we can provide proper uniquing based on inodes. This helps keep the file manager much more consistent. To take advantage of this when reparsing files in libclang, we disable the use of the stat() cache when reparsing or performing code completion, since the stat() cache is very likely to be out of date in this use case. llvm-svn: 124971
* Basic implementation of inherited constructors. Only generates declarations, ↵Sebastian Redl2011-02-052-5/+260
| | | | | | and probably only works for very basic use cases. llvm-svn: 124970
* When the out-of-line definition differs from the declaration in the return type,Argyrios Kyrtzidis2011-02-051-1/+5
| | | | | | | | | say "out-of-line definition differ from the declaration in the return type" instead of the silly "functions that differ only in their return type cannot be overloaded". Addresses rdar://7980179. llvm-svn: 124939
* Re-land r124768, with a fix for PR9130.Anders Carlsson2011-02-051-7/+0
| | | | | | We now emit everything except unused implicit virtual member functions when building the vtable. llvm-svn: 124935
* Don't suggest -Wuninitialized fixits for uninitialized enum types.Ted Kremenek2011-02-051-1/+3
| | | | llvm-svn: 124924
* -Wselector should warn on implemented selectors onlyFariborz Jahanian2011-02-041-1/+5
| | | | | | | | when selector metadata is generated, which is triggered by at least on class implementation. This is to match gcc's behavior. // rdar://8851684. llvm-svn: 124909
* Assert during instantiation of blocks that we've captured everything thatJohn McCall2011-02-041-39/+61
| | | | | | we captured in the dependent case. llvm-svn: 124887
* Improve our handling of the current instantiation for qualifiedDouglas Gregor2011-02-041-25/+11
| | | | | | | | | | | | | | id-expression, e.g., CurrentClass<T>::member Previously, if CurrentClass<T> was dependent and not complete, we would treat it as a dependent-scoped declaration reference expression, even if CurrentClass<T> referred to the current instantiation. Fixes PR8966 and improves type checking of templates. llvm-svn: 124867
* Before checking bitfield initialization, make sure that neither theDouglas Gregor2011-02-041-0/+7
| | | | | | | bit-field width nor the initializer value are type- or value-dependent. Fixes PR8712. llvm-svn: 124866
* When calling a bound pointer to member function, check theDouglas Gregor2011-02-041-0/+20
| | | | | | | cv-qualifiers on the object against the cv-qualifiers on the member function. Fixes PR8315. llvm-svn: 124865
* Tweak my fix for PR8748, and update the incorrect PR number in the test case.Douglas Gregor2011-02-042-2/+4
| | | | llvm-svn: 124863
* Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to ↵Ted Kremenek2011-02-041-3/+3
| | | | | | anything but a instance method to a warning. llvm-svn: 124858
* Tighten up the semantics of default template arguments, per C++0xDouglas Gregor2011-02-042-4/+17
| | | | | | [temp.param]p9 and C++ DR226. Fixes PR8747. llvm-svn: 124856
* When a function template's template parameter has a default argument,Douglas Gregor2011-02-041-2/+2
| | | | | | | | | | it's okay for the following template parameters to not have default arguments (since those template parameters can still be deduced). Also, downgrade the error about default template arguments in function templates to an extension warning, since this is a harmless C++0x extension. llvm-svn: 124855
* Implement -Woverloaded-virtual.Argyrios Kyrtzidis2011-02-032-1/+103
| | | | | | | | | | | | The difference with gcc is that it warns if you overload virtual methods only if the method doesn't also override any method. This is to cut down on the number of warnings and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423. If we want to warn that not all overloads are overriden we can have an additional warning like -Wpartial-override. -Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630. llvm-svn: 124805
* Capture a few implicit references to 'self'.John McCall2011-02-031-3/+37
| | | | llvm-svn: 124786
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-032-120/+152
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* Revert 124768.Rafael Espindola2011-02-031-0/+7
| | | | | | | This reopens PR99114, but that one at least can be avoided with an #include. PR9130 cannot. llvm-svn: 124780
* Don't try to mark virtual members referenced for classes where the key functionAnders Carlsson2011-02-031-7/+0
| | | | | | | | | | | is not defined in the current translation unit. Doing so lead to compile errors such as PR9114. Instead, when CodeGen is building the vtable, don't try to emit a definition for functions that aren't marked used in the current translation unit. Fixes PR9114. llvm-svn: 124768
* Based on user feedback, swap -Wuninitialized diagnostics to have the warning ↵Ted Kremenek2011-02-021-32/+37
| | | | | | refer to the bad use, and the note to the variable declaration. llvm-svn: 124758
* Revert r124704, which uniqued code-completion strings. The spaceDouglas Gregor2011-02-021-31/+0
| | | | | | | | | savings of 25% sounds impressive, except that this amounted to only about 360k in our standard "large" completion result set (40,000 results). Since code completion is performance-sensitive, the 4% slowdown due to uniquing outweighs the 360k benefit. llvm-svn: 124737
OpenPOWER on IntegriCloud