forked from rust-lang/rust-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sorting the output semantically (rust-lang#2254)
Generated code needs some sorting in a way that is semantically appealing. The request[1] asks for basic sorting like "types are declared first, then all structs, then all consts, then all function signatures, etc. [1] rust-lang#1743 Signed-off-by: Amanjeev Sethi <aj@amanjeev.com> Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com> Co-authored-by: Darren Kulp <darren@kulp.ch>
- Loading branch information
1 parent
b4a2adb
commit 2d7dc08
Showing
9 changed files
with
297 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// bindgen-flags: --sort-semantically -- --target=x86_64-unknown-linux | ||
|
||
int foo(); | ||
typedef int number; | ||
int bar(number x); | ||
struct Point | ||
{ | ||
number x; | ||
number y; | ||
}; | ||
struct Angle | ||
{ | ||
number a; | ||
number b; | ||
}; | ||
int baz(struct Point point); | ||
const number NUMBER = 42; |
Oops, something went wrong.