From f538a91dbca417e694c0800091ea2398afd7b8c5 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Mon, 4 Sep 2023 20:36:18 -0400 Subject: [PATCH 1/4] Add typos workflow --- .github/workflows/test.yml | 11 +++++++++++ _typos.toml | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 _typos.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b84f5bc8f8..d78e95d26de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,20 @@ env: DOC_PATH: target/doc jobs: + typos: + name: Documentation + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Install typos + run: cargo install typos-cli + - name: Run typos + run: typos . tests: name: "LLVM ${{ matrix.llvm-version[0] }}: ${{ matrix.os }}" runs-on: ${{ matrix.os }} + needs: typos strategy: matrix: llvm-version: diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000000..39787dae0b4 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,9 @@ +[default] +extend-ignore-identifiers-re = [ + "OLT", + "toi", + "isplay", + "BVE", + "olt", + "TRE", +] \ No newline at end of file From b6464aef7d456014a0a85cf9fea953c61c31eac5 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Mon, 4 Sep 2023 20:37:32 -0400 Subject: [PATCH 2/4] Remove GEPError variant --- src/builder.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index da47b4afcd1..60301cfeadf 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -66,8 +66,6 @@ enum PositionState { pub enum BuilderError { #[error("Builder position is not set")] UnsetPosition, - #[error("GEP error: does not point to a struct or index is out of bounds")] - GEPError, #[error("Alignment error")] AlignmentError(&'static str), #[error("Aggregate extract index out of range")] @@ -1104,13 +1102,13 @@ impl<'ctx> Builder<'ctx> { let pointee_ty = ptr_ty.get_element_type(); if !pointee_ty.is_struct_type() { - return Err(BuilderError::GEPError); + return Err(BuilderError::GEPPointee); } let struct_ty = pointee_ty.into_struct_type(); if index >= struct_ty.count_fields() { - return Err(BuilderError::GEPError); + return Err(BuilderError::GEPIndex); } let c_string = to_c_str(name); From c46956e7a6e1f8d014540399ab630bb3f5bf5005 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Mon, 4 Sep 2023 20:40:38 -0400 Subject: [PATCH 3/4] Rename workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d78e95d26de..71d918db19a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ env: jobs: typos: - name: Documentation + name: Typos runs-on: ubuntu-latest steps: - name: Checkout Repo From 8da852f44b3bc5f9d9ad3ccac154eb648a942df9 Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Mon, 4 Sep 2023 21:04:30 -0400 Subject: [PATCH 4/4] Remove checkout --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 71d918db19a..777dfb823b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ jobs: name: Typos runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v3 - name: Install typos run: cargo install typos-cli - name: Run typos