summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaNamedCast.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename file in preparation of properly implementing C-style casts in C++.Sebastian Redl2009-07-181-932/+0
| | | | llvm-svn: 76318
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-18/+18
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-171-10/+10
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* Replace Type::getAsReferenceType() with Type::getAs<ReferenceType>().Ted Kremenek2009-07-171-2/+2
| | | | llvm-svn: 76132
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-6/+6
| | | | | | | | | | | | | | | | | | | | | This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
* Reflow some comments.Mike Stump2009-05-161-3/+3
| | | | llvm-svn: 71936
* Implement C++0x nullptr.Sebastian Redl2009-05-101-3/+17
| | | | llvm-svn: 71405
* Replace more release+static_cast with takeAs.Anders Carlsson2009-05-011-1/+1
| | | | llvm-svn: 70567
* Fix a few isObjectTypes that really need to be isIncompleteOrObjectDouglas Gregor2009-03-241-1/+1
| | | | | | types; add another use of RequireCompleteType. llvm-svn: 67644
* Implement static_cast from lvalue to rvalue reference.Sebastian Redl2009-03-221-0/+39
| | | | llvm-svn: 67487
* Almost complete implementation of rvalue references. One bug, and a few ↵Sebastian Redl2009-03-161-7/+25
| | | | | | unclear areas. Maybe Doug can shed some light on some of the fixmes. llvm-svn: 67059
* Convert a bunch of actions to smart pointers, and also bring ↵Sebastian Redl2009-03-151-12/+13
| | | | | | PrintParserCallbacks a bit more in line with reality. llvm-svn: 67029
* Rename DiagnoseIncompleteType to RequireCompleteType, and update the ↵Douglas Gregor2009-03-091-2/+2
| | | | | | documentation to reflect the fact that we can instantiate templates here llvm-svn: 66421
* Eliminate CXXRecordTypeDouglas Gregor2009-02-281-1/+1
| | | | llvm-svn: 65671
* Overhaul of Stmt allocation:Ted Kremenek2009-02-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Made allocation of Stmt objects using vanilla new/delete a *compiler error* by making this new/delete "protected" within class Stmt. - Now the only way to allocate Stmt objects is by using the new operator that takes ASTContext& as an argument. This ensures that all Stmt nodes are allocated from the same (pool) allocator. - Naturally, these two changes required that *all* creation sites for AST nodes use new (ASTContext&). This is a large patch, but the majority of the changes are just this mechanical adjustment. - The above changes also mean that AST nodes can no longer be deallocated using 'delete'. Instead, one most do StmtObject->Destroy(ASTContext&) or do ASTContextObject.Deallocate(StmtObject) (the latter not running the 'Destroy' method). Along the way I also... - Made CompoundStmt allocate its array of Stmt* using the allocator in ASTContext (previously it used std::vector). There are a whole bunch of other Stmt classes that need to be similarly changed to ensure that all memory allocated for ASTs comes from the allocator in ASTContext. - Added a new smart pointer ExprOwningPtr to Sema.h. This replaces the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used 'delete' to free memory instead of a Stmt's 'Destroy' method. Big thanks to Doug Gregor for helping with the acrobatics of making 'new/delete' private and the new smart pointer ExprOwningPtr! llvm-svn: 63997
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+0
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Implement pointer to member handling in static_cast.Sebastian Redl2009-01-281-2/+65
| | | | | | | Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same. Make a few style corrections as suggested by Chris. llvm-svn: 63215
* Add handling of member pointers to reinterpret_cast.Sebastian Redl2009-01-271-15/+40
| | | | llvm-svn: 63150
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Add support for member pointers to const_cast.Sebastian Redl2009-01-261-2/+6
| | | | llvm-svn: 63055
* Centralize error reporting of improper uses of incomplete types in theDouglas Gregor2009-01-191-8/+6
| | | | | | | | | | new DiagnoseIncompleteType. It provides additional information about struct/class/union/enum types when possible, either by pointing to the forward declaration of that type or by pointing to the definition (if we're in the process of defining that type). Fixes <rdar://problem/6500531>. llvm-svn: 62521
* Delay semantic analysis of the C++ names casts when the subexpression is ↵Douglas Gregor2008-12-171-4/+12
| | | | | | type-dependent or the destination type is dependent. llvm-svn: 61165
* Change a whole lot of diagnostics to take QualType's directly Chris Lattner2008-11-241-40/+25
| | | | | | | | instead of converting them to strings first. This also fixes a bunch of minor inconsistencies in the diagnostics emitted by clang and adds a bunch of FIXME's to DiagnosticKinds.def. llvm-svn: 59948
* remove another old-school Diag method.Chris Lattner2008-11-201-5/+6
| | | | llvm-svn: 59712
* start converting Sema over to using its canonical Diag method.Chris Lattner2008-11-181-58/+63
| | | | llvm-svn: 59561
* Move named cast helpers out of Sema, as Chris requested. This requirse ↵Sebastian Redl2008-11-081-103/+146
| | | | | | making a few functions public that weren't before. llvm-svn: 58906
* Greatly improve static_cast diagnosticsSebastian Redl2008-11-071-62/+109
| | | | llvm-svn: 58873
* Sema-check virtual declarations. Complete dynamic_cast checking.Sebastian Redl2008-11-061-1/+6
| | | | llvm-svn: 58804
* Improve assert messages.Sebastian Redl2008-11-051-2/+2
| | | | llvm-svn: 58770
* Move named cast sema functions to their own file.Sebastian Redl2008-11-051-0/+677
llvm-svn: 58769
OpenPOWER on IntegriCloud