summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-141-29/+27
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* Add returns_twice to functions that are known to return twice. This implementsRafael Espindola2011-10-121-0/+4
| | | | | | the same behavior of gcc by keeping the attribute out of the function type. llvm-svn: 141803
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-4/+4
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* When 'bool' is not a built-in type but is defined as a macro, printDouglas Gregor2011-09-271-2/+2
| | | | | | | 'bool' rather than '_Bool' within types, to make things a bit more readable. Fixes <rdar://problem/10063263>. llvm-svn: 140650
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-2/+2
| | | | llvm-svn: 140367
* OpenCL: introduce support for function scope __local variablesPeter Collingbourne2011-09-191-1/+2
| | | | llvm-svn: 140068
* Modules: introduce the __module_private__ declaration specifier, whichDouglas Gregor2011-09-091-2/+17
| | | | | | | indicates that a declaration is only visible within the module it is declared in. llvm-svn: 139348
* objective-c: Treat top-level objective-c declarationsFariborz Jahanian2011-08-271-5/+1
| | | | | | | | | | , such as list of forward @class decls, in a DeclGroup node. Deal with its consequence throught clang. This is in preparation for more Sema work ahead. // rdar://8843851. Feel free to reverse if it breaks something important and I am unavailable. llvm-svn: 138709
* Fix incorrect code indentation and silence dead store warning due to ↵Ted Kremenek2011-08-171-43/+45
| | | | | | idiomatic code. llvm-svn: 137870
* Add template instantiations to the output of -ast-dump.Richard Trieu2011-07-281-10/+59
| | | | llvm-svn: 136306
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-11/+11
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Automatic Reference Counting.John McCall2011-06-151-0/+5
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Added 'atomic' for objc properties.Fariborz Jahanian2011-06-111-0/+5
| | | | llvm-svn: 132879
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-52/+63
| | | | llvm-svn: 132878
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-061-3/+3
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* Remove dead variable caught by GCC.Nick Lewycky2011-05-021-3/+0
| | | | llvm-svn: 130676
* Re-applies the patch first applied way back in r106099, withChandler Carruth2011-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | accompanying fixes to make it work today. The core of this patch is to provide a link from a TemplateTypeParmType back to the TemplateTypeParmDecl node which declared it. This in turn provides much more precise information about the type, where it came from, and how it functions for AST consumers. To make the patch work almost a year after its first attempt, it needed serialization support, and it now retains the old getName() interface. Finally, it requires us to not attempt to instantiate the type in an unsupported friend decl -- specifically those coming from template friend decls but which refer to a specific type through a dependent name. A cleaner representation of the last item would be to build FriendTemplateDecl nodes for these, storing their template parameters etc, and to perform proper instantation of them like any other template declaration. They can still be flagged as unsupported for the purpose of access checking, etc. This passed an asserts-enabled bootstrap for me, and the reduced test case mentioned in the original review thread no longer causes issues, likely fixed at somewhere amidst the 24k revisions that have elapsed. llvm-svn: 130628
* When printing a base-specifier, print the ellipsis ("...") if it is aDouglas Gregor2011-04-271-0/+3
| | | | | | pack expansion. Fixes PR9452. llvm-svn: 130310
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-1/+7
| | | | llvm-svn: 129567
* Teach -ast-print how to print template template parameters.Richard Smith2011-04-151-3/+8
| | | | llvm-svn: 129565
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-141-1/+2
| | | | | | draft standard (N3291). llvm-svn: 129541
* Support for printing/dumping static assertsPeter Collingbourne2011-03-161-0/+9
| | | | llvm-svn: 127744
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-5/+15
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Update UsingDecl, UnresolvedUsingTypenameDecl, andDouglas Gregor2011-02-251-3/+3
| | | | | | | | | | | | | | UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the extremely-lossy NestedNameSpecifier/SourceRange pair it used to use, improving source-location information. Various infrastructure updates to support NestedNameSpecifierLoc: - AST/PCH (de-)serialization - Recursive AST visitor - libclang traversal (including the first tests of this functionality) llvm-svn: 126459
* Step #2/N of __label__ support: keep pushing LabelDecl forward,Chris Lattner2011-02-171-0/+6
| | | | | | | | | | making them be template instantiated in a more normal way and make them handle attributes like other decls. This fixes the used/unused label handling stuff, making it use the same infrastructure as other decls. llvm-svn: 125771
* 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
OpenPOWER on IntegriCloud