summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* In DeclPrint add printing of '= default'Fariborz Jahanian2012-12-051-0/+2
| | | | | | in constructors. llvm-svn: 169440
* In DeclPrint add printing of 'explicit'Fariborz Jahanian2012-12-051-1/+4
| | | | | | constructors. llvm-svn: 169435
* Testing C++ declarations embedded inFariborz Jahanian2012-12-051-0/+2
| | | | | | | | | <declaration> tag of Comment XML. Added DeclPrint support for constructors and fix tests accordingly. This is wip. // rdar://12378714 llvm-svn: 169412
* Testing C++ declarations embedded inFariborz Jahanian2012-12-051-0/+25
| | | | | | | | <declaration> tag of Comment XML and added support for friend declaration printing. This is wip. // rdar://12378714 llvm-svn: 169346
* objective-c blocks: Consider padding due to alignmentFariborz Jahanian2012-12-041-0/+11
| | | | | | | after the fixed size block header when generating captured block variable info. // rdar://12773256 llvm-svn: 169285
* Testing objective-C declarations embedded inFariborz Jahanian2012-12-041-1/+11
| | | | | | | | <declaration> tag of Comment XML and fixed a missing declaration of ivars private to @implementation as result of the testing. // rdar://12378714 llvm-svn: 169193
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-011-1/+2
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* Pretty-print a ParenListExpr in a variable initializer correctly. Patch by ↵Eli Friedman2012-10-191-2/+2
| | | | | | Grzegorz Jablonski. llvm-svn: 166311
* [Doc parsing]: This patch adds <Declaration> tag to Fariborz Jahanian2012-10-171-1/+4
| | | | | | | | | | | XML comment for declarations which pretty-prints declaration. I had to XFAIL one test annotate-comments.cpp. This test is currently unmaintainable as written. Dmitri G., can you see what we can do about this test. We should change this test such that adding a new tag does not wreck havoc to the test. llvm-svn: 166130
* Teach GetBaseType() about BlockPointerTypes.Ted Kremenek2012-10-111-0/+2
| | | | llvm-svn: 165742
* Remove redundant semicolons which are null statements.Dmitri Gribenko2012-09-101-1/+1
| | | | llvm-svn: 163546
* DeclPrinter, terse mode: don't print function bodiesDmitri Gribenko2012-08-211-1/+1
| | | | llvm-svn: 162294
* Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutputDmitri Gribenko2012-08-211-1/+1
| | | | | | to reflect the intention, not the implementation. llvm-svn: 162293
* DeclPrinter: add terse output mode and lots of testsDmitri Gribenko2012-08-201-0/+3
| | | | | | | | | | | | | | Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output from DeclPrinter. The motivation is to use DeclPrinter to print declarations in user-friendly format, without overwhelming user with inner detail of the declaration being printed. Also add many tests for DeclPrinter. There are quite a few things that we print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests check our output against incorrect output, so that we can fix/refactor/rewrite the DeclPrinter later. llvm-svn: 162245
* Store SourceManager pointer on PrintingPolicy in the case where we're dumping,Richard Smith2012-08-161-26/+22
| | | | | | | | | and remove ASTContext reference (which was frequently bound to a dereferenced null pointer) from the recursive lump of printPretty functions. In so doing, fix (at least) one case where we intended to use the 'dump' mode, but that failed because a null ASTContext reference had been passed in. llvm-svn: 162011
* Don't constant-fold when pretty-printing alignment attribute. This fixes aRichard Smith2012-08-161-2/+2
| | | | | | potential crasher -- Context is sometimes a null reference (!!) here. llvm-svn: 162007
* Do NOT use inline functions with LLVM_ATTRIBUTE_USED.Benjamin Kramer2012-08-141-0/+4
| | | | | | The function will be emitted into every single TU including the header! llvm-svn: 161872
* Provide isConst/Volatile on CXXMethodDecl.David Blaikie2012-08-101-5/+4
| | | | | | | | | This also provides isConst/Volatile/Restrict on FunctionTypes to coalesce the implementation with other callers (& update those other callers). Patch contributed by Sam Panzer (panzer@google.com). llvm-svn: 161647
* Fix a -ast-dump crash.Eli Friedman2012-08-081-0/+2
| | | | llvm-svn: 161472
* Added -ast-dump-filter option to clang -cc1.Alexander Kornienko2012-07-261-2/+4
| | | | llvm-svn: 160784
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-101-1/+4
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-1/+1
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Use raw_ostream in TypePrinter and eliminate uses of temporary std::strings.Argyrios Kyrtzidis2012-05-051-20/+8
| | | | | | Part of rdar://10796159 llvm-svn: 156228
* Print inline for inline namespaces, from Faisal ValiDouglas Gregor2012-05-011-0/+2
| | | | llvm-svn: 155875
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-1/+1
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Change @import to @__experimental_modules_import. We are not ready to ↵Ted Kremenek2012-03-011-1/+1
| | | | | | | | commit to a particular syntax for modules, and don't have time to push it forward in the near future. llvm-svn: 151841
* Represent C++ direct initializers as ParenListExprs before semantic analysisSebastian Redl2012-02-111-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of having a special-purpose function. - ActOnCXXDirectInitializer, which was mostly duplication of AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days ago), is dropped completely. - MultiInitializer, which was an ugly hack I added, is dropped again. - We now have the infrastructure in place to distinguish between int x = {1}; int x({1}); int x{1}; -- VarDecl now has getInitStyle(), which indicates which of the above was used. -- CXXConstructExpr now has a flag to indicate that it represents list- initialization, although this is not yet used. - InstantiateInitializer was renamed to SubstInitializer and simplified. - ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which always produces a ParenListExpr. Placed that so far failed to convert that back to a ParenExpr containing comma operators have been fixed. I'm pretty sure I could have made a crashing test case before this. The end result is a (I hope) considerably cleaner design of initializers. More importantly, the fact that I can now distinguish between the various initialization kinds means that I can get the tricky generalized initializer test cases Johannes Schaub supplied to work. (This is not yet done.) This commit passed self-host, with the resulting compiler passing the tests. I hope it doesn't break more complicated code. It's a pretty big change, but one that I feel is necessary. llvm-svn: 150318
* Print NamedDecls directly to a raw_ostream where possible.Benjamin Kramer2012-02-071-4/+3
| | | | llvm-svn: 149982
* Introduce a non-uglified syntax for module imports in Objective-C:Douglas Gregor2012-01-031-1/+1
| | | | | | @import identifier [. identifier]* ; llvm-svn: 147452
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-11/+5
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-5/+0
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-151-5/+5
| | | | | | | | | | declarations and definitions) as ObjCInterfaceDecls within the same redeclaration chain. This new representation matches what we do for C/C++ variables/functions/classes/templates/etc., and makes it possible to answer the query "where are all of the declarations of this class?" llvm-svn: 146679
* Move the definition-specific data of ObjCInterfaceDecl into aDouglas Gregor2011-12-151-0/+5
| | | | | | | | | | | | | | | | separately-allocated DefinitionData structure, which we manage the same way as CXXRecordDecl::DefinitionData. This prepares the way for making ObjCInterfaceDecls redeclarable, to more accurately model forward declarations of Objective-C classes and eliminate the mutation of ObjCInterfaceDecl that causes us serious trouble in the AST reader. Note that ObjCInterfaceDecl's accessors are fairly robust against being applied to forward declarations, because Clang (and Sema in particular) doesn't perform RequireCompleteType/hasDefinition() checks everywhere it has to. Each of these overly-robust cases is marked with a FIXME, which we can tackle over time. llvm-svn: 146644
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-021-0/+7
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* Add support for pretty-printing attributes, from Richard Membarth!Douglas Gregor2011-11-191-6/+16
| | | | llvm-svn: 145002
* DeclPrinter: print the declaration's storage class specifier asPeter Collingbourne2011-11-081-3/+4
| | | | | | | | | written, instead of the resolved storage class, which might not be legal to specify on the declaration (such as out-of-line definitions of static class members in C++, and __local variables in OpenCL). Initial patch by Richard Membarth. llvm-svn: 144062
* Fixed CXX struct and class initialization printing to support 'move'Jim Goodnow II2011-10-301-1/+1
| | | | | | type constructors. llvm-svn: 143309
* 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
OpenPOWER on IntegriCloud