Skip to content

Rebase #1740 upon master #2229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2a247bf
Revert "Introduce extent to ClangToken"
kulp Jun 17, 2022
fb8b89a
Implement enum_val_boolean in terms of unsigned
kulp Jun 24, 2022
7de1898
Initial implementation of clang tooling API
rinon Feb 15, 2020
efa7e5c
Allow visiting of more AST nodes
rinon Feb 15, 2020
3369127
Implement Eq correctly for ASTNode
rinon Feb 17, 2020
7af15e9
Do not visit initial node when visiting children
rinon Feb 17, 2020
6b4901d
Do not return attributed or paren types from clang
rinon Feb 17, 2020
07de9d8
Handle null QualTypes gracefully
rinon Feb 17, 2020
6733eff
Check for null in more ClangAST functions
rinon Feb 19, 2020
0ec3958
Return the first type that matches in getType
rinon Feb 19, 2020
5257f0a
Validate that we can lay out a RecordDecl before getting field offsets
rinon Feb 19, 2020
f0a5906
Don't visit implicit decls or CXXRecordDecl in ClassTemplates
rinon Feb 19, 2020
3f34b87
Make ClassTemplateDecl canonical for templated classes
rinon Feb 19, 2020
4043746
Remove unnecessary manual implementations of PartialEq, etc.
rinon Feb 19, 2020
4f88f60
Clean up visitors
rinon Feb 19, 2020
a23de62
Visit templated type locations
rinon Feb 19, 2020
527e9a4
Correctly report comment kinds
rinon Feb 19, 2020
74d9f9c
Visit more TypeLocs
rinon Feb 19, 2020
5a74b63
Visit CXXBaseSpecifier nodes
rinon Feb 19, 2020
6461e31
Clean up warning
rinon Feb 20, 2020
767b930
Add Attr to node and track node kinds correctly
rinon Feb 20, 2020
f1ae2c7
Build stringref from llvm::StringRef
rinon Feb 20, 2020
af68f73
Support building against latest LLVM master
rinon Feb 20, 2020
35a018f
Add support for visiting preprocessor entities
rinon Feb 20, 2020
eacb0e4
Check for valid source range before tokenizing
rinon Feb 20, 2020
604b6ff
Avoid infinite recursion when visiting decls as TypeRefs
rinon Feb 20, 2020
f2c69fd
Implement support for getDefinition on Objective-C nodes
rinon Feb 20, 2020
4ef3d0b
Add type null checks
rinon Feb 20, 2020
b27cfe0
Check that expr is not value dependent before evaluating
rinon Feb 20, 2020
d41e0c1
Clean up record validation and support validating class bases as well
rinon Feb 20, 2020
cc19082
Clean up traversal
rinon Feb 20, 2020
49658da
Validate cursor based on its own kind, not the derived kind of its node
rinon Feb 20, 2020
d4e3158
Rewrite TypeLoc traversal
rinon Feb 20, 2020
add5baf
Fix logic in Expr_Evaluate
rinon Feb 20, 2020
1a24d36
Add SourceRange getters for CXXBaseSpecifier, Attr, and PreprocessedE…
rinon Feb 20, 2020
c8d22d8
Clean up string transfer from C->Rust
rinon Feb 20, 2020
5518ee6
Adjust the end of the range given in tokenize
rinon Feb 20, 2020
efc3920
Add support for visiting children of reference cursors
rinon Feb 21, 2020
5fd0fa9
Visit type and template references in SizeOfPackExpr
rinon Feb 21, 2020
4a401b6
Visit references from template names
rinon Feb 21, 2020
9ab8ed4
Support correct spelling of objective-c decls
rinon Feb 21, 2020
5264cfa
Get correct result type for Objective-C methods
rinon Feb 21, 2020
854a448
Support Objective-C categories and references
rinon Feb 21, 2020
4eb82e7
Handle Objective-C id, class, and sel types correctly
rinon Feb 21, 2020
28394ac
Visit more Objective-C AST nodes
rinon Feb 21, 2020
0628187
Sanitize a couple more type return sites
rinon Feb 21, 2020
1917f56
Explicitly visit ObjCTypeParamDecls
rinon Feb 21, 2020
ff58971
Fix incorrect comparison for break value
rinon Feb 21, 2020
216bb08
Fix warning
rinon Feb 21, 2020
33e7454
Implement support for parsing of unsaved files
rinon Feb 21, 2020
5242a15
Use command-line args to tell preprocessor to keep detailed records
rinon Feb 21, 2020
bfb5042
Clean up build script
rinon Feb 22, 2020
36a5663
Don't try to link against LLVM FrontendOpenMP component for LLVM vers…
rinon Feb 22, 2020
85abea1
Guard OpenCLExtensionTypes for only clang version 9+
rinon Feb 22, 2020
bfd01b0
Reorganize clang interface and extract LLVM code
rinon Feb 22, 2020
305a0c4
Make clang interface compile with Clang 8
rinon Feb 27, 2020
aaa48a9
Build with Clang 7
rinon Mar 2, 2020
00f797a
Build with Clang 6
rinon Mar 2, 2020
4af1eec
Build with Clang 5
rinon Mar 2, 2020
21730f5
Build with Clang 4
rinon Mar 2, 2020
ebaa761
Move getMangling functions to libclang_compat.cpp
rinon Mar 2, 2020
98201d9
Use `mangleName`
kulp Jun 12, 2022
0b66f7b
Build with Clang 3.9
rinon Mar 2, 2020
a685e42
Build with Clang 3.8
rinon Mar 2, 2020
9176fdc
Include correct headers compatible with all Clang versions
rinon Mar 2, 2020
20e4c5f
Fix expectations for tests that now check struct field offsets
rinon Mar 2, 2020
6175639
Support getSpelling for PreprocessedEntity
rinon Mar 3, 2020
1696dc9
Move CXEvalResultKind definition for LLVM <= 3.8 into impl header
rinon Mar 3, 2020
8ea8636
Do not visit children of implicit decls unless the decl is base
rinon Mar 3, 2020
e72231a
Add doc strings
rinon Mar 3, 2020
b1685bc
Remove completed TODO
rinon Mar 3, 2020
e35f010
Add support for getting the access specifier of CXXBaseSpecifier nodes
rinon Mar 3, 2020
4ab01d0
Reimplement get_included_file_name
rinon Mar 3, 2020
d8deb55
Clean up old comments and whitespace
rinon Mar 3, 2020
a78595c
Cargo fmt modified and new files
rinon Mar 3, 2020
dac40a3
Remove outdated uses of clang_sys
rinon Mar 3, 2020
0259961
Include missing header
rinon Mar 4, 2020
db31a65
Plug memory leaks
rinon Mar 15, 2020
4992914
Fix build warning
rinon Mar 18, 2020
b5ca8eb
Include <cstdint> instead of explicitly defining types
rinon Mar 18, 2020
29077b5
Make clang interface C only to avoid C++ mangling issues
rinon Mar 19, 2020
c1a6a25
Remove old CXXFLAG
rinon Mar 19, 2020
dbc2791
Silence warning and add static asserts to validate assumptions
rinon Mar 19, 2020
d79c45f
Support building on Windows
rinon Mar 19, 2020
760139d
Build list of libraries to link against in cmake
rinon Mar 19, 2020
146cf6e
Generate dependency list from cmake for clang shared libraries
rinon Mar 20, 2020
1c165c5
Default to linking against LLVM and clang-cpp shared libs if available
rinon Mar 20, 2020
40e134d
Pass QualTypes to Rust as void* to avoid ABI issues
rinon Mar 23, 2020
5d800ea
Run `cargo +nightly fmt`
kulp Jun 24, 2022
2fa3081
Regenerate clang_interface.rs with bindgen v0.60.1
kulp Jun 17, 2022
b45a231
Implement isFunctionMacroLike in new paradigm
kulp Jun 24, 2022
db155ca
Implement isDeleted in new paradigm
kulp Jun 24, 2022
e390c5c
Update test expectations
kulp Jun 16, 2022
63815fd
XXX temporarily disable jobs while debugging CI
kulp Jun 24, 2022
bcdc4b1
XXX hide unused variables
kulp Jun 24, 2022
8a084ab
XXX Link manually against ncurses
kulp Jun 25, 2022
b2bb275
XXX env CARGO_TERM_VERBOSE=true
kulp Jun 25, 2022
6eaaf05
XXX Link manually against LLVMSupport
kulp Jun 25, 2022
3e49586
XXX force deps_file off
kulp Jun 25, 2022
c4e8dfe
XXX Introduce expectations file for clang 9.0
kulp Jun 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 5 additions & 136 deletions .github/workflows/bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,87 +9,6 @@ on:
- master

