summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Comment parsing: attach any tag type's documentation to its typedef if latterDmitri Gribenko2013-01-271-4/+12
| | | | | | | | does not have one of its own. // rdar://13067629 Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me. llvm-svn: 173626
* Revert r173586 (and r173587) , "Attach any tag type's documentation to its ↵NAKAMURA Takumi2013-01-271-4/+4
| | | | | | | | typedef if" It caused unexpected warnings with @tparam. llvm-svn: 173614
* Fix comment.Fariborz Jahanian2013-01-261-1/+1
| | | | llvm-svn: 173587
* Attach any tag type's documentation to its typedef ifFariborz Jahanian2013-01-261-3/+3
| | | | | | latter does not have one of its own. // rdar://13067629 llvm-svn: 173586
* Added ASTContext methods getIntPtrType and getUIntPtrType.Enea Zaffanella2013-01-261-0/+8
| | | | llvm-svn: 173581
* Constify some getters of DesignatedInitExprDmitri Gribenko2013-01-261-6/+9
| | | | llvm-svn: 173574
* Highlight various parts of the AST dump with color. Colors are controlled byRichard Trieu2013-01-261-36/+156
| | | | | | | -f(no-)color-diagnostics. In addition, dumpColor() function calls are added to force color printing. No structural changes to -ast-dump. llvm-svn: 173548
* Comment parsing: actually check for a block command after "\param x"Dmitri Gribenko2013-01-261-6/+23
| | | | | | This fixes PR15068. llvm-svn: 173539
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-252-0/+6
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* simplify code by removing excessive bracing.Fariborz Jahanian2013-01-251-20/+12
| | | | llvm-svn: 173521
* Attach enum's documentation to its typedef ifFariborz Jahanian2013-01-251-0/+10
| | | | | | latter does not have one of its own. // rdar://13067629 llvm-svn: 173516
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-252-17/+50
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-254-16/+23
| | | | llvm-svn: 173514
* Clean up: since we have FunctionDecl::IsInline, make it store the right valueRichard Smith2013-01-251-34/+6
| | | | | | | | | | | | for template instantiations, and use it to simplify the implementation of FunctionDecl::isInlined(). This incidentally changes the result of isInlined on a declared-but-not-defined non-inline member function from true to false. This is sort of a bug fix, but currently isInlined is only called on function definitions, so it has no visible effects. llvm-svn: 173397
* removed duplicated comment.Fariborz Jahanian2013-01-241-1/+0
| | | | llvm-svn: 173378
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-241-17/+57
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* Add constness for NestedNameSpecifier::Create parameterDmitri Gribenko2013-01-231-2/+3
| | | | llvm-svn: 173274
* Constify some getters in RedeclarableTemplateDeclDmitri Gribenko2013-01-231-6/+6
| | | | llvm-svn: 173272
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-231-1/+1
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Fix a bug in VarDecl::getSourceRange() for static member arrays with an elementNico Weber2013-01-221-1/+3
| | | | | | | | type with an implicit initializer expression. Patch from Will Wilson <will@indefiant.com>! llvm-svn: 173170
* Switch to APFloat constructor taking fltSemantics.Tim Northover2013-01-222-6/+38
| | | | | | | | This change also makes the serialisation store the required semantics, fixing an issue where PPC128 was always assumed when re-reading a 128-bit value. llvm-svn: 173139
* First step towards vftable generation with -cxx-abi microsoft PR13231Timur Iskhodzhanov2013-01-211-29/+86
| | | | llvm-svn: 173035
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-208-0/+14
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Use llvm::hexDigitValue in comment lexerDmitri Gribenko2013-01-191-6/+2
| | | | llvm-svn: 172924
* Some builtins do not evaluate their arguments. Teach EvaluatedExprVisitor notRichard Smith2013-01-171-0/+6
| | | | | | to visit them. llvm-svn: 172769
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-171-2/+17
| | | | | | | | return type of a function by canonicalizing them away. They are useless anyway, and conflict with our rules for template argument deduction and __strong. Fixes <rdar://problem/12367446>. llvm-svn: 172768
* Suppress all -Wunused-value warnings from macro body expansions.Matt Beaumont-Gay2013-01-171-4/+0
| | | | | | | | | | | | | | | | | | | This is inspired by a number of false positives in real code, including PR14968. I've added test cases reduced from these false positives to test/Sema/unused-expr.c, as well as corresponding test cases that pass the offending expressions as arguments to a no-op macro to ensure that we do warn there. This also removes my previous tweak from r166522/r166534, so that we warn on unused cast expressions in macro arguments. There were several test cases that were using -Wunused-value to test general diagnostic emission features; I changed those to use other warnings or warn on a macro argument expression. I stared at the test case for PR14399 for a while with Richard Smith and we believe the new test case exercises the same codepaths as before. llvm-svn: 172696
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-0/+5
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Treat hidden Objective-C protocol definitions as if they wereDouglas Gregor2013-01-171-0/+27
| | | | | | | undefined, and don't find methods or protocols within those protocol definitions. This completes <rdar://problem/10634711>. llvm-svn: 172686
* [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
OpenPOWER on IntegriCloud