aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2022-02-24Add support for index lang item overloadsPhilip Herron4-0/+75
This reuses our code to resolve operator overloads to call into the index lang item for the array-index-expression this serves as a basis for supporting slices. Fixes #975
2022-02-24Decouple the HIR::OperatorExpr from resolving operator overloadsPhilip Herron5-4/+34
This means we can reuse the same code for operations that are not HIR::OperatorExpr's such as ArrayIndexExpr which can resolve to core::ops::index lang items.
2022-02-24Refactor operator overloading code into cc filePhilip Herron2-185/+187
2022-02-24Cleanup error handling on array index expression type resolutionPhilip Herron2-19/+18
2022-02-24Fix ICE as infered is nullptr at this pointPhilip Herron1-2/+1
2022-02-24Add index and index_mut lang item mappingsPhilip Herron1-0/+16
2022-02-24Refactor ArrayIndexExpr typechecking into cc impl filePhilip Herron2-46/+48
2022-02-24Add boilerplate for the new SliceTypePhilip Herron12-0/+360
2022-02-24Refactor ArrayIndexExpr code into implementation cc filePhilip Herron2-30/+32
2022-02-24Add code generation for range expressionsPhilip Herron3-0/+149
2022-02-24Fix TyTy::ADTType is_equals to always check the variants for equalityPhilip Herron1-8/+6
2022-02-24Add typechecking for range expressionsPhilip Herron4-0/+260
This looks up the relevant lang items and constructs their algebraic data types with the specified range types for the substitution argument.
2022-02-24Add missing range mapping lang itemPhilip Herron1-0/+4
2022-02-24Add HIR lowering for range expressionsPhilip Herron2-0/+86
2022-02-23macros: Add optional builtin transcribers to MacroRulesDefinitionArthur Cohen3-6/+70
2022-02-23macro: Add source containing builtin definitionsArthur Cohen3-0/+65
Co-authored-by: philberty <philip.herron@embecosm.com>
2022-02-23Merge #956bors[bot]8-87/+432
956: Substitute repetitions r=CohenArthur a=CohenArthur Needs #955 This PR splits up the `substitute_tokens` function into multiple smaller functions. Still a draft until I can get repetitions working. Closes #960 Closes #961 Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-02-23substitute_repetition: Correctly insert sub-fragmentsArthur Cohen2-71/+119
2022-02-23match_repetition: Set the correct amount of matches for each fragmentArthur Cohen3-74/+59
Co-authored-by: philberty <philip.herron@embecosm.com>
2022-02-22Add new Builtin attributes mappingsPhilip Herron5-30/+152
This class keeps track of all known builtin attributes and specifies which pass they are handled at. This replaces the checks we added for outer attributes during hir lowering making it a more maintainable data structure.
2022-02-22Add mappings for range lang itemsPhilip Herron1-0/+40
2022-02-22Refactor mapping any lang items to be done during HIR loweringPhilip Herron4-25/+93
This extracts a common way of handling outer attributes on Items to improve error handling and make lang item mappings more generic.
2022-02-22Refactor lang item mappings enum into its own headerPhilip Herron2-269/+295
2022-02-22subs_repetition: Add simple test casesArthur Cohen4-0/+82
2022-02-22substitute_repetition: Substitute repetitions properlyArthur Cohen2-23/+81
2022-02-22substitute_repetition: Add parsing of repetition patternArthur Cohen2-9/+62
2022-02-22transcribe: Move substitute_metavar in its own functionArthur Cohen3-47/+166
2022-02-22Merge #964 #965bors[bot]5-46/+96
964: Forbid unresolved test cases r=CohenArthur a=CohenArthur Closes #923 965: macro-invoc-lexer: Split implementation in its own file r=CohenArthur a=CohenArthur Closes #949 Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-02-22matched_fragment: Track and set fragment match amountArthur Cohen2-7/+36
Co-authored-by: philberty <philip.herron@embecosm.com>
2022-02-21macro-invoc-lexer: Split implementation in its own fileArthur Cohen4-46/+95
2022-02-21testsuite: Add -fdump-tree-gimple to inline1.rsArthur Cohen1-0/+1
2022-02-20Merge #950bors[bot]11-14/+265
950: Match macro repetitions r=CohenArthur a=CohenArthur This PR adds support for matching macro invocations and counting the amount of times they've been matched Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-02-20Merge #951bors[bot]6-555/+772
951: Add name resolution to slices r=philberty a=philberty This is the first part to support slices where we complete the name resolution of the SliceType with its element as well as the range expressions used in construction. This patch also includes separation of the implementation from the headers to try and incrementally improve build speed. Addresses #849 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
2022-02-18macro: Add repetition execution test casesArthur Cohen3-10/+17
2022-02-18macros: Add test cases for repetitionsArthur Cohen6-0/+106
2022-02-18macro-repetitions: Match repetitions properlyArthur Cohen3-3/+142
2022-02-18Merge #944bors[bot]1-0/+1
944: parser: Add `clear_errors()` method r=CohenArthur a=CohenArthur Clears all errors from the error table so we can reuse the parser in later situations. I'm unsure whether or not the method should also emit all of the errors if present? In that case, we might want to rename it or add another wrapper that emits then clears Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
2022-02-18Add name resolution to range expressionsPhilip Herron3-4/+43
2022-02-18Refactor AST::ResolveExpr into its own cc filePhilip Herron4-383/+518
2022-02-18Add name resolution to AST::SliceTypePhilip Herron2-0/+8
2022-02-18Refactor type name resolution into their own .cc filePhilip Herron4-170/+205
2022-02-18Merge #942bors[bot]2-29/+21
942: Removed Lambda Function within AST::PathPattern r=philberty a=mvvsmk Addresses issue #717 1) Changed the rust-path.h and removed the iterate_path_segments fuction. 2) Removed the lambda fuction form rust-ast-lower.cc and replaced it with a for loop. Do let me know if I missed anything or could improve on something. Signed-off-by : M V V S Manoj Kumar <mvvsmanojkumar@gmail.com> Co-authored-by: M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
2022-02-18macro-repetition: Rename enum variants to better reflect repetition kindArthur Cohen3-11/+10
2022-02-18parser: Add `clear_errors()` methodArthur Cohen1-0/+1
2022-02-18struct pattern: Add location on struct nameArthur Cohen2-5/+7
2022-02-18type-path-fn: Add location info on start of Fn tokenArthur Cohen3-9/+16
2022-02-18path-id: Add location info on path identifierArthur Cohen3-18/+22
2022-02-18closure-arg: Add location info on arg nameArthur Cohen2-7/+10
2022-02-18struct-base: Add location info on `..` tokenArthur Cohen2-5/+7
2022-02-18array-copy-init: Add location infoArthur Cohen2-5/+4