jobs:
rustfmt:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
# TODO: Should ideally be stable, but we use some nightly-only
# features.
toolchain: nightly
override: true
components: rustfmt, clippy

- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --tests

msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install msrv
uses: actions-rs/toolchain@v1
with:
profile: minimal
# MSRV below is documented in Cargo.toml and README.md, please update those if you
# change this.
toolchain: 1.57.0
override: true

- name: Build with msrv
run: rm Cargo.lock && cargo +1.57.0 build --lib

quickchecking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# TODO: Actually run quickchecks once `bindgen` is reliable enough.
- name: Build quickcheck tests
run: cd tests/quickchecking && cargo test

test-expectations:
runs-on: ${{matrix.os}}
strategy:
matrix:
# TODO(#1954): These should be run on mac too, but turns out they're
# broken.
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Test expectations
run: cd tests/expectations && cargo test

test:
runs-on: ${{matrix.os}}
strategy:
Expand All @@ -99,48 +18,16 @@ jobs:
- debian: null
cross: null
rust: null
llvm_version: ["5.0", "9.0"]
llvm_version: ["9.0"]
main_tests: [1]
release_build: [0, 1]
no_default_features: [0, 1]
release_build: [0]
no_default_features: [0]
# FIXME: There are no pre-built static libclang libraries, so the
# `static` feature is not testable atm.
feature_runtime: [0, 1]
feature_runtime: [0]
feature_extra_asserts: [0]
feature_testing_only_docs: [0]

