Commit Graph

4114 Commits

Author SHA1 Message Date
Douglas Gregor 6fa6942dda When we have an Objective-C object with non-trivial lifetime in a
structor class under ARC, that struct/class does not have a trivial
move constructor or move assignment operator. Fixes the rest of
<rdar://problem/11738725>.

llvm-svn: 160615
2012-07-23 04:23:39 +00:00
Dmitri Gribenko 66a00c765f Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.
The assertion was wrong in case we have a verbatim block without a closing
command.

Also add tests for closing command name in a verbatim block, since now it can
be empty in such cases.

llvm-svn: 160568
2012-07-20 20:18:53 +00:00
Dmitri Gribenko af03ef7cce CommentBriefParser: coding style fix
llvm-svn: 160551
2012-07-20 17:02:25 +00:00
Dmitri Gribenko 77369eead6 CommentBriefParser: use \returns if we can't find the \brief or just a plain
paragraph.

llvm-svn: 160550
2012-07-20 17:01:34 +00:00
Nico Weber 9035951409 Let Expr::HasSideEffects() return false for NULL, bool literals, this, and nullptr.
Fixes PR13413, -Wunused-private-field now warns on unused fields initialized to NULL.

llvm-svn: 160541
2012-07-20 03:39:05 +00:00
Eric Christopher f8378ca2b1 Remove HasSynthBitfield and all callers/writers/etc. Also remove
previous ResetObjCLayout calls since this is now handled in Sema.

Part of rdar://11842763

llvm-svn: 160527
2012-07-19 22:22:55 +00:00
Dmitri Gribenko a309c95d41 CommentDumper: print word-like arguments for block commands.
llvm-svn: 160519
2012-07-19 18:43:24 +00:00
Dmitri Gribenko e82ae819d3 CommentSema: add more inline commands to tables
llvm-svn: 160481
2012-07-19 00:21:03 +00:00
Dmitri Gribenko 7b2ca3e80b Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace
TextComment node was considered whitespace even if it contained other child
nodes.

llvm-svn: 160474
2012-07-19 00:01:56 +00:00
Dmitri Gribenko c16cd2a67b Comment::dump(): show name of inline command
llvm-svn: 160467
2012-07-18 23:20:23 +00:00
Dmitri Gribenko e4a3997d70 Comment parsing: don't parse whitespace before \endverbatim as a separate line of whitespace.
llvm-svn: 160464
2012-07-18 23:01:58 +00:00
Dmitri Gribenko b03cc7e9f4 This fits into 80 columns without wrapping.
llvm-svn: 160453
2012-07-18 21:27:38 +00:00
Dmitri Gribenko 05c3c75581 Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().
llvm-svn: 160452
2012-07-18 20:54:32 +00:00
Dmitri Gribenko 761447cd98 On Darwin, the linker removes functions in CommentDumper.o (Comment::dump())
despite __attribute__(__used__).  As explained by Argyrios,
> .a archive files do some stripping of their own and they remove .o files that
> contain functions that are not referenced by any other .o file.

The fix is to use these functions from another .o file.

Thanks, Argyrios!

llvm-svn: 160437
2012-07-18 16:30:42 +00:00
Dmitri Gribenko 3100519b33 CommentSema: \short is the same as \brief.
llvm-svn: 160414
2012-07-18 00:44:55 +00:00
Dmitri Gribenko 82ea947018 Implement an optimization for finding the comment that occurs just after a
given declaration.

It is based on the observation that during parsing the comment that should be
attached to the decl is usually among the last two documentation comments
parsed.

llvm-svn: 160400
2012-07-17 22:01:09 +00:00
Dmitri Gribenko c4eb9752d4 CommentBriefParser: use StringSwitch::Cases to group synonyms. Thanks Jordan!
llvm-svn: 160396
2012-07-17 21:21:55 +00:00
Douglas Gregor dd6006f365 Teach the ASTImporter how to handle anonymous structs/unions
better. Fixes <rdar://problem/11466212>; the test (and back-ported
version of this code) were committed to LLDB in r160186.

llvm-svn: 160395
2012-07-17 21:16:27 +00:00
Eli Friedman 4eafb6b77b Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.
llvm-svn: 160394
2012-07-17 21:03:05 +00:00
Rafael Espindola 60a2bba976 Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.

llvm-svn: 160393
2012-07-17 20:24:05 +00:00
Dmitri Gribenko 3e242d6d3c CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.
llvm-svn: 160383
2012-07-17 18:35:14 +00:00
Richard Smith 68eea507fa Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from
being a property of a canonical type to being a property of the fully-sugared
type. This should only make a difference in the case where an alias template
ignores one of its parameters, and that parameter is an unexpanded parameter
pack.

llvm-svn: 160244
2012-07-16 00:20:35 +00:00
Richard Smith 9db53d7d68 Revert change accidentally committed in r160240.
llvm-svn: 160241
2012-07-15 23:30:50 +00:00
Richard Smith 7dfc0240ea PR13368: Halve the instantiation depth of this test again. Apparently, FreeBSD
has a much lower default stack limit than the systems I have access to.

llvm-svn: 160240
2012-07-15 23:29:50 +00:00
Eric Christopher 6dcc3762a0 Replace IsSameValue with the llvm::APSInt/llvm::APInt versions
that we just copied from here and replace all uses.

Part of rdar://11875995

llvm-svn: 160224
2012-07-15 00:23:57 +00:00
Chad Rosier cc40ea7f9a Add a per target max vector alignment field (e.g., 32-byte alignment for x86 due to
AVX).  Currently, if no aligned attribute is specified the alignment of a vector is
inferred from its size.  Thus, very large vectors will be over-aligned with no 
benefit.  Target owners should set this target max.

llvm-svn: 160209
2012-07-13 23:57:43 +00:00
Rafael Espindola 5cc7890cac Move option test earlier in the function.
llvm-svn: 160202
2012-07-13 23:26:43 +00:00
Nuno Lopes e61e9dbf73 add support for conditional expressions in Expr::HasSideEffects()
This fixes a bug in __builtin_object_size() codegen

llvm-svn: 160191
2012-07-13 20:48:52 +00:00
Dmitri Gribenko 619e75eb96 Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in line with Statement AST nodes.
llvm-svn: 160182
2012-07-13 19:02:42 +00:00
Rafael Espindola c7c7ad5f7e Use -fvisibility-inlines-hidden in inline functions too. This matches gcc
behavior since gcc pr30066. Thanks to Benjamin Kramer for pointing it out.

llvm-svn: 160174
2012-07-13 14:25:36 +00:00
Richard Smith 57e7ff9c0c Provide a special-case diagnostic when two class member functions instantiate
to the same signature. Fix a bug in the type printer which would cause this
diagnostic to print wonderful types like 'const const int *'.

llvm-svn: 160161
2012-07-13 04:12:04 +00:00
Rafael Espindola eca5cd20a1 Fix a bug in my previous commit. The problem is not that we were not using the
canonical decl for the template, but that we were not merging attributes for
templates at all!

llvm-svn: 160157
2012-07-13 01:19:08 +00:00
Dmitri Gribenko e7bb944c85 Attaching comments to declarations during parsing: handle more Objective-C declarations.
llvm-svn: 160156
2012-07-13 01:06:46 +00:00
Dmitri Gribenko e00ffc7bb8 Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec.
llvm-svn: 160153
2012-07-13 00:44:24 +00:00
Dmitri Gribenko 9460fbf219 Make concepts of optional and forbidden end tags separate. Thanks Jordan for pointing this!
llvm-svn: 160149
2012-07-12 23:37:09 +00:00
Rafael Espindola 6140847647 Use the canonical template decl when trying to find if it has a visibility
attribute.

llvm-svn: 160139
2012-07-12 20:05:04 +00:00
Timur Iskhodzhanov c5098ad371 [Windows] Use thiscall as the default calling convention for class methods. PR12785
llvm-svn: 160121
2012-07-12 09:50:54 +00:00
NAKAMURA Takumi 0e449c4e54 AST/CommentSema.cpp: Fix signess in abs() to appease msvc. It would not make sense to pass (unsigned)-(unsigned) to abs().
llvm-svn: 160097
2012-07-12 00:45:08 +00:00
Richard Smith ded9c2ee92 Stop instantiating a class if we hit a static_assert failure. Also, if the
static_assert fails when parsing the template, don't diagnose it again on every
instantiation.

llvm-svn: 160088
2012-07-11 22:37:56 +00:00
Richard Smith 3d46052d90 Fix warning.
llvm-svn: 160087
2012-07-11 22:33:59 +00:00
Dmitri Gribenko f26054f0fb Enable comment parsing and semantic analysis to emit diagnostics. A few
diagnostics implemented -- see testcases.

I created a new TableGen file for comment diagnostics,
DiagnosticCommentKinds.td, because comment diagnostics don't logically
fit into AST diagnostics file.  But I don't feel strongly about it.

This also implements support for self-closing HTML tags in comment
lexer and parser (for example, <br />).

In order to issue precise diagnostics CommentSema needs to know the
declaration the comment is attached to.  There is no easy way to find a decl by 
comment, so we match comments and decls in lockstep: after parsing one
declgroup we check if we have any new, not yet attached comments.  If we do --
then we do the usual comment-finding process.

It is interesting that this automatically handles trailing comments.
We pick up not only comments that precede the declaration, but also
comments that *follow* the declaration -- thanks to the lookahead in
the lexer: after parsing the declgroup we've consumed the semicolon
and looked ahead through comments.

Added -Wdocumentation-html flag for semantic HTML errors to allow the user to 
disable only HTML warnings (but not HTML parse errors, which we emit as
warnings in -Wdocumentation).

llvm-svn: 160078
2012-07-11 21:38:39 +00:00
Richard Smith 9fce7bc721 Fix crash when constant-evaluating a CXXConstructExpr representing
value-initialization for an array of class type with a trivial default
constructor.

llvm-svn: 160024
2012-07-10 22:12:55 +00:00
Richard Trieu 50f5f46a93 Properly update the FormattedArgs vector when the template type diffing falls
back to regular type printing.

llvm-svn: 159976
2012-07-10 01:46:04 +00:00
Dmitri Gribenko 17709ae8d9 Comment lexing: fix lexing to actually work in non-error cases.
llvm-svn: 159963
2012-07-09 21:32:40 +00:00
Abramo Bagnara cb43567374 The delete argument should not be converted to void*.
llvm-svn: 159961
2012-07-09 21:15:43 +00:00
Alexander Kornienko 20f6fc6220 Inline storage of attributes in AttributedStmt.
llvm-svn: 159925
2012-07-09 10:04:07 +00:00
Richard Smith 1b9f2eb76b PR13290: Constant-evaluation support for CXXConstructExprs which construct a
multidimensional array of class type. Also, preserve zero-initialization when
evaluating an initializer list for an array, in case the initializers refer to
later elements (which have preceding zero-initialization).

llvm-svn: 159904
2012-07-07 22:48:24 +00:00
Dmitri Gribenko 44cd7e6746 Restrict the set of declaration kinds for which we allow trailing comments.
llvm-svn: 159878
2012-07-06 23:27:33 +00:00
Matt Beaumont-Gay 4106ea3b4e Sprinkle llvm_unreachable around to placate GCC's -Wreturn-type.
llvm-svn: 159860
2012-07-06 21:13:09 +00:00
Dmitri Gribenko 7dd29d4d3d Don't store pointers into a std::vector (RawCommentList::Comments). Although
currently we take address of std::vector's contents only after we finished
adding all comments (so no reallocation can happen), this will change in
future.

llvm-svn: 159845
2012-07-06 18:19:34 +00:00