| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We pass the size_t of an std::vector to a clang function taking an
int as an argument, which on MSVC resulted in
warning C4267: 'argument': conversion from 'size_t' to 'int',
possible loss of data
To fix this, cast explicitly.
Change-Id: I3636f7ced600c387c678aa59012274db490d8f8d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This update fixes a bug caused by reusing an index varible
name declared in an outer loop in an inner loop, which made
qdoc crash in one case.
Change-Id: I27abb4ea3241be620c8c226732e83ef42b575da9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that clang-qdoc uses clang to parse the \fn commands,
it must handle the QPrivateSignal flag correctly. It is not
allowed in the signature in the \fn command. This update
corrects a bug where the expected number or parameters was
being reduced by 1 because the flag appeared in the declaration
in the include file.
Change-Id: I1c974100b2017b3058040937a03500a75dc69d82
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This change replaces the last uses of qdoc's old, ad hoc
C++ parser. Clang is now used for parsing all C++ code.
\macro, \qmlxxx, and \jsxxx commands are parsed by simple
pattern matching functions using QString::split().
Change-Id: If6f95b0487d1dd3206373bc55ec8e6b8b9c55b1e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
| |
qdoc now uses clang to parse \fn commands. It even handles the multiple
\fn case.
Change-Id: I259fcdfc1bf180d32ef1cc9886a48aa3006e18fb
Reviewed-by: Martin Smith <martin.smith@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This change replaces two uses of QRegularExpression
with a simple ad hoc parser. qdoc is not allowed to
use QRegularExpression because it is not in the
bootstrap library.
Task-number: QTBUG-62845
Change-Id: Icfaca2181ff1879f02d111626a85fb3da758c731
Reviewed-by: Martin Smith <martin.smith@qt.io>
|
|
|
|
|
|
|
| |
clangcodeparser.cpp:1025:39: error: no match for ‘operator+=’ (operand types are ‘QByteArray’ and ‘QChar’).
Change-Id: Ibc6fa1f11996e9ab5805b85b3165da3b1d7b2afb
Reviewed-by: Martin Smith <martin.smith@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is a partial fix for the multi-\fn documentation concept.
It outputs the documentation once but listing all the function signatures
from the \fn commands found in the qdoc comment.
Multiple \since commands are not implemented; the \until command is not
implemented, and providing text applicable to a specific \fn signature is
not implemented.
This change requires clang, which means it requires a sequence of other
updates as well, so you can't test it unless you have all that stuff.
Task-number: QTBUG-60420
Change-Id: Ib316b6f97fa427ef730c4badfc785101bff55dce
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qdoc doesn't need to see declarations of anonymous structs.
When it does see one inside a class or struct that is named,
then the html generator tries to overwrite the html file for
the outer class or struct. That causes a few qdoc error
messages and it overwrites the html file for the class
reference page and the all-members page. This update tells
clang not to visit the declaration of the anonymous struct,
so the html generator doesn't see it as something to be
documented.
Change-Id: Ie8c732e650c39f78c1374523d72a7e0448a31ba3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When clangqdoc encounters an unnamed enum type in a class,
qdoc reports an error that enum type "global" is not found
in any header file, and then the identifiers in the enum
type can't be properly documented. This change makes the
clang qdoc visitor name the unnamed enum type "anonymous"
and allows it to be documented like a named enum type.
Change-Id: I8b6dbc9bb78adc5f5c39a2a2d73c27ccb4543ceb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
moduleheader is a new config variable you can add to the
qdocconf file when the name of the module header file for
your module is different from the project name. When the
name of the module header file is different from the
project name, if you don't tell qdoc what the name of the
module header file is by setting moduleheader in the
qdocconf file, then clangqdoc will not find the module
header file to build the precomiled header with, which
will result in clang not finding a lot of stuff.
Change-Id: I0da1a0b0be05cb9e6e95e0123583ddeedaf6741d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
| |
These messages don't come from the warning() function
in class Location, so each one must have (qdoc) added.
Change-Id: Id49b979f8b051d8f4661fb3214989c9c959121c6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This update makes qdoc parse and record the presence of
ref qualifiers on the end of function declarations. It
unfortunately increases the number of qdoc errors
reported in QtBase, but that is because these functions
are not documented correctly. There will be another
update to qdoc to allow documenting multiple functions
with a single comment, which is needed for documenting
these ref qualified functions but also can be useful in
other contexts.
Change-Id: If2efb1a71c683a465d66608a20e238d84ea45d9a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PCH for module QtPlatformHeaders was not being built
because there are no .cpp files there, and clangqdoc was
only building the PCH when it was asked to parse the first
.cpp file. Now it builds the PCH by a direct call from the
main.cpp file, after the headers have been gathered into a
list, but before the .cpp files are parsed.
This does reduce the qdoc error count by a few, but it does
not fix the documentation for QtPlatformHeaders. From my
debugging, it appears that visiting the PCH produces no qdoc
nodes for the C++ classes and functions, etc in the PCH.
This update also improves the selection of default include
paths when inadequate include paths are provided. That is
the case for module QtPlatformHeaders, where no include
paths are provided. The algorithm for constructing a list
of reasonable guesses is modified here.
Change-Id: I0dee8dc0279894a4482df30703657558cdb098de
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
clangqdoc now handles the type alias declaraction and provides
the \typealias command for documenting it. It is documented as
a typedef.
Task-number: QTBUG-58158
Change-Id: Iee0c8dea66026a89b3625b40b92b056cada893c1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clangqdoc was unable to find base class nodes,
when the base class node was in a different module
from the subclass. This was mostly because the
fixInheritance() function, which handles base class
resolution after the headers have been parsed, was
being called before the headers were parsed. This
was caused by the new parsing strategy for clangqdoc,
which is to use the old loop where qdoc used to parse
the header files only to build up a list of all the
required header files and to delay parsing the header
files until clang is called to build the PCH.
The basic fix is to mode the call to resolveInheritance()
from main.cpp into clangcodeparser.cpp right after the
PCH is built. There are also a few other minor changes
in this change that make the base class resolution more
robust by ensuring that as much useful information as
possible is retained in the index file and in the base
class list for a class node.
Change-Id: I51433f618cdf40b37b0687ff1686da03359de111
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
clangqdoc was unable to tie qdoc comments to their
function declarations for nested classes, when the
function had a formal parameter of the nested class
type. The problem was that findNodeForCursor() didn't
handle the type name scoping correctly.
Change-Id: I64d81377193447b1af73ecd107f0431fac0d81a7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have the class declaration for QMetaObject::Connection
in qobjectdefs.h, which is outside the declaration for
QMetaObject. clangqdoc wasn't handling this correctly. It
created the class node for Connection with the wrong parent.
This update ensures that the class node for Connection is given
the class node of QMetaObject as its parent. If the semantic and
lexical parent cursors of the current cursor are not the same,
find the Aggregate node for the semantic parent cursor and use
that node as the parent when the new class node is created.
Change-Id: I40f73dad9879e39452f83bb7c0f514a7ef319208
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
| |
(Requires clang 4.0)
Change-Id: I50240f0e4b9f538c65dbaa0e8d08469676ac9012
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change enables clangqdoc to identify copy constructors,
move-copy constructors, copy-assignment operators and
move-assignment operators. Identifying these special member
functions allows clangqdoc to document them automatically
if the documentation is missing, which also means fewer qdoc
error reports.
Change-Id: Ic50822c2939f0a84e707a1b3ff946bc731a0bd85
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows qdoc to avoid printing warnings about
a qdoc comment, if the comment contains the \internal
command. In these cases, the comment will not be
used in the documentation, so there is no point reporting
warnings about it. However, if the showinternal option is
used, warnings about comments marked internal are printed
anyway.
Change-Id: Idcb329958681523c79e9f6a3a144ae26d44a6906
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The qdoc 'defines' config variable lists values
that contain '*' to represent wildcards, but clang
doesn't accept them. This change adds a new config
variable called 'clangdefines' which explicitly
lists all the defines that match the wildcards.
It also lists several Qt defines for C++11 stuff,
because when clangqdoc comes into use, all the
supported compilers for Qt will support C++11
constructs.
There might be a few defines listed in clangdefines
that are unnecessary and maybe a few that we really
should not include, but we can adjust the list as
needed.
Also included in this change: Tell clang never to fail
(i.e. keep parsing no matter how many errors are found),
and tell clang not to print parsing errors, because they
obscure the qdoc errors in the output. clangqdoc should
assume that the source files are correct, but some of the
include files, especially system level stuff, will not be
present. clangqdoc doesn't care about these missing files,
because they aren't part of the documentation.
Change-Id: I84e1cae24d961a82d16ee705333d6f36955d35de
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Including the module's private headers in the PCH
database can reduce the qdoc run time for the module
by a few minutes. Apparently, including the private
headers significantly reduces the number of header
files that must be re-parsed.
This change adds the module's private headers to the
pre-compiled header database. When it finds the module's
module header, it copies that module header to the
temporary directory where it will construct the PCH.
Then it finds the module's private header subdirectory,
constructs the path to each header in that directory,
and appends it to the temporary module header. Then
it passes this augmented module header to clang to
construct the PCH.
Change-Id: Ie67485c7070ef7487345db90a8b27c64f5caa0f2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
The file qt_find_clang.prf is inspired by qtcreator's clang_installation.pri.
The code from the while loop in ClangVisitor::parseProperty contains code
moved from CppCodeParser::matchProperty. The code in the for loop of
ClangCodeParser::parseSourceFile (from the "Doc parses the comment"), is mostly
moved from CppCodeParser::matchDocsAndStuff.
In CppCodeParser, most of the code is removed since clang is used for parsing.
We just need to leave enough to parse the declaration in the comments which
still use the old parser (\fn, ...)
Known issues:
- When the parameter name is a comment, it is lost.
(e.g. QObject::eventFilter(QObject * /* watched */, QEvent * /* event */)
- I can't compute default parameters when they are expanded from a macro.
(e.g. QObject::tr)
- Instances of #ifndef Q_QDOC need to be reviewed
Change-Id: I92d4ca4fc52810d9d3de433147a9953eea3a1802
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|