Skip to content

Commit

Permalink
clang: Disable source order sorting for now. (#2558)
Browse files Browse the repository at this point in the history
* clang: Clean up source order sorting.

This doesn't change behavior but is easier to debug and reason about
(because you have the relevant cursors there).

* clang: Disable source order sorting for now.

This disables (hopefully temporarily) source order sorting, for causing
correctness regressions like #2556.

Fixes #2556.

* tests: Add a test for #2556

* Remove merge artifact

* Update clang.rs

---------

Co-authored-by: Christian Poveda Ruiz <31802960+pvdrz@users.noreply.github.com>
  • Loading branch information
emilio and pvdrz committed Jun 15, 2023
1 parent adba49e commit c14e53e
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 86 deletions.
2 changes: 1 addition & 1 deletion bindgen-tests/tests/expectations/tests/allowlist-file.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions bindgen-tests/tests/expectations/tests/issue-2556.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindgen-tests/tests/expectations/tests/jsval_layout_opaque.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions bindgen-tests/tests/expectations/tests/layout_arp.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions bindgen-tests/tests/expectations/tests/layout_array.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions bindgen-tests/tests/expectations/tests/layout_eth_conf.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindgen-tests/tests/expectations/tests/namespace.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions bindgen-tests/tests/headers/issue-2556.h
@@ -0,0 +1,4 @@
// bindgen-flags: --enable-cxx-namespaces -- -x c++ -Itests/headers -include tests/headers/issue-2556/nsStyleStruct.h -include tests/headers/issue-2556/LayoutConstants.h

#include "issue-2556/nsSize.h"
#include "issue-2556/nsStyleStruct.h"
7 changes: 7 additions & 0 deletions bindgen-tests/tests/headers/issue-2556/LayoutConstants.h
@@ -0,0 +1,7 @@
#include "nsSize.h"

namespace foo {

static constexpr nsSize kFallbackIntrinsicSize(0, 0);

}
6 changes: 6 additions & 0 deletions bindgen-tests/tests/headers/issue-2556/nsSize.h
@@ -0,0 +1,6 @@
#pragma once

struct nsSize {
int width, height;
constexpr nsSize(int aWidth, int aHeight) : width(aWidth), height(aHeight) {}
};
3 changes: 3 additions & 0 deletions bindgen-tests/tests/headers/issue-2556/nsStyleStruct.h
@@ -0,0 +1,3 @@
#pragma once

#include "nsSize.h"

0 comments on commit c14e53e

Please sign in to comment.