summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Audit DeclPrinter with -ast-dump on Cocoa.h andFariborz Jahanian2012-12-191-10/+25
| | | | | | | | | fix any bad objectiveC syntax coming out of DeclPrinter. This is on going. Also, introduce a new PrintPolicy and use it as needed when declaration tag is to be produced via DeclPrinter. llvm-svn: 170606
* Fix PR14591: Windows newlines in doxygen comments cause failed assertion inDmitri Gribenko2012-12-191-2/+1
| | | | | | | | TextDiagnostic Patch by Janusz Chorko. llvm-svn: 170566
* Comment parsing: add a missing 'else'. Found by inspection.Dmitri Gribenko2012-12-191-1/+1
| | | | | | | No testcase because we were just building an extra AST node and eventually throwing it away, so it did not affect correctness. llvm-svn: 170563
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-1/+1
| | | | | | single attribute in the future. llvm-svn: 170500
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-192-1/+9
| | | | | | | | | | | | copy-list-initialization (and doesn't add an additional copy step): Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it when instantiating initializers in order to correctly handle instantiation of copy-list-initialization. Teach TreeTransform that function arguments are initializations, and so need this special treatment too. Finally, remove some hacks which were working around SubstInitializer's shortcomings. llvm-svn: 170489
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-195-34/+36
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* Fix a crash in diagnostic printing when a template class type is diff'edEli Friedman2012-12-181-1/+6
| | | | | | against itself. PR14489. llvm-svn: 170474
* This is the libclang patch providing minimal API toFariborz Jahanian2012-12-181-1/+3
| | | | | | | | | | use clang's formatter. Currently, formatter is used to format declaration tags for xml comments. Since formatter is in flux and its change will break several of the clang comment tests, only a single tests is formatted using this facility. Doug has reviewed and approved it for check-in. llvm-svn: 170467
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-186-0/+50
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-186-6117/+6067
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-186-6067/+6117
| | | | llvm-svn: 170428
* Merge storage classes even when contexts don't match.Rafael Espindola2012-12-181-2/+6
| | | | | | | | This fixes the storage class of extern decls that are merged with file level statics. The patch also fixes the linkage computation so that they are considered internal. llvm-svn: 170406
* Fix isThisDeclarationADefinition for extern following tentative.Rafael Espindola2012-12-171-1/+1
| | | | | | | | An extern declaration following a tentative definition should not itself be considered a tentative definition. Fixes pr14614. llvm-svn: 170377
* Don't hit an assertion failure when calculating the __PRETTY_FUNCTION__Argyrios Kyrtzidis2012-12-141-1/+1
| | | | | | | | | | | | | | of a member function with parenthesized declarator. Like this test case: class Foo { const char *(baz)() { return __PRETTY_FUNCTION__; } }; llvm-svn: 170233
* Rename StmtDumper to ASTDumper.Alexander Kornienko2012-12-132-59/+59
| | | | | | Patch contributed by Philip Craig! llvm-svn: 170127
* Use @import rather than @__experimental_modules_import, since theDouglas Gregor2012-12-111-1/+1
| | | | | | latter is rather a mess to type. llvm-svn: 169919
* objective-C blocks: Check for record type when deciding if Fariborz Jahanian2012-12-111-1/+1
| | | | | | | byref variable requires extended layout info. to prevent a crash involving arrays declared __block. // rdar://12787751 llvm-svn: 169908
* StmtDumper coding style changesAlexander Kornienko2012-12-111-105/+131
| | | | | | | | | | | | | | | | | | | | | Summary: A few small coding style changes for StmtDumper, including: - rename Dump* methods to dump* - uninline some methods - comment fixes - whitespace fixes Please review and commit if okay. Reviewers: alexfh Reviewed By: alexfh CC: cfe-commits, alexfh, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D190 llvm-svn: 169866
* Rename StmtDumper::DumpSubTree() to dumpStmt()Alexander Kornienko2012-12-111-86/+84
| | | | | | | | | | | | | | | | | Summary: Also rename DumpDeclarator() to dumpDecl(). Once Decl dumping is added, these will be the two main methods of the class, so this is just for consistency in naming. There was a DumpStmt() method already, but there was no point in having it, so I have merged it into VisitStmt(). Similarly, DumpExpr() is merged into VisitExpr(). Reviewers: alexfh Reviewed By: alexfh CC: cfe-commits, alexfh Differential Revision: http://llvm-reviews.chandlerc.com/D156 llvm-svn: 169865
* Finish implementing 'selected constructor' rules for triviality in C++11. InRichard Smith2012-12-082-8/+101
| | | | | | | | | | | | | | | | | | | | | | | | the cases where we can't determine whether special members would be trivial while building the class, we eagerly declare those special members. The impact of this is bounded, since it does not trigger implicit declarations of special members in classes which merely *use* those classes. In order to determine whether we need to apply this rule, we also need to eagerly declare move operations and destructors in cases where they might be deleted. If a move operation were supposed to be deleted, it would instead be suppressed, and we could need overload resolution to determine if we fall back to a trivial copy operation. If a destructor were implicitly deleted, it would cause the move constructor of any derived classes to be suppressed. As discussed on cxx-abi-dev, C++11's selected constructor rules are also retroactively applied as a defect resolution in C++03 mode, in order to identify that class B has a non-trivial copy constructor (since it calls A's constructor template, not A's copy constructor): struct A { template<typename T> A(T &); }; struct B { mutable A a; }; llvm-svn: 169673
* Remove some remnants of the assumption that there is at most one of eachRichard Smith2012-12-081-124/+0
| | | | | | flavour of special member. llvm-svn: 169670
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-082-24/+50
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-082-2/+12
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
* Currently when AST record layouts are dumped with -fdump-record-layouts, theEli Bendersky2012-12-081-3/+11
| | | | | | | | | | | | | | following: sizeof=132, dsize=132, align=4 nvsize=132, nvalign=4 Is not indented, so when classes are nested there is no way to know to which class it belongs. Fix this problem by indenting the size summary properly for each class. llvm-svn: 169654
* Don't use dyn_cast on a Type* which might not be canonical. Fixes an ↵Richard Smith2012-12-061-1/+2
| | | | | | extremely obscure record layout bug. llvm-svn: 169467
* More C++ testing of declarations embedded inFariborz Jahanian2012-12-061-1/+1
| | | | | | | | <declaration> tag of Comment XML and fixing DeclPrint of templates along the way - wip. //rdar://12378714 llvm-svn: 169453
* 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
* Testing C declarations embedded inFariborz Jahanian2012-12-041-0/+1
| | | | | | | | <declaration> tag of Comment XML and fixed a missing block literal printout as result of the testing. // rdar://12378714 llvm-svn: 169307
* 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
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-0423-46/+44
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* 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
* Include pruning and general cleanup.Benjamin Kramer2012-12-014-5/+9
| | | | llvm-svn: 169095
* Don't include Type.h in DeclarationName.h.Benjamin Kramer2012-12-011-0/+15
| | | | | | Recursively prune some includes. llvm-svn: 169094
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-0114-28/+89
| | | | | | | | | 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
* Refactor to reduce duplication in handling of special member functions. No ↵Richard Smith2012-11-302-174/+86
| | | | | | functionality change. llvm-svn: 168977
* Now that the underlying problem has been fixed, add r168411 back.Rafael Espindola2012-11-291-6/+4
| | | | | | | | Original commit message: Remove redundant code. llvm-svn: 168900
* Merge function types in C.Rafael Espindola2012-11-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Among other differences, GCC accepts typedef int IA[]; typedef int A10[10]; static A10 *f(void); static IA *f(void); void g(void) { (void)sizeof(*f()); } but clang used to reject it with: invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []') The intention of c99's 6.2.7 seems to be that we should use the composite type and accept as gcc does. Doing the type merging required some extra fixes: * Use the type from the function type in initializations, even if an parameter is available. * Fix the merging of the noreturn attribute in function types. * Make CodeGen handle the fact that an parameter type can be different from the corresponding type in the function type. llvm-svn: 168895
* [-cxx-abi microsoft] Also spill the argument-back-references context when ↵Timur Iskhodzhanov2012-11-291-3/+7
| | | | | | mangling templates llvm-svn: 168862
* objective-C blocks: Make sure that identical logic is usedFariborz Jahanian2012-11-281-76/+36
| | | | | | | | | | in deciding a copy/dispose field is needed in a byref structure and when generating the copy/dispose helpers. In certain cases, these fields were being added but no copy/dispose was being generated. This was uncovered in ARC, but not in MRR. // rdar://12759433 llvm-svn: 168825
* Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith2012-11-282-107/+148
| | | | | | | constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. llvm-svn: 168775
* Introduce ASTUnresolvedSet, an UnresolvedSet-like class, whose contents areArgyrios Kyrtzidis2012-11-281-10/+10
| | | | | | | | | | | allocated using the allocator associated with an ASTContext. Use this inside CXXRecordDecl::DefinitionData instead of an UnresolvedSet to avoid a potential memory leak. rdar://12761275 llvm-svn: 168771
* Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,Argyrios Kyrtzidis2012-11-281-15/+19
| | | | | | expose only the iterators instead. llvm-svn: 168770
* Fix the definition of the vfork() builtin on Haiku. PR14378.Eli Friedman2012-11-271-0/+9
| | | | llvm-svn: 168674
* Revert r168411 for now.Rafael Espindola2012-11-271-4/+6
| | | | llvm-svn: 168667
* Fix PR14413 - incorrect mangling of anonymous namespaces with -cxx-abi microsoftTimur Iskhodzhanov2012-11-261-1/+1
| | | | llvm-svn: 168583
* Add r168519 back, but with a fix to also merge the used flag in variables.Rafael Espindola2012-11-251-7/+0
| | | | llvm-svn: 168564
* Revert r168519, "Merge used flags so that we don't have to iterate on ↵NAKAMURA Takumi2012-11-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isUsed. With this change" It brought bunch of (possibly false) warnings. llvm/unittests/VMCore/PassManagerTest.cpp:60:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration] char ModuleNDNM::ID=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:86:22: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration] char ModuleNDM2::ID=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:106:21: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration] char ModuleDNM::ID=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:217:16: warning: variable 'initcount' is not needed and will not be emitted [-Wunneeded-internal-declaration] int LPass::initcount=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:218:16: warning: variable 'fincount' is not needed and will not be emitted [-Wunneeded-internal-declaration] int LPass::fincount=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:259:16: warning: variable 'inited' is not needed and will not be emitted [-Wunneeded-internal-declaration] int BPass::inited=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:260:16: warning: variable 'fin' is not needed and will not be emitted [-Wunneeded-internal-declaration] int BPass::fin=0; ^ llvm/unittests/VMCore/PassManagerTest.cpp:283:24: warning: variable 'ID' is not needed and will not be emitted [-Wunneeded-internal-declaration] char OnTheFlyTest::ID=0; ^ 8 warnings generated. llvm-svn: 168549
OpenPOWER on IntegriCloud