summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rework base and member initialization in constructors, with severalDouglas Gregor2010-01-311-21/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (necessarily simultaneous) changes: - CXXBaseOrMemberInitializer now contains only a single initializer rather than a set of initialiation arguments + a constructor. The single initializer covers all aspects of initialization, including constructor calls as necessary but also cleanup of temporaries created by the initializer (which we never handled before!). - Rework + simplify code generation for CXXBaseOrMemberInitializers, since we can now just emit the initializer as an initializer. - Switched base and member initialization over to the new initialization code (InitializationSequence), so that it - Improved diagnostics for the new initialization code when initializing bases and members, to match the diagnostics produced by the previous (special-purpose) code. - Simplify the representation of type-checked constructor initializers in templates; instead of keeping the fully-type-checked AST, which is rather hard to undo at template instantiation time, throw away the type-checked AST and store the raw expressions in the AST. This simplifies instantiation, but loses a little but of information in the AST. - When type-checking implicit base or member initializers within a dependent context, don't add the generated initializers into the AST, because they'll look like they were explicit. - Record in CXXConstructExpr when the constructor call is to initialize a base class, so that CodeGen does not have to infer it from context. This ensures that we call the right kind of constructor. There are also a few "opportunity" fixes here that were needed to not regress, for example: - Diagnose default-initialization of a const-qualified class that does not have a user-declared default constructor. We had this diagnostic specifically for bases and members, but missed it for variables. That's fixed now. - When defining the implicit constructors, destructor, and copy-assignment operator, set the CurContext to that constructor when we're defining the body. llvm-svn: 94952
* Rename dump to dumpDeclContext, so that call RD->dump() won't dump the decl ↵Anders Carlsson2009-12-141-1/+1
| | | | | | context by default. llvm-svn: 91256
* Add DeclContext::dump.Anders Carlsson2009-12-091-0/+11
| | | | llvm-svn: 90974
* Implement template instantiation for exception specifications. Also,Douglas Gregor2009-12-081-0/+18
| | | | | | | | | | | | | | print exception specifications on function types and declarations. Fixes <rdar://problem/7450999>. There is some poor source-location information here, because we don't track locations of the types in exception specifications. Filed PR5719. Failures during template instantiation of the signature of a function or function template have wrong point-of-instantiation location information. I'll tackle that with a separate commit. llvm-svn: 90863
* r90313, in which OverloadedFunctionDecl is removed and never spoken of again.John McCall2009-12-021-6/+0
| | | | llvm-svn: 90313
* Remove VISIBILITY_HIDDEN from lib/AST.Benjamin Kramer2009-11-281-3/+1
| | | | llvm-svn: 90043
* Let using directives refer to namespace aliases. Fixes PR5479.Sebastian Redl2009-11-231-1/+1
| | | | llvm-svn: 89657
* DeclPrinter: Indent access specifiers.Daniel Dunbar2009-11-211-3/+6
| | | | llvm-svn: 89552
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-3/+11
| | | | | | | | | | two classes, one for typenames and one for values; this seems to have some support from Doug if not necessarily from the extremely-vague-on-this-point standard. Track the location of the 'typename' keyword in a using-typename decl. Make a new lookup result for unresolved values and deal with it in most places. llvm-svn: 89184
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-1/+1
| | | | | | @class. llvm-svn: 89170
* Instead of hanging a using declaration's target decls directly off the using John McCall2009-11-171-1/+6
| | | | | | | decl, create shadow declarations and put them in scope like normal. Work in progress. llvm-svn: 89048
* Unify the way destructor epilogues are generated for synthesized and regular ↵Anders Carlsson2009-11-171-31/+0
| | | | | | destructors. Also fix PR5529. llvm-svn: 89034
* Rename FunctionDecl::isInline/setInline toDouglas Gregor2009-10-271-1/+1
| | | | | | FunctionDecl::isInlineSpecified/setInlineSpecified. llvm-svn: 85305
* Remove OriginalTypeParmDecl; the original type is the one specifiedJohn McCall2009-10-231-6/+1
| | | | | | | | | | | | | in the DeclaratorInfo, if one is present. Preserve source information through template instantiation. This is made more complicated by the possibility that ParmVarDecls don't have DIs, which is possibly worth fixing in the future. Also preserve source information for function parameters in ObjC method declarations. llvm-svn: 84971
* Make Decl::dump const.Anders Carlsson2009-09-261-4/+4
| | | | llvm-svn: 82878
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-3/+3
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-63/+62
| | | | llvm-svn: 81346
* Ensure that the tag decls of friend decls aren't added to the friending class'sJohn McCall2009-09-021-3/+1
| | | | | | | decl list, and remove some workarounds that were due to this. Thanks to Eli for pointing this out and providing the test case. llvm-svn: 80745
* Add a workaround for decls that come from friend decls pointing to ↵Anders Carlsson2009-08-291-1/+4
| | | | | | undeclared classes. llvm-svn: 80438
* In DeclPrinter, assert when asked to print AS_None.Anders Carlsson2009-08-291-4/+4
| | | | llvm-svn: 80437
* Add printing of access specifiers to DeclPrinter. The formatting is pretty ↵Anders Carlsson2009-08-281-8/+25
| | | | | | bad but it works :) llvm-svn: 80402
* Improve support for using decls in the decl printer.Anders Carlsson2009-08-281-0/+16
| | | | llvm-svn: 80386
* Replace cerr with errs().Benjamin Kramer2009-08-231-1/+0
| | | | llvm-svn: 79854
* Change uses of:Ted Kremenek2009-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Add builtin knowledge about longjmp being noreturn. Add printing forMike Stump2009-07-271-0/+2
| | | | | | the noreturn attribute. llvm-svn: 77253
* More work toward initialization of objectsFariborz Jahanian2009-07-241-6/+7
| | | | | | in constructors. llvm-svn: 76980
* Patch to accomodate Doug's comment on defaultFariborz Jahanian2009-07-211-9/+10
| | | | | | destruction of base/members for each destructor AST. llvm-svn: 76663
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-3/+3
| | | | | | | | | 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-2/+2
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Fixed a stinko which caused an ast-print test failure.Fariborz Jahanian2009-07-151-2/+0
| | | | llvm-svn: 75861
* #ifdef'ed out -ast-print of destructors which causedFariborz Jahanian2009-07-151-0/+2
| | | | | | a test failure, until figuring out what caused the failure. llvm-svn: 75855
* Added ASTs to destructor decl AST for default destruction of object'sFariborz Jahanian2009-07-151-0/+30
| | | | | | base/members. llvm-svn: 75849
* Added a FIXME and prevent crash when listingFariborz Jahanian2009-07-141-5/+6
| | | | | | a dependent type in the ctor initializer-list. llvm-svn: 75712
* Fixes a minor bug in pretty printing of ctor defs.Fariborz Jahanian2009-07-131-3/+2
| | | | llvm-svn: 75549
* Added pretty-printing support for constructor definition.Fariborz Jahanian2009-07-131-1/+41
| | | | llvm-svn: 75487
* Look through vector types when determining the base type of a type for ↵Douglas Gregor2009-07-011-0/+2
| | | | | | declarator printing. Bug found via the PCH tester llvm-svn: 74672
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-3/+2
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-301-1/+1
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Remove the ASTContext parameter from the printing related methods of Decl.Argyrios Kyrtzidis2009-06-301-15/+12
| | | | llvm-svn: 74503
* Keep track of whether a type parameter is actually a type parameter pack.Anders Carlsson2009-06-121-0/+3
| | | | llvm-svn: 73261
* Minor improvements to template parameter writing.Anders Carlsson2009-06-041-2/+44
| | | | llvm-svn: 72848
* Add a little FIXME for C++ class printingDouglas Gregor2009-05-311-0/+1
| | | | llvm-svn: 72660
* AST printing for C++ base classesDouglas Gregor2009-05-301-8/+46
| | | | llvm-svn: 72617
* Pretty printing and improved representation for namespace alias declarationsDouglas Gregor2009-05-301-0/+8
| | | | llvm-svn: 72616
* Add a hack to prevent us from printing out the __builtin_va_list Eli Friedman2009-05-301-0/+5
| | | | | | declaration in -ast-print mode. llvm-svn: 72615
* Printing for using directives, e.g.,Douglas Gregor2009-05-301-1/+20
| | | | | | | | | using namespace std::debug; Extended UsingDirectiveDecl to store the nested-name-specifier that precedes the nominated namespace. llvm-svn: 72614
* Never suppress specifiers when printing the parameters of a functionDouglas Gregor2009-05-301-3/+6
| | | | | | declaration. llvm-svn: 72613
* Add a Stmt::printPretty overload which takes an ASTContext; start Eli Friedman2009-05-301-6/+11
| | | | | | transitioning callers over to pass one in. llvm-svn: 72609
* Expose an API to print a group of decls (like "int a,b;"). Eli Friedman2009-05-301-14/+129
| | | | | | | | | | | | | | | | | Make StmtPrinter use DeclPrinter to print all declarations. Merge declarations in the limited case of an unnamed TagDecl followed by one or more declarations using that TagDecl directly. Change SuppressTypeSpecifiers to the more general SuppressSpecifiers, and use it to suppress stuff like "typedef" and "extern". Replace OwnedTag with SuppressTag, since it's more convenient to print declarations from DeclPrinter at the moment. improvements to declaration printing. Fix pretty-printing for K&R function definitions and __builtin_va_arg. We're now to the point where the pretty-printing output for non-trivial programs can actually be piped back into clang. llvm-svn: 72608
OpenPOWER on IntegriCloud