include:
# Test with extra asserts + docs just with latest llvm versions to
# prevent explosion
- os: ubuntu-latest
llvm_version: "9.0"
release_build: 0
no_default_features: 0
feature_extra_asserts: 1
feature_testing_only_docs: 1

# FIXME: Seems installing multiarch packages fails:
#
# https://github.com/rust-lang/rust-bindgen/pull/2037/checks?check_run_id=2441799333
#
# - os: ubuntu-latest
# target:
# debian: arm64
# cross: aarch64-linux-gnu
# rust: aarch64-unknown-linux-gnu
# llvm_version: "9.0"
# main_tests: 0
# release_build: 0
# feature_extra_asserts: 0
# feature_testing_only_docs: 0

# Ensure stuff works on macos too
- os: macos-latest
llvm_version: "9.0"
release_build: 0
no_default_features: 0
feature_extra_asserts: 0
feature_testing_only_docs: 0
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -169,6 +56,7 @@ jobs:

- name: Run all the tests
env:
CARGO_TERM_VERBOSE: "true"
GITHUB_ACTIONS_OS: ${{matrix.os}}
RUST_CROSS_COMPILER: ${{matrix.target.cross}}
RUST_TARGET: ${{matrix.target.rust}}
Expand All @@ -180,22 +68,3 @@ jobs:
BINDGEN_FEATURE_TESTING_ONLY_DOCS: ${{matrix.feature_testing_only_docs}}
BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}}
run: ./ci/test.sh

test-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

# NOTE(emilio): Change deploy-book as well if you change this.
- name: Test book
run: |
curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar xz
./mdbook build book
./mdbook test book
16 changes: 16 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ clap = "3"
shlex = "1"
tempfile = "3"

[build-dependencies]
cmake = "0.1"

[dependencies]
bitflags = "1.0.3"
cexpr = "0.6"
Expand Down
Loading