summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Assert that redeclarations have the same linkage.Rafael Espindola2013-01-051-3/+28
| | | | | | | It is somewhat hard to test linkage, so I decided to try to add an assert. This already found some interesting cases where there were different. llvm-svn: 171585
* Style fix: We don't use lowercase-and-underscored template parameter names.Rafael Espindola2013-01-041-3/+3
| | | | | | Thanks for dgregor for noticing it. llvm-svn: 171532
* Fix typo. Thanks to dgregor for noticing it.Rafael Espindola2013-01-041-1/+1
| | | | llvm-svn: 171521
* Fix up various builtin declaration of objc_msgSend familiesFariborz Jahanian2013-01-041-1/+16
| | | | | | | to match those foung in objc.h an avoid spurious warnings. // rdar://12489098 llvm-svn: 171492
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-2/+2
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-025-25/+25
| | | | llvm-svn: 171367
* Convert an if that never happens to an assert.Rafael Espindola2013-01-021-3/+2
| | | | llvm-svn: 171354
* Comment lexing: replace manual comparison with StringRef::find_first_ofDmitri Gribenko2012-12-301-9/+6
| | | | | | This gives an about 1.8% improvement on Clang bootstrap with -Wdocumentation llvm-svn: 171262
* Don't get confused if a extern "C" builtin function is redeclared withoutRafael Espindola2012-12-301-1/+1
| | | | | | the extern "C". llvm-svn: 171260
* ArrayRefize CXXTryStmt.Nico Weber2012-12-291-7/+6
| | | | llvm-svn: 171239
* ArrayRefize a CompoundStmt constructor.Nico Weber2012-12-291-6/+6
| | | | llvm-svn: 171238
* Reject overloading of two static extern C functions.Rafael Espindola2012-12-281-0/+30
| | | | | | | | This patch moves hasCLanguageLinkage to be VarDecl and FunctionDecl methods so that they can be used from SemaOverload.cpp and then fixes the logic in Sema::IsOverload. llvm-svn: 171193
* Replace magic numbers in CheckICE with an enum.Richard Smith2012-12-281-70/+66
| | | | llvm-svn: 171192
* PR14729: Fix typo in CheckICE for BinaryConditionalOperators.Richard Smith2012-12-281-1/+1
| | | | llvm-svn: 171191
* Fix for PR12222.Erik Verbruggen2012-12-253-115/+92
| | | | | | | | Changed getLocStart() and getLocEnd() to be required for Stmts, and make getSourceRange() optional. The default implementation for getSourceRange() is build the range by calling getLocStart() and getLocEnd(). llvm-svn: 171067
* Add intel_ocl_bicc calling convention as a function attribute to clang. The ↵Guy Benyei2012-12-253-0/+6
| | | | | | calling convention is already implemented in LLVM. llvm-svn: 171056
* Add 171048 back but invalidate the cache of all redeclarations when settingRafael Espindola2012-12-252-29/+38
| | | | | | | | | | | | | | | | | | the body of a functions. The problem was that hasBody looks at the entire chain and causes problems to -fvisibility-inlines-hidden if the cache was not invalidated. Original message: Cache visibility of decls. This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171053
* Revert r171048, "Cache visibility of decls."NAKAMURA Takumi2012-12-252-36/+29
| | | | | | It broke stage2. llvm-svn: 171050
* Cache visibility of decls.Rafael Espindola2012-12-252-29/+36
| | | | | | | | | | | This unifies the linkage and visibility caching. I first implemented this when working on pr13844, but the previous fixes removed the performance advantage of this one. This is still a step in the right direction for making linkage and visibility cheap to use. llvm-svn: 171048
* Use a safe default width for template-diff'ing integral arguments, inDouglas Gregor2012-12-211-1/+1
| | | | | | | case we can't find an exact width to use. Fixes crash in <rdar://problem/12456626>. llvm-svn: 170951
* Fixes couple of friend declaration -ast-print bugFariborz Jahanian2012-12-211-5/+3
| | | | | | | | | found by running -ast-print on all-std-headers.cpp which caused it to go into infinite loop. Now -ast-print prints all declarations found in all-std-headers.cpp. llvm-svn: 170928
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-1/+1
| | | | | | which is wrong here. llvm-svn: 170721
* Minor coding style issue: NULL -> 0Alexander Kornienko2012-12-201-1/+1
| | | | llvm-svn: 170688
* ASTDumper coding style fixes.Alexander Kornienko2012-12-201-17/+16
| | | | | | | | http://llvm-reviews.chandlerc.com/D226 Patch by Philip Craig! llvm-svn: 170684
* Fix another uninitialized bool member bug found by -fsanitize=bool. This oneRichard Smith2012-12-201-0/+1
| | | | | | | appears to currently be benign (we happen to test the flags in the right order, so we never depend on the uninitialized value). llvm-svn: 170640
* Robustify the @encode code and add support for _Atomic.John McCall2012-12-201-52/+109
| | | | | | Fixes PR14628. llvm-svn: 170639
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-201-2/+20
| | | | | | | | produce a note for that diagnostic either with a different DiagnosticEngine or after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the wrong thing if the original diagnostic was suppressed. llvm-svn: 170636
* Implement AST dumper for Decls.Alexander Kornienko2012-12-204-167/+780
| | | | | | | | http://llvm-reviews.chandlerc.com/D52 Patch by Philip Craig! llvm-svn: 170634
* 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
OpenPOWER on IntegriCloud