| Age | Commit message (Collapse) | Author | Files | Lines |
|
Majordomo commands are deprecated as per
https://subspace.kernel.org/vger.kernel.org.html#what-happened-to-majordomo.
Signed-off-by: Changyuan Lyu <changyuan.lv@gmail.com>
Signed-off-by: Chris Li <sparse@chrisli.org>
|
|
Chris Li is back as sparse maintainer.
Signed-off-by: Chris Li <sparse@chrisli.org>
|
|
Read the Docs now requires a config file in the project top directory.
So, here it is.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Newer versions of Sphinx don't support 'None' for 'language'.
So, set 'en' as language'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Sphinx versions older than 1.7 don't need and don't support 'html_context'.
So, set 1.8 as the minimal version and remove 'html_context' from the config.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Bernhard Voelker noticed that the date in the release notes
is one year off. Fix this.
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Pseudos are untyped. It's usually OK because their type can nevertheless
be retrieved in a simple way. But it also complicates things and
worse in some cases the type is completely lost.
Tell a bit more about it in the TODO file.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
* phi-sources can only have a single user (or none)
|
|
Currently, OP_PHISOURCES have a list as member, 'phi_users',
that should link to all phi-nodes using them but:
*) phi-sources are never shared between phi-nodes
*) this list is useless because it's only created during liveness
and not used after.
So, replace the list by a simple pointer to hold the unique phi-node
using it and keep this link updated during all its lifetime.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
OP_SLICE::len is necessarily equal to the result size.
So remove this redundancy.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Now that the 'packed' attribute is parsed and propagated into
the type system, adapt the layout of structures.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
* simplification of computed gotos with 1 or 2 targets
|
|
Convert OP_SETVAL of a label into a new instruction: OP_LABEL.
There is 2 reasons to do this:
*) there is slightly less checking to be done in later phases
(since OP_SETVAL can be for labels but also strings)
*) OP_SETVAL is CSEd but this is largely useless because this
instruction is hashed on the expression's address and these
are (most) often not shared. With a separate instruction
for label expressions, their CSE is now OK because the hashing
is done on the BB.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
and instead of keeping the old name for compatibility, no it's rejected.
But well, purity of language is surely much more important than compatibility.
*long deep sigh*
So, use the new name (but it will for sure create problems when using
an older version of Sphinx).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The return type of IR instructions is stored in the field
::type of struct instruction and this struct has no space
to hold the type of the operand(s). This is not a problem
for most instructions because there is an easy way to get
the operands' type. For example, for binops both types
must be the same so they are used interchangeably.
However, for compare instructions both types can be different
and there is no easy way to get the type of the operands.
Currently, this is ignored and creates some errors. It
also blocks simplifications that need this type information.
But compares instructions need only 2 operands, there is
thus one 'slot' left. So, use this slot for the operands' type.
This solves the current errors, allows new simplifications
and has very little impact on existing code. Of course,
this type information needs now to be tracked and adjusted
whenever the operands change or an instruction is changed
into a compare.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The current tags check-output-contains/excludes/pattern are
quite powerful and the new check-output-match is easy to use
but it can be even simpler. Indeed, a lot of IR simplifications/
canonicalizations can be tested by checking that the expression
to be tested is equivalent to another one. This is less precise
than some more specific tests but:
* it's a big advantage because it's less sensitive to 'noise'
like the exact number used by the pseudos or to the results
of some new simplifications or canonicalizations
* very often, this equivalence is what really matters and not
the exact transformation.
So, add a new utra-simple-to-use tag: just ask that all functions
of the tests return the same specified value (usually 1):
check-output-returns: <value>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The current tags check-output-contains/excludes/pattern are
quite powerful, universal, but they often need 'complex' regular
expressions with escaping which make them not so nice to read.
For testing IR results, a very common pattern is:
this instruction must have this (kind of) operand.
So, make a new tag for this. It does nothing than can't be done
with done with the previous ones, on the contrary, but is much
simpler to use:
check-output-match(instruction): operand
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
A few things are now done, remove them from the list,
and add a few things that should be done.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This will be the instruction for fused multiply-add
but the motivation for it is some experimentation with
the linearization of builtins.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
A cast to union type is a GCC extension similar to a compound
literal just for union, using the syntax of a cast.
However, sparse doesn't know about them and treats them like
other casts to non-scalars.
So, teach sparse about them, convert them to the corresponding
compound literal and add a warning flag to enable/disable the
associated warning: -W[no-]union-cast.
Note: a difference between union casts and compound literals
is that the union casts yield rvalues while compound
literals are lvalues but this distinction is not yet done
in this series.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
One is a LWN article which covers sparse very well, the other
is a pdf giving a short overview of sparse.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Mainly it's removing 'sparse' from the title.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Reorganize the table of of content with user documentation first
then all documentation useful for development on sparse itself.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Better to have the information about the GIT repositories
first because I'm not sure if anyone still use the tarballs.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The vertical spacing in the generated HTML is a bit excessive
to my taste. So decrease it somehow, especially the top of lists.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
There is generous spacing in the sidebar, too generous.
So, reduce it to something more compact, which will also
allow more entries without scrolling.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The logo takes quite a bit height in the sidebar and so
pushes the table of content too much at the bottom.
Fix this by reducing the logo to 50%.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
* improve presentation of the doc, mainly the sidebar
|
|
The full URL for bugzilla is quite long and was rendered as
split into 2 lines which is quite ugly.
So, do not show the URL but simply the hyperlink's name:
"Linux kernel’s bugzilla for sparse".
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Use 'https' instead of 'http' for pages needing some level of trust.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The documentation for submitting patches has ": the sparse version"
is in its title. This is quite useless and makes it longer than
needed.
So, remove this part from the title.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
since the development isn't done on github, the link "edit on github"
is useless and confusing.
So remove this link (but leave the one "View page source" as it's
sometimes quite handy).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
It's very useful to be able to access the index from the sidebar
but no change in the configuration seems to allow this. Trying
to abuse the toctree give the same result.
So, add it directly via the template system.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Combine the 'user' documentation with the one for developers
and add captions for each sections in order to have this
structuration visible in the sidebar.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The nocast-vs-bitwise document was copied here to be sure
to remain accessible but isn't really useful here now because:
1) the original document have also been archived to lore.kernel.org
2) nocast & bitwise have now been documented
3) 2) contains a link to 1)
So, remove this redundant document.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
First try at documenting sparse's extensions to C's type system.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Update the release notes with the changes since v0.6.2-rc1.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add some info about:
* how to get sparse
* how to install it,
* the mailing list and how to report bugs.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The generated documentation used Sphinx's classic/default theme
but the one from readthedocs ('rtd', the same as used for the kernel)
looks nicer, especially in the sidebar, and is not as large.
So, for now, switch to the 'rtd' theme.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
One of the item wasn't even grammatical. Reformulate it.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Literal text was marked with ``` but that's a bit excessive.
Fix that by replacing these with ``.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Fix some silly typos.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Support for __builtin_unreachable() was added in commit
d2be323e25c3 ("teach sparse to linearize __builtin_unreachable()")
So, remove this item from the TODO list.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The releases notes of the versions previously released
are stored on the wiki.
Copy them here too (with minimal changes in the markup),
so that everything is centralized here.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The wiki has a small introduction but there is none here.
So, copy this introduction from the wiki into the entrypoint
of the documentation (and convert the wikimedia markup
into restructuredtext).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Because of the changes needed after the removal of the obsolete
sphinx.ext.autodoc.AutodocReporter, the minimal version of Sphinx
is 1.7 (the first one containing switch_source_input()).
So, update this information in the conf file.
Fixes: b741a793e63c0fd4a333cd575ac2339f5a9b2698
Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The small code example at the top was in normal text-style
(which is fine) but was lacking the newline between the two
statements (which is much less fine).
Fix this by using a '::' instead of a ':' to trigger the
literal-code-block-and-more style.
Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The html-generated version of the release notes looked
terrible because the used indentation was too small.
Fix this by indenting the sublists by 4 instead of 2
Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
With the configured theme, 'classic', the table of contents
didn't show up in the sidebar.
It seems it was because 'html_sidebars' was partially set in
conf.py, overhidding the theme defaults.
Fix this by removing 'html_sidebars' from the config.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently, the release notes are kept on the wiki which
contains nothing else but a small intro.
The docs are certainly as good as this wiki to keep these
release notes. So, let try this for now.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The documentation about the documentation is in the middle of the
documentation about sparse itself.
Move it to its own section.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Sparse's type system, or more exactly the way types are encoded
in Sparse's data structures, is not hard but is also not exactly
immediate to grok.
Here is a modest attempt to document this.
The corresponding generated documentation can be find at:
https://sparse.docs/kernel.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
It seems that Markdown is now parsed slightly differently and
now generate some warnings.
So tweak the .md files to shut up the warnings.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
sphinx.ext.autodoc.AutodocReporter is obsolete since Sphinx 1.7
and removed in some later versions.
So, replace it by the code suggested in the release notes when
it was obsoleted.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Both operands of integer & floating-point binops are described as
being '.src1' but, of course, the second one should be '.scr2'.
Fix the typo.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The Documentation directory contains a 'project ideas' document.
But some of the entries there are outdated, some are questionable
and some more are simply not clear about the problem or the goal.
Some important entries are also missing.
So, remove what's needed to be removed, reformulate unclear
entries and add a bunch of new things that should be done.
Also, rename the file to 'TODO.md' as this express more clearly
the intent of the document.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
* fix linearization/SSA when missing a return
* fix linearization/SSA of (nested) logical expressions
|
|
If linearize_symbol() is called, it's meaningless to disable
linearization. As such, linearization was not really considered
as a pass. More exactly, there is no '-flinearize...' flag since
-flinearize-enable & -flinearize-disable are both meaningless.
However, -flinearize=last can be very useful for testing. So,
recognize 'linearize' as a pass and leave -flinearize-{en,dis}able
without effect.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
OP_SYMADDR take a single operand 'symbol' but this instruction
is very much like other unops and using the same operand's name
allow to avoid some special cases.
So, s/symbol/src/ for OP_SYMADDRs.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
* do 'classical' SSA conversion (via the iterated dominance frontier).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The documention of each simplications is quite dense and
use some implicit conventions for its notation.
Document this notation.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
ReST requires a blank line to start a list.
This is a bit annoying for the internal documentation because
this makes, IMO, things less readable in the code.
Tweak the documentation extraction tool to automatically insert
these blank lines (between a line ending with ':' and the next one
if not empty).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Each bloc-comment is entered in the view list as a single multiline
plus a final blank line. This is more complicated than needed and it's
useless to first concatenate these lines to split them directly after.
Also it makes harder to correctly track the line numbers.
Fix this by adding the lines one by one, each with their own lineno.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
So, it's possible to use the flag '-vdomtree' to dump the
domonance tree.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Just use the flag '-vpostorder' to dump the links once calculated.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Now that these instructions are not generated anymore,
we can remove all related code, defines and doc.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Casts to integer used to be done with only 2 instructions:
OP_CAST & OP_SCAST.
Those are not very convenient as they don't reflect the real
operations that need to be done.
This patch specialize these instructions in:
- OP_TRUNC, for casts to a smaller type
- OP_ZEXT, for casts that need a zero extension
- OP_SEXT, for casts that need a sign extension
- Integer-to-integer casts of the same size are considered as
a NOPs and are, in fact, never emitted.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently casts from pointers can be done to any integer type.
However, casts to (or from) pointers are only meaningful if
it preserves the value and thus done between same-sized objects.
To avoid to have to worry about sign/zero extension while doing
casts to pointers it's good to not have to deal with such casts.
Do this by doing first a cast to an unsigned integer of the same size
as a pointer and then, if needed, doing to cast to the final type.
As such we have only to support pointer casts to unsigned integers
of the same size and on the other hand we have the generic
integer-to-interger casts we to support anyway.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently all casts to pointers are processed alike. This is
simple but rather unconvenient in later phases as this
correspond to different operations that obeys to different
rules and which later need extra checks.
Change this by using a specific instructions (OP_UTPTR) for
[unsigned] integer to pointers.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently casts to pointers can be done from any integer types.
However, casts to (or from) pointers are only meaningful if value
preserving and thus between objects of the same size.
To avoid to have to worry about sign/zero extension while doing
casts to pointers it's good to only have to deal with the value
preserving ones.
Do this by doing first, if needed, a cast an integer of the same
size as a pointer before doing the cast to a pointer.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently all casts to pointers are processed alike.
This is simple but rather unconvenient as it correspond to
different operations that obeys to different rules and
which later need extra checks.
Change this by using a specific instructions (OP_UTPTR) for
unsigned integer to pointers.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently, casts from floats to integers are processed like
integers (or any other type) to integers. This is simple but
rather unconvenient as it correspond to different operations
that obeys to different rules and which later need extra checks.
Change this by directly using specific instructions:
- FCVTU for floats to unsigned integers
- FCVTS for floats to signed integers
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently, all casts to a floating point type use OP_FPCAST.
This is maybe simple but rather uncovenient as it correspond
to several quite different operations that later need extra
checks.
Change this by directly using different instructions for the
different cases:
- FCVTF for float-float conversions
- UCVTF for unsigned integer to floats
- SCVTF for signed integer to floats
and reject attempts to cast a pointer to a float.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The -vcompound wasn't documented.
Fix this by adding a very short description for it.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
|
|
This will merge the following topic branches:
* builtin-dyn:
Expansion of macros like __FILE__, __DATE__, ... must, contrary
to usual macros, be done dynamically.
This series improves support for them:
- consider them as defined (like GCC do)
- use table + method for their expansion (avoid useless compares)
- add support for __INCLUDE_LEVEL__ & __BASE_FILE__
* builtin-predef:
Add a function: predefine() which allow to directly add
the definition of a simple macro (without args and with
a single number or ident as definition).
Also do the conversion of the concerned predefined macros
and some cleanups.
* builtin-overflow:
Add support for builtins doing overflow checking.
* has-builtin:
Add support for the __has_builtin() macro.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The sparse API is more important than the details about the IR.
So move the API doc before the IR doc.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add small helpers for copying a memory buffer or a string
into a newly allocated buffer.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The doc for IR instructions used definition lists to structure
the instructions names and their description. This is simple
to write and present well but it doesn't put the instructions'
name in the index.
Fix this by adding a new domain, with a single directive 'op'
which takes the instruction name, inserts an index entry and uses
it for the definition.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The doc for IR instructions was written in MarkDown format which
is quite easy and quite close to normal text.
However Markdown has a few limitations:
1) structuration via level-x headings is not nice when rendered
2) it would be nice to have the instructions in the index
So convert this in reStructuredText format as it will
directly solve problme 1) and prepare to solve problem 2)
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Short descriptions are good but sometimes you can't describe
thinsg well enough with a single line.
So, add support for multi-line descriptions.
The additional lines need to be indented with a tab to be
recognized as such.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Syntax highlighting is great for code but by default sphinx
consider literal sections as code and will thus hightlight
every python keyword ('is', 'and', 'or', ...).
It's quite annoying.
So disable default syntax highlighting, real piece of code
can still be nicely hightlight by using a 'code-block':
.. code-block:: c
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add some documentation about the autodoc support and the
syntax to use for API documentation embedded into the code.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The syntax for a parameter is '@<name>'. Let also use this when
referencing a parameter name in another section (other parameters
or long description) and mark these references in bold (the same
as the parameters themseelves are presented).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Use the doc added to ptrlist.c as an example/base for
API documentation.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add a sphinx extension for the c:autodoc directive which will
extract the doc and inject it into the document tree.
This part is based on Jani Nikula's project: hawkmoth [1]
which has exactly the same goal as this series but which
use clang to parse the C code and extract the bloc-coments.
[1] https://github.com/jnikula/hawkmoth
Based-on-work-by: Jani Nikula <jani@nikula.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The extracted doc can't be used as is by sphinx as it needs
to have some additional annotations.
Convert the extracted doc into a true reST format wich can
directy be used by sphinx.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Add a tool which parse comment from source files and
extract kerneldoc-like documentation from them.
Note: this is rather quite crude, support only generic 'blocs'
and doc for functions; it has no support for anything else.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
MarkDown is really nice and easy to get something quickly but
for manpages, the rendering is not really nice and lack index entries.
reST has a special syntax for option lists but:
1) not all option syntax are recognized (for example when we use [xyz] to
to show that xyz is optionnal).
2) when converted to HTML, a table is used for the list but:
* options that are too long break the presentation
* unrecognized options break the table
3) the options are also not put in the index
Solve this by using reST with '.. option::' directives.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The file dev-options.md contains the description for extra
options not useful for sparse itself and its users but well
to sparse's developers and for tools like test-linearize.
Since it's a complement to the main man-page, format it at such.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The file 'sparse.txt' contains some explanation about the
differences between the attributes 'nocast' and 'bitwise'.
It's valuable information.
So convert it to markdown syntax and rename it to a more
self-explanatory name.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The current support for markdown source files is fine
for py2-sphinx but not for py3.
Fix it by checking python's version and add the reference
to the mardown parser module accordingly.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
This doesn't change much but allows to be a bit more lazy and
write
.. <directive>::
.. code-block::
instead od
.. c:<directive>::
.. code-block:: c
I understood that this should also show in the index "... (function)"
instead of "... (C function)" but this doesn't seems to be the case.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Documentation generated by sphinx reference the version of the
project being documented. This version need to be specified via
sphinx's config file.
However, if this version number is simply added there, it's
guaranteed that soon or later it will be out-of-synch with git's
version tag (or the version number present in the Makefile).
Fix this by trying to read the version from git or, if this fails,
from the Makefile.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Sphinx allow to set the copyright date; I would hate to have
to update this every year, so let generate it automatically.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
A logo is always nice fot a project, so add one.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
With this we can generate HTML for the docs in this directory.
For the moment, more as an experiment as anything else, this
doc is available at http://sparse-doc.rtfd.io
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
To have proper entris in the index pages, we need to use headings
consistently.
Fix the few headings that used some headings non-consistent with
the others.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Ideally, the testcases should be universal but it happen than
some of them need to test some specificities or are meaningless
or plainly wrong in some situations. In such cases, these tests
must but ignored.
Currently, the only the only mechanisms a test are:
1) ignoring the tests depending on a tool which cannot be compiled
(like, for example, those using sparse-llvm when LLVM is not
installed.
2) some rather corse criteria using the name of the arch used
to run the tests.
Allow more flexibility by allowing to exclude some tests based on
the success or failure of an arbitrary condition via _Static_assert().
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Ideally, the testcases should be universal but it happen than
some of them need to test some specificities or are meaningless
or plainly wrong in some situations. In such cases, these tests
must but ignored.
Currently, the only the only mechanisms a test are:
1) ignoring the tests depending on a tool which cannot be compiled
(like, for example, those using sparse-llvm when LLVM is not
installed.
2) some rather corse criteria using the name of the arch used
to run the tests.
Allow more flexibility by allowing to exclude some tests based on
the evaluation of some pre-processor expression at test-time.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The flags -ventry & -vdead were not documented.
Fix this now by adding a small explanation.
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The purpose of the file 'options.md' was rather vague.
Make it now explicit that it's to document options
useful for development.
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
In struct instruction, .target is normally used to hold
the result. Its value is thus produced/defined by instructions.
However, OP_COMPUTEDGOTO use .target as an input. This
creates slight complications for code, like liveness analysis,
which care about which fields are used and which are defined
by the instructions.
Change this by letting OP_COMPUTEDGOTO use .src for its
operand instead of .target.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
In struct instruction, .target is normally used to hold
the result. Its value is thus produced/defined by instructions.
On the contrary, .cond is used as an input value and is
thus used by instructions.
However, these two fields belong to the same union. This
creates slight complications for code, like liveness analysis
which care about which fields are used and which are defined
by the instructions.
Change this by unionizing .cond with .src, .src1 & friends instead
of with .target.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Some of the IR instructions have been defined but are
never generated.
Remove them as they have no purposes.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
No instructions have an opcode set to OP_[LS]NOP anymore
so we can now remove all remaining traces of these opcode.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Currently, we have OP_MULS & OP_MULU but unless it's full,
widening multiplication both must give exactly the same
result (the world run on 2's complement CPUs now, right?).
Also, the IR doesn't have widening multiplication but
only instruction where both operands and the result have
the same size.
So, since theer is no reasons to keep 2 instructions,
merge OP_MULS & OP_MULU into a single one: OP_MUL.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
|
|
Fix typos, grammar, punctuation, and spelling in Documentation/test-suite.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Make this file easier to read by removing the name at the beginning
of each line.
Put its source and attribution at the beginning of the file.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
OP_SETVAL is used to create floating-point and string
as well as labels-as-values. This multi-purpose aspect
sometimes make things a bit more complicated.
Change this by using a new instruction for the direct
creation of floating-point literals without needing
to have an intermediate EXPR_FVALUE.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Floating-point arithmetic is quite different from the
arithmetic on integers or the one of real numbers.
In particular, most transformations, simplifications that can
be done on integers are invalid when done on floats.
For example:
- associativity doesn't hold
- distributivity doesn't hold
- comparison is tricky & complex
This is because (among others things):
- limited precision, rounding everywhere
- presence of signed zeroes
- presence of infinities
- presence of NaNs (signaling or quiet)
- presence of numbers without inverse
- several kind of exceptions.
Since they don't follow the same rules as their integer
counterpart, better to give them a specific opcode
instead of having to test the type of the operands at
each manipulation.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Comparision of floating-point values can't be done
like for integral values because of the possibility to have
NaNs which can't be ordered with normal values or even between
themselves.
The real difference appears once there is any "reasoning"
done with the result of the comparison. For example, once NaNs
are taken in account: "!(a < b)" and "(a >= b)" are not the same.
In fact the usual comparison operators must be reinterpreted
as implicitely first testing if any of the operand is a Nan
and return 'false' if it is the case. Thus "a < b" becomes
"!isnan(a) && !isnan(b) && (a < b)".
If we need to negate the comparison we get "!(a < b)" which
naturally becomes "isnan(a) || isnan(b) || (a >= b)".
We thus need two sets of operators for comparison of floats:
one for the "ordered" values (only true if neither operand
is a Nan) and one for the "values" (also true if either
operand is a NaN). A negation of the comparison switch from one
of the set to the other.
So, introduce another set of instructions for the comparison
of floats.
Note: the C standard requires that:
*) "x == x" is false if x is a NaN,
*) "x != x" is true if x is a NaN,
and this is coherent with "x != x" <-> "!(x == x)".
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
The old syntax is kept for now to avoid too much conflits
in pending branches.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
gmane.org was shut down for awhile, then bought by someone else,
and is now being rebuilt. Links to it are not reliable for now,
so add a link to marc.info for the same email message.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Adding project ideas to improve sparse.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Reference to the linux kernel patches submitting process
and difference to sparse.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Tests taking a huge or infinite amout of time is
a problem for the testsuite. Furthermore, it's most
often the sign of a problem somewhere.
Fix this by adding some support to use an optional
timeout for each testcase command.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
Complement the 'check-output-contains/excludes' tags to also
be able to specify the number of times a given pattern should
occurs in the output.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Currently the test suite always check the exit value and the output
of the command used for the test. This is fine and allow use to catch
the most common situations:
- failure or crash (via the exit value)
- (un)expected output (like when testing the result of the preprocessor)
- (un)expected errors & warnings (like when testing sparse's warnings)
But sometimes, we're not interested in the output as such because it
can't be compared textually to some reference. This occurs systematically
when testing the output of test-linearize or test-unssa which emits
labels names which are in fact pointer values and which exact output
is very sensitive to any change in processing order, optimizations, ...
But useful tests can be easily made by just checking for the presence
or absence of some identifiers, or more generally some patterns.
This patch allow to do that by adding support for two new tags
(check-output-contains & check-output-excludes), telling to test suite
to verifiy that the given patterns are effectively present ot absent
from the output of the tested file.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Currently the test suite always check the exit value and the output
of the command used for the test. This is fine and allow use to catch
the most common situations:
- failure or crash (via the exit value)
- (un)expected output (like when testing the result of the preprocessor)
- (un)expected errors & warnings (like when testing sparse's warnings)
But sometimes, we're not interested in the output or the output (as is)
is simply not meaningful for the test or can't be compared textually
to some reference.
This patch add two new tags (check-output-ignore & check-error-ignore),
telling to test suite to ignore the content of stdout or stderr when
testing this file.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
relevant content, and created Documentation/sparse.txt with the
complete comparison between __nocast vs __bitwise.
Signed-off-by: Shakthi Kannan <shakthimaan@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Describes most data srtructures used in sparse.
|
|
Signed-off-by: Josh Triplett <josh@freedesktop.org>
|
|
A quick description of test-suite usage.
Signed-off-by: Damien Lespiau <damien.lespiau@gmail.com>
|