isl_ast_build_node_from_schedule: improve handling of isolation
[isl.git] / doc / CodingStyle
blob098ab66c484ed5483d846928a79c33b2d038f955
1 This document describes some aspects of the coding style of isl,
2 which is similar to that of the linux kernel and git.
4 The general rule is to use the same style as that of the surrounding code.
6 More specific rules:
7         - every line should have at most 80 columns
8         - use tabs for indentation, where a tab counts for 8 characters
9         - use single spaces around binary operators such as '+', '-', '=', '!='
10         - no space after unary operators such as '!'
11         - use a single space after a comma and a semicolon
12           (except at the end of a line)
13         - no space between function name and arguments
14         - use a single space after control keywords such as if, for and while
15         - no whitespace at the end of a line
16         - opening brace of a function is placed on a new line
17         - opening brace of other blocks stays on the same line
18         - the body of a control statement is placed on the next line(s)
19         - no parentheses around argument of return keyword
20         - use only C style comments (/* ... */)
21         - no comments inside function bodies;
22           if some part of a function deserves additional comments, then
23           extract it out into a separate function first
25 There are some exceptions to the general rule of using
26 the same style as the surrounding code, most notably
27 when the surrounding code is very old.
28 In particular, an "isl_space" used to be called "isl_dim" and
29 some variables of this type are still called "dim" or some variant thereof.
30 New variables of this type should be called "space" or a more specific name.
31 Some old functions do not have memory management annotations yet.
32 All new functions should have memory management annotations,
33 whenever appropriate