aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Index/comment-to-html-xml-conversion.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-02-20[Index] Un-XFAIL test with msanVitaly Buka1-1/+0
Passing after #127078.
2024-06-10[Clang][Comments] Add argument parsing for @throw @throws @exception (#84726)hdoc1-30/+49
Doxygen allows for the `@throw`, `@throws`, and `@exception` commands to have an attached argument indicating the type being thrown. Currently, Clang's AST parsing doesn't support parsing out this argument from doc comments. The result is missing compatibility with Doxygen. This PR implements parsing of arguments for the `@throw`, `@throws`, and `@exception` commands. Each command can only have one argument, matching the semantics of Doxygen.
2023-08-28[clang] Remove rdar links; NFCAaron Ballman1-2/+0
We have a new policy in place making links to private resources something we try to avoid in source and test files. Normally, we'd organically switch to the new policy rather than make a sweeping change across a project. However, Clang is in a somewhat special circumstance currently: recently, I've had several new contributors run into rdar links around test code which their patch was changing the behavior of. This turns out to be a surprisingly bad experience, especially for newer folks, for a handful of reasons: not understanding what the link is and feeling intimidated by it, wondering whether their changes are actually breaking something important to a downstream in some way, having to hunt down strangers not involved with the patch to impose on them for help, accidental pressure from asking for potentially private IP to be made public, etc. Because folks run into these links entirely by chance (through fixing bugs or working on new features), there's not really a set of problematic links to focus on -- all of the links have basically the same potential for causing these problems. As a result, this is an omnibus patch to remove all such links. This was not a mechanical change; it was done by manually searching for rdar, radar, radr, and other variants to find all the various problematic links. From there, I tried to retain or reword the surrounding comments so that we would lose as little context as possible. However, because most links were just a plain link with no supporting context, the majority of the changes are simple removals. Differential Review: https://reviews.llvm.org/D158071
2023-07-17Revert "Remove rdar links; NFC"Mehdi Amini1-0/+2
This reverts commit d618f1c3b12effd0c2bdb7d02108d3551f389d3d. This commit wasn't reviewed ahead of time and significant concerns were raised immediately after it landed. According to our developer policy this warrants immediate revert of the commit. https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy Differential Revision: https://reviews.llvm.org/D155509
2023-07-07Remove rdar links; NFCAaron Ballman1-2/+0
This removes links to rdar, which is an internal bug tracker that the community doesn't have visibility into. See further discussion at: https://discourse.llvm.org/t/code-review-reminder-about-links-in-code-commit-messages/71847
2022-09-01[Clang][Comments] Parse `<img src=""/>` in doc comments correctlyEgor Zhdan1-0/+50
This is a valid HTML5 tag. Previously it triggered a Clang error (`HTML start tag prematurely ended, expected attribute name or '>'`) since Clang was treating `/>` as a text token. This was happening because after lexing the closing quote (`"`) the lexer state was reset to "Normal" while the tag was not actually closed yet: `>` was not yet parsed at that point. rdar://91464292 Differential Revision: https://reviews.llvm.org/D132932
2022-08-31[libclang] Fix conversion from `StringRef` to `CXString`Egor Zhdan1-0/+9
`CXString createRef(StringRef String)` used to return an invalid string when invoked with some empty strings: If a `StringRef` holds a non-nullptr pointer, for instance, pointing into contents of a larger string, and has a zero length, `createRef` previously returned the entire larger string, ignoring the fact that the actual string passed to it as a param is empty. This was discovered when invoking `c-index-test` to dump the contents of documentation comments, in case the comment contains an empty HTML attribute, such as `src=""`. Differential Revision: https://reviews.llvm.org/D133009
2019-12-21[Wdocumentation] Implement \anchorMark de Wever1-0/+10
Differential revision: https://reviews.llvm.org/D69223
2016-11-10Make output of -ast-print a valid C++ code.Serge Pavlov1-3/+3
Output generated by option -ast-print looks like C/C++ code, and it really is for plain C. For C++ the produced output was not valid C++ code, but the differences were small. With this change the output is fixed and can be compiled. Tests are changed so that output produced by -ast-print is compiled again with the same flags and both outputs are compared. Option -ast-print is extensively used in clang tests but it itself was tested poorly, existing tests only checked that compiler did not crash. There are unit tests in file DeclPrinterTest.cpp, but they test only terse output mode. Differential Revision: https://reviews.llvm.org/D26452 llvm-svn: 286439
2015-11-15[libclang] Visit TypeAliasTemplateDeclSergey Kalinichev1-1/+1
This makes TypeAliasTemplateDecl accessible via LibClang and python bindings Differential Revision: http://reviews.llvm.org/D13844 llvm-svn: 253166
2015-08-05[test/Index] Update libclang tests to use libclang for creating PCH files.Argyrios Kyrtzidis1-0/+1
This is consistent and tests the primary configuration we want to test, libclang creating and consuming PCH files. llvm-svn: 244066
2014-12-08[libclang] Use same USR encoding for 'class' as 'struct'.Argyrios Kyrtzidis1-20/+20
'class' and 'struct' can be used interchangebly for forward references. Use the same encoding otherwise we may get into a weird situation where the USR for the same declaration is different based on whether the definition of the tag reference is visible or not. llvm-svn: 223632
2014-12-08[libclang] Function templates can be 'overloaded' by return type, so encode ↵Argyrios Kyrtzidis1-6/+6
the return type in the USR and handle DependentNameType in order to be able to distinguish them. llvm-svn: 223628
2014-04-30Comment parsing: remove HTML attribute validationDmitri Gribenko1-9/+9
Since the community says that a blacklist is not good enough, and I don't have enough time now to implement a proper whitelist, let's just remove the attribute validation. But, nevertheless, we can still communicate in the generated XML if our parser found an issue with the HTML. But this bit is best-effort and is specifically called out in the schema as such. llvm-svn: 207712
2014-04-22Comment parsing: close a hole in CDATA escaping in XML outputDmitri Gribenko1-0/+12
llvm-svn: 206886
2014-04-22Comment parsing: in the generated XML file, mark HTML that is safe to passDmitri Gribenko1-2/+30
through to the output even if the input comment comes from an untrusted source Attribute filtering is currently based on a blacklist, which right now includes all event handler attributes (they contain JavaScipt code). It should be switched to a whitelist, but going over all of the HTML5 spec requires a significant amount of time. llvm-svn: 206882
2014-03-27Comment parsing: attach comments to enums declared using the NS_ENUM macroDmitri Gribenko1-12/+0
Previously we would only attach comments to the typedef. llvm-svn: 204942
2014-02-25Pretty Printer: Print constexpr and ref qualifiers. Don't print return types ↵Benjamin Kramer1-1/+1
on destructors. llvm-svn: 202181
2014-02-25Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."Benjamin Kramer1-1/+1
There were many additional tests that had the bad behavior baked in. llvm-svn: 202174
2013-12-05Correct hyphenations in comments and assert messagesAlp Toker1-3/+3
This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
2013-11-20Comment parsing tests: introduce a little more structure in testcaseDmitri Gribenko1-34/+58
llvm-svn: 195187
2013-11-20Revert r195176, it is breaking buildbots for unclear reasonDmitri Gribenko1-58/+34
llvm-svn: 195184
2013-11-20Comment parsing tests: introduce a little more structure in testcaseDmitri Gribenko1-34/+58
llvm-svn: 195176
2013-11-19Remove full path from CHECK lineDmitri Gribenko1-1/+2
llvm-svn: 195147
2013-11-19Documentation parsing: in HeaderDoc, \abstract is equivalent to \briefDmitri Gribenko1-13/+28
llvm-svn: 195145
2013-11-12Documentation parsing: add support for \throws \throw \exception commandsDmitri Gribenko1-0/+86
llvm-svn: 194521
2013-11-09Comment parsing: recognize \def (but processing is a no-op, like the rest ofDmitri Gribenko1-8/+36
similar commands that duplicate the declaration name) llvm-svn: 194312
2013-08-19Comment parsing tests: move tests where they belongDmitri Gribenko1-0/+51
Move C++-specific tests that were checking if we attach a base class comment to a derived class to an existing test comment-to-html-xml-conversion.cpp. Note that the original testing approach was not actually testing the class--comment relationship. It only checked that we attached the comment *somewhere*. The rest of subclass-comment.mm should be also moved elsewhere. llvm-svn: 188658
2013-07-24Documentation parsing: if typedef name is being declaredFariborz Jahanian1-0/+11
via a macro, try using declaration's starting location. This is improvement over not having a valid location and dropping comment altogether. // rdar://14348912 llvm-svn: 187085
2013-06-24Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko1-36/+53
Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
2013-06-22Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko1-6/+6
Remove unneeded member in CommentSema, add a test for the XML schema (the schema already allowed multiple paragraphs in <ResultDiscussion>, but there were no tests for that), fix HTML generation (it is not allowed to have <p> inside <dl>). llvm-svn: 184652
2013-06-21[document parsing]: Allow multiple adjacent \return and the likeFariborz Jahanian1-6/+7
commands. Render them properly in XML output. // rdar://14207725 llvm-svn: 184610
2013-05-31Fix test error caused by r183008.Daniel Jasper1-2/+2
llvm-svn: 183010
2013-05-15Fix test breakage caused by change in clang-format.Daniel Jasper1-2/+2
llvm-svn: 181888
2013-03-27Mark comment-to-html-xml-conversion test as XFAIL:msan, in addition to valgrind.Evgeniy Stepanov1-0/+1
llvm-svn: 178138
2013-02-01Comment parsing: improve the fidelity of XML output for many block commandsDmitri Gribenko1-0/+26
This change introduces a 'kind' attribute for the <Para> tag, that captures the kind of the parent block command. For example: \todo Meow. used to be just <Para>Meow.</Para>, but now it is <Para kind="todo">Meow.</Para> llvm-svn: 174216
2013-01-30Comment parsing: fold named character references test into other HTML testsDmitri Gribenko1-0/+35
llvm-svn: 173934
2013-01-22clang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as ↵NAKAMURA Takumi1-0/+2
XFAIL:valgrind, for now. Working in progress. llvm-svn: 173121
2013-01-21Fixes formatting of empty blocks.Manuel Klimek1-2/+2
We now only put empty blocks into a single line, if all of: - all tokens of the structural element fit into a single line - we're not in a control flow statement Note that we usually don't put record definitions into a single line, as there's usually at least one more token (the semicolon) after the closing brace. This doesn't hold when we are in a context where there is no semicolon, like "enum E {}". There were some missing tests around joining lines around the corner cases of the allowed number of columns, so this patch adds some. llvm-svn: 173055
2013-01-21Fix parsing of templated declarations.Daniel Jasper1-1/+1
Before: template <template <typename T>, typename P > class X; After: template <template <typename T>, typename P> class X; More importantly, the token annotations for the second ">" are now computed correctly. llvm-svn: 173047
2013-01-19Actually update the test, fixup for r172923Dmitri Gribenko1-1/+1
llvm-svn: 172925
2013-01-19Comment parsing: add more tests for html character referencesDmitri Gribenko1-3/+15
llvm-svn: 172923
2013-01-10Do not add newline in empty blocks.Manuel Klimek1-7/+7
void f() {} now gets formatted in one line. llvm-svn: 172067
2013-01-07Comment to XML conversion: no, we don't want to print instantiations for theDmitri Gribenko1-2/+2
<Declaration> tag llvm-svn: 171763
2013-01-07Fix parsing of variable declarations directly after a class / struct.Manuel Klimek1-1/+1
Previous indent: class A { } a; void f() { }; With this patch: class A { } a; void f() { } ; The patch introduces a production for classes and structs, and parses the rest of the line to the semicolon after the class scope. This allowed us to remove a long-standing wart in the parser that would just much the semicolon after any block. Due to this suboptimal formating some tests were broken. Some unrelated formatting tests broke; those hit a bug in the ast printing, and need to be fixed separately. llvm-svn: 171761
2013-01-04Various fixes to clang-format's macro handling.Manuel Klimek1-5/+5
Some of this is still pretty rough (note the load of FIXMEs), but it is strictly an improvement and fixes various bugs that were related to macro processing but are also imporant in non-macro use cases. Specific fixes: - correctly puts espaced newlines at the end of the line - fixes counting of white space before a token when escaped newlines are present - fixes parsing of "trailing" tokens when eof() is hit - puts macro parsing orthogonal to parsing other structure - general support for parsing of macro definitions Due to the fix to format trailing tokens, this change also includes a bunch of fixes to the c-index tests. llvm-svn: 171556
2013-01-02Prefer splitting after "template <...>" and fix indentation.Daniel Jasper1-1/+1
This addresses llvm.org/PR14699 Before: template <typename T> void looooooooooooooooooooooongFunction(int Param1, int Param2); template <typename T> void looooooooooooooooooooongFunction( int Paaaaaaaaaaaaaaaaaaaaram1, int Paaaaaaaaaaaaaaaaaaaaram2); After: template <typename T> void looooooooooooooooooooooongFunction(int Param1, int Param2); template <typename T> void looooooooooooooooooooongFunction(int Paaaaaaaaaaaaaaaaaaaaram1, int Paaaaaaaaaaaaaaaaaaaaram2); llvm-svn: 171388
2012-12-21Temporary fix of tests to make buildbots happy.Daniel Jasper1-1/+1
Permanent solution coming up after checking back with Fariborz/Douglas. llvm-svn: 170887
2012-12-20Add objective-C style formatting to clang format andFariborz Jahanian1-1/+1
use it to format xml declaration tags. // rdar://12378714 llvm-svn: 170727
2012-12-05Testing C++ declarations embedded inFariborz Jahanian1-1/+1
<declaration> tag of Comment XML. Added DeclPrint support for constructors and fix tests accordingly. This is wip. // rdar://12378714 llvm-svn: 169412