Commit Graph

4143 Commits

Author SHA1 Message Date
Dmitri Gribenko 34df220410 Comment parsing: add support for \tparam command on all levels.
The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.

llvm-svn: 161087
2012-07-31 22:37:06 +00:00
Rafael Espindola fb4263f156 Consider the visibility of template template arguments. GCC doesn't, but it also
fails to consider the linkage, which we were already considering.

llvm-svn: 161070
2012-07-31 19:02:02 +00:00
Anna Zaks 7044adcaa4 Mark ObjCInterfaceDecl::lookupPrivateMethod as const.
llvm-svn: 160989
2012-07-30 20:31:21 +00:00
Dmitri Gribenko 1ba47ca4b5 Comment parser: don't crash on a completely empty \param followed by a block
command

llvm-svn: 160975
2012-07-30 18:05:28 +00:00
Dmitri Gribenko ad40ba91ae Comment dumper: silence a warning by not casting away const
llvm-svn: 160972
2012-07-30 17:52:50 +00:00
Benjamin Kramer bc7dd9ea02 Fix ambiguity detection in GetBestOverloadCandidateSimple.
When performing the simplistic overload resolution for single-argument methods,
don't check the best overload for ambiguity with itself when the best overload
doesn't happen to be the first one.

Fixes PR13480.

llvm-svn: 160961
2012-07-30 15:53:26 +00:00
Dmitri Gribenko 1b72bf0498 Comment dumper: print \param parameter index if parameter name is resolved.
llvm-svn: 160908
2012-07-28 00:35:48 +00:00
Dmitri Gribenko 99b537ef15 CommentSema.cpp: remove extra semicolon
llvm-svn: 160901
2012-07-27 23:26:26 +00:00
Dmitri Gribenko f24990aef1 Comment Sema: don't try to typo-correct a \param when function has zero
arguments.  Just an optimization, no functional change.

llvm-svn: 160896
2012-07-27 21:34:43 +00:00
Dmitri Gribenko 4586df765e Implement resolving of HTML character references (named: &, decimal: *,
hex: ) during comment parsing.

Now internal representation of plain text in comment AST does not contain
character references, but the characters themselves.

llvm-svn: 160891
2012-07-27 20:37:06 +00:00
Anna Zaks c77a3b1aab Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.
Also, fix a subtle bug, which occurred due to lookupPrivateMethod
defined in DeclObjC.h not looking up the method inside parent's
categories.

Note, the code assumes that Class's parent object has the same methods
as what's in the Root class of a the hierarchy, which is a heuristic
that might not hold for hierarchies which do not descend from NSObject.
Would be great to fix this in the future.

llvm-svn: 160885
2012-07-27 19:07:44 +00:00
NAKAMURA Takumi 836926dbdf clang/lib: [CMake] Update tblgen'd dependencies.
llvm-svn: 160851
2012-07-27 06:18:33 +00:00
NAKAMURA Takumi 075c89bc06 clang/lib: [CMake] Reformat, alphabetize lists.
llvm-svn: 160850
2012-07-27 06:18:12 +00:00
Richard Smith d3b5c90865 Final piece of core issue 1330: delay computing the exception specification of
a defaulted special member function until the exception specification is needed
(using the same criteria used for the delayed instantiation of exception
specifications for function temploids).

EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like
EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to
resolve the exception specification.

This is enabled for all C++ modes: it's a little faster in the case where the
exception specification isn't used, allows our C++11-in-C++98 extensions to
work, and is still correct for C++98, since in that mode the computation of the
exception specification can't fail.

The diagnostics here aren't great (in particular, we should include implicit
evaluation of exception specifications for defaulted special members in the
template instantiation backtraces), but they're not much worse than before.

Our approach to the problem of cycles between in-class initializers and the
exception specification for a defaulted default constructor is modified a
little by this change -- we now reject any odr-use of a defaulted default
constructor if that constructor uses an in-class initializer and the use is in
an in-class initialzer which is declared lexically earlier. This is a closer
approximation to the current draft solution in core issue 1351, but isn't an
exact match (but the current draft wording isn't reasonable, so that's to be
expected).

llvm-svn: 160847
2012-07-27 04:22:15 +00:00
Alexander Kornienko 3db68ee109 Added -ast-dump-filter option to clang -cc1.
llvm-svn: 160784
2012-07-26 16:01:23 +00:00
Timur Iskhodzhanov 3c80d5aa15 Remove an outdated comment; add one test to compare function pointer and block mangling
llvm-svn: 160783
2012-07-26 13:41:30 +00:00
Timur Iskhodzhanov 25fabdbace Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)
llvm-svn: 160780
2012-07-26 10:41:15 +00:00
Timur Iskhodzhanov ff7ff3f30b Add a FIXME to revisit the performance of BackRefMap later
llvm-svn: 160709
2012-07-25 08:16:41 +00:00
Richard Smith 2589b9808e PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.

llvm-svn: 160705
2012-07-25 03:56:55 +00:00
Dmitri Gribenko 8f0f1b0c41 Comment diagnostics: add warning for multiple \param commands with duplicate
parameter names.

llvm-svn: 160696
2012-07-24 21:44:16 +00:00
Dmitri Gribenko 52cb218149 CommentSema: simplify functions, per Jordan's comment.
llvm-svn: 160689
2012-07-24 20:58:46 +00:00
Dmitri Gribenko 35b0c09b6c Comment parsing: allow newlines between \param, direction specification (e.g.,
[in]), parameter name and description paragraph.

llvm-svn: 160682
2012-07-24 18:23:31 +00:00
Dmitri Gribenko 0a36302ae0 Comment parsing: couple TextTokenRetokenizer and comment parser together to
remove one of the two variable-length lookahead buffers.  Now retokenizer will
ask for more tokens when it needs them.

llvm-svn: 160680
2012-07-24 17:52:18 +00:00
Dmitri Gribenko 1bfd9dadda Move TextTokenRetokenizer from CommentLexer.h to CommentParser.cpp since it is
an implementation detail of the parser.

llvm-svn: 160679
2012-07-24 17:43:18 +00:00
Dmitri Gribenko 1c85d5b17d Comment parsing: retokenized text tokens are now pushed back in correct (not
reverse) order

llvm-svn: 160675
2012-07-24 16:10:47 +00:00
Timur Iskhodzhanov bf0f663bca Fix PR13207 (Mangling of templates with back references when using -cxx-abi microsoft)
llvm-svn: 160667
2012-07-24 09:37:54 +00:00
Dmitri Gribenko 4b7f5fe572 Comment Sema: refactor handling of 'ParmVarDecl's and save them in Sema members.
llvm-svn: 160634
2012-07-23 17:40:30 +00:00
Dmitri Gribenko d73e4ce992 Comment AST: add InlineContentComment::RenderKind to specify a default
rendering mode for clients that don't want to interpret Doxygen commands.

Also add a libclang API to query this information.

llvm-svn: 160633
2012-07-23 16:43:01 +00:00
Sylvestre Ledru 830885ca64 Fix a typo (the the => the)
llvm-svn: 160622
2012-07-23 08:59:39 +00:00
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