summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* [objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a ↵Argyrios Kyrtzidis2013-01-161-0/+8
| | | | | | | | | | | | | | | | | | dictionary literal if we can see the elements of the arrays. for example: NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]]; --> NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" }; rdar://12428166 llvm-svn: 172679
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-164-82/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Fix CastDavid Greene2013-01-151-1/+2
| | | | | | Avoid a cast-away-const error by properly using const_cast<>. llvm-svn: 172558
* Resolved merge error with r172323 (llvm::X -> X)Alexander Kornienko2013-01-151-1/+1
| | | | llvm-svn: 172528
* Dump comments in -ast-dump.Alexander Kornienko2013-01-144-280/+196
| | | | | | | | | | | http://llvm-reviews.chandlerc.com/D269 "Added dumping of declaration comments in ASTDumper. This required moving the comment dumping code from CommentDumper so that the indentation is correct." Patch by Philip Craig! llvm-svn: 172409
* Remove an unneeded const_castDmitri Gribenko2013-01-141-1/+1
| | | | llvm-svn: 172370
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-1213-57/+56
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* commentRafael Espindola2013-01-121-0/+3
| | | | llvm-svn: 172317
* barRafael Espindola2013-01-121-0/+3
| | | | llvm-svn: 172316
* Disable caching of visibility.Rafael Espindola2013-01-123-42/+44
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor2013-01-121-0/+5
| | | | | | | | | | | | | which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
* comment parsing: when property accessors don't have commentFariborz Jahanian2013-01-122-1/+15
| | | | | | | of their own (or are syntheszed), use prperty's comment. for them. // rdar://12791315 llvm-svn: 172278
* Fixed a bug that caused the AST importer to erroneouslySean Callanan2013-01-111-1/+1
| | | | | | | import incomplete definitions for RecordDecls and then mark the resulting definition as complete. llvm-svn: 172273
* Issue warning when case value is too large to fitFariborz Jahanian2013-01-091-1/+3
| | | | | | | | | in case condition type. // rdar://11577384. Test is conditionalized on x86_64-apple triple as I am not sure if the INT_MAX/LONG_MAX values in the test will pass this test for other hosts. llvm-svn: 172016
* Suppress GCC -Wreturn warning.David Blaikie2013-01-091-0/+1
| | | | | | Modified from a patch by David Greene. llvm-svn: 171982
* Handle static functions being redeclared in function scope.Rafael Espindola2013-01-091-0/+4
| | | | | | Fixes pr14861. llvm-svn: 171978
* Clear the LV cache when setting the instantiated from link.Rafael Espindola2013-01-081-0/+1
| | | | | | Fixes pr14835. llvm-svn: 171857
* Move ref qualifiers from Type bitfields into FunctionProtoType, stealing twoRichard Smith2013-01-081-2/+5
| | | | | | | bits from the number of parameters. This brings the bitfields down from 33 bits to 32 bits, reducing the size of Types by 4 bytes on 32-bit systems. llvm-svn: 171827
* Minor refactoring of my last patchFariborz Jahanian2013-01-071-13/+12
| | | | | | related to // rdar://12958878 llvm-svn: 171792
* objective-C: when searching for declarations in protocolFariborz Jahanian2013-01-071-4/+8
| | | | | | | list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
* Implement Attr dumping for -ast-dump.Alexander Kornienko2013-01-072-0/+29
| | | | | | | | http://llvm-reviews.chandlerc.com/D234 Patch by Philip Craig! llvm-svn: 171760
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-071-6/+16
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* 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
OpenPOWER on IntegriCloud