summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-1/+1
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt2011-01-081-2/+2
| | | | | | | more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
* Implement support for template template parameter packs, e.g.,Douglas Gregor2011-01-051-2/+5
| | | | | | | template<template<class> class ...Metafunctions> struct apply_to_each; llvm-svn: 122874
* When instantiating a non-type template parameter pack, be sure toDouglas Gregor2010-12-241-0/+3
| | | | | | | | extract the appropriate argument from the argument pack (based on the current substitution index, of course). Simple instantiation of pack expansions involving non-type template parameter packs now works. llvm-svn: 122532
* Added missing IgnoreParens().Abramo Bagnara2010-12-141-3/+9
| | | | llvm-svn: 121795
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-2/+1
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-041-2/+2
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-031-2/+6
| | | | llvm-svn: 120828
* AST printing for scoped enumerations and enumerations with a fixed ↵Douglas Gregor2010-12-011-3/+16
| | | | | | underlying type, from Daniel Wallin llvm-svn: 120576
* Make sure to print cvr-qualifiers on function declarationsDouglas Gregor2010-11-191-0/+10
| | | | llvm-svn: 119817
* Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim ↵Ted Kremenek2010-09-171-2/+5
| | | | | | Goodnow II. llvm-svn: 114235
* Fix DeclPrinter to not include '=' in printing when no initializer is ↵Ted Kremenek2010-09-071-3/+3
| | | | | | provided for a VarDecl. Patch by Jim Goodnow II! llvm-svn: 113296
* De-memberify the VarDecl and FunctionDecl StorageClass enums.John McCall2010-08-261-5/+6
| | | | | | This lets us remove Sema.h's dependency on Expr.h and Decl.h. llvm-svn: 112156
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-1/+1
| | | | llvm-svn: 110860
* Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor2010-08-111-10/+3
| | | | | | | | and create separate decl nodes for forward declarations and the definition," which appears to be causing significant Objective-C breakage. llvm-svn: 110803
* - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for ↵Sebastian Redl2010-08-091-3/+10
| | | | | | | | | | forward declarations and the definition. - Eagerly create ObjCInterfaceTypes for declarations. - The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another. - Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated. llvm-svn: 110610
* Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.Ted Kremenek2010-07-301-0/+6
| | | | llvm-svn: 109833
* Fix a crashing but trying to print a TemplateTemplateParmDeclCraig Silverstein2010-07-091-1/+5
| | | | | | | | | | | | | | | for code like this: template<template<typename T> class U> class V {}; The problem is that the DeclPrinter assumed all TemplateDecls have a getTemplatedClass(), but template template params don't (so we got a NULL dereference). The solution is to detect if we're a template template param, and construct the template class name ('class U') specially in this case. OKed by dgregor and chandlerc llvm-svn: 108007
* AST: Propogate printing policy to types in a bunch more places.Daniel Dunbar2010-06-301-1/+2
| | | | llvm-svn: 107311
* Don't ast-print the builtin __[u]int128_t.Argyrios Kyrtzidis2010-06-171-4/+9
| | | | llvm-svn: 106212
* Revert r106099; it broke self-host.Douglas Gregor2010-06-161-1/+1
| | | | llvm-svn: 106100
* Added TemplateTypeParmType::getDecl().Abramo Bagnara2010-06-161-1/+1
| | | | llvm-svn: 106099
* Added AccessSpecDecl node.Abramo Bagnara2010-06-051-16/+11
| | | | llvm-svn: 105525
* And finally, revert the accidental check-in part of the previous reversion. ↵Sebastian Redl2010-05-071-5/+1
| | | | | | I'm on a roll. llvm-svn: 103249
* Revert 103247, it causes lots of test failures.Sebastian Redl2010-05-071-1/+5
| | | | llvm-svn: 103248
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-171-40/+29
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* 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
OpenPOWER on IntegriCloud