Age | Commit message (Collapse) | Author | Files | Lines |
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg_operand):
Add potentially_nonpromoted_keywords set str
(check_identifier): likewise
* expand/rust-macro-builtins-asm.h (parse_format_string):
likewise
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_parse_operand.rs: fix warnings
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg_operand):
Successful parse of in and inout, albeit with str
(check_identifier): Likewise.
(parse_asm_arg): Likewise.
* expand/rust-macro-builtins-asm.h (parse_format_string): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_parse_operand.rs: New test.
|
|
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.h:
Scaffolding HIRFullVisitor for inline asm
* ast/rust-ast.cc (InlineAsm::accept_vis): Likewise.
* hir/tree/rust-hir-visitor.h (RUST_HIR_VISITOR_H): Likewise.
* hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
|
|
gcc/rust/ChangeLog:
* ast/rust-ast-visitor.h:
Scaffolding ast visitor for InlineAsm
* ast/rust-ast.cc (InlineAsm::accept_vis): Likewise.
* ast/rust-expr.h: Likewise.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg_operand):
Fix compile warnings.
(parse_options): Likewise.
(parse_asm): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_illegal_options.rs:
|
|
gcc/rust/ChangeLog:
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit):
Partial unsafe support for inline asm
* checks/errors/rust-unsafe-checker.h: Likewise.
* hir/tree/rust-hir-expr.h: Likewise.
* hir/tree/rust-hir.cc (InlineAsm::accept_vis): Likewise.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h:
Add support for AST to HIR inline asm translation
* hir/rust-ast-lower-base.cc (ASTLoweringBase::visit): Likewise.
* hir/rust-ast-lower-base.h: Likewise.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise.
* hir/rust-ast-lower-expr.h: Likewise.
* hir/tree/rust-hir-expr.h (class InlineAsm): Likewise.
|
|
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_faulty_clobber.rs: compress
the test
* rust/compile/inline_asm_nop.rs: compress
the test
* rust/compile/inline_asm_faulty_clobber_1.rs: Removed.
* rust/compile/inline_asm_faulty_clobber_2.rs: Removed.
* rust/compile/inline_asm_nop_2.rs: Removed.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h (struct AnonConst):
major refactoring of inline asm, mostly concerns
naming convention, trinary conditionals, warnings,
adding rust_unreachables in not-yet supported errors.
(struct InlineAsmRegOrRegClass): Likewise.
(struct InlineAsmOperand): Likewise.
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi): Likewise.
(parse_reg): Likewise.
(parse_operand): Likewise.
(parse_reg_operand): Likewise.
(check_and_set): Likewise.
(parse_options): Likewise.
(parse_format_string): Likewise.
(parse_asm_arg): Likewise.
(parse_asm): Likewise.
* expand/rust-macro-builtins-asm.h (parse_asm_arg): Likewise.
(check_identifier): Likewise.
(check_and_set): Likewise.
(parse_operand): Likewise.
(parse_reg_operand): Likewise.
(parse_options): Likewise.
(parse_reg): Likewise.
(parse_clobber_abi): Likewise.
* expand/rust-macro-builtins.cc (enum class): Likewise.
(inline_asm_maker): Likewise.
* checks/errors/borrowck/ffi-polonius/Cargo.lock: Removed. Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_faulty_clobber.rs: Likewise.
* rust/compile/inline_asm_faulty_clobber_1.rs: Likewise.
* rust/compile/inline_asm_faulty_clobber_2.rs: Likewise.
* rust/compile/inline_asm_illegal_options.rs: Likewise.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h (struct AnonConst):
Got AST::Fragment to be created from InlineAsm.
(struct InlineAsmOperand): Likewise.
(class InlineAsm): Likewise.
* expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise.
(parse_asm): likewise
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg):
Working towards parse_reg and parse_reg_operand
(parse_reg_operand):
Working towards parse_reg and parse_reg_operand
(parse_asm_arg):
Add todo about errors
* expand/rust-macro-builtins-asm.h (parse_global_asm):
remove dead code.
(parse_nonglobal_asm):
remove dead code.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parseAsmArg):
Renamed parseAsmArg to conform to other function names
(parse_asm_arg): Likewise.
(parse_asm): Likewise.
* expand/rust-macro-builtins-asm.h (parseAsmArg): Likewise.
(parse_asm_arg): Likewise.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h (struct InlineAsmRegOrRegClass):
Remove union
(struct InlineAsmOperand): Make instances of inside struct.
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
Change signature with inlineAsmCtx.
(parse_reg): Likewise.
(parse_operand): Likewise.
(parse_reg_operand): Likewise.
(check_and_set): Likewise.
(parse_options): Likewise.
(parse_format_string): Likewise.
(parseAsmArg): Likewise.
(parse_asm): Likewise.
* expand/rust-macro-builtins-asm.h (class InlineAsmContext): Likewise.
(parseAsmArg): Likewise.
(check_and_set): Likewise.
(parse_reg_operand): Likewise.
(parse_options): Likewise.
(parse_reg): Likewise.
(parse_clobber_abi): Likewise.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc
(MacroBuiltin::global_asm_handler):
Remove global_asm and non_global_asm handler
(MacroBuiltin::nonglobal_asm_handler): Likewise.
(MacroBuiltin::asm_handler): Likewise.
* expand/rust-macro-builtins.cc (enum class): Likewise.
(inline_asm_maker): Likewise.
* expand/rust-macro-builtins.h: Likewise.
|
|
Safegaurd InlineAsm's clone_expr_... with unreachable since
we would never use them.
gcc/rust/ChangeLog:
* ast/rust-expr.h:
Safegaurd InlineAsm's clone_expr_... with unreachable.
|
|
Rename InlineAsmOptions to InlineAsmOption for clarity
gcc/rust/ChangeLog:
* ast/rust-ast-full-decls.h (enum class):
Rename InlineAsmOptions to InlineAsmOption for clarity
* ast/rust-expr.h (enum class): Likewise.
* expand/rust-macro-builtins-asm.cc (check_and_set): Likewise.
(parse_options): Likewise.
* expand/rust-macro-builtins-asm.h (check_and_set): Likewise.
* hir/tree/rust-hir-expr.h: Likewise.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h (struct InlineAsmRegOrRegClass):
Scaffolding parse_reg
* expand/rust-macro-builtins-asm.cc (parse_reg): Likewise.
(parse_operand): Likewise.
(parseAsmArg): Likewise.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.h (parseAsmArg):
Resolve static decl warning
(parse_nonglobal_asm):
Resolve static decl warning
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (check_and_set):
Add checks for duplicate options in inline asm
(parse_options): likewise.
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_illegal_options.rs: New test.
|
|
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_faulty_clobber.rs:
Wraps inline_asm tests in unsafe {}
* rust/compile/inline_asm_faulty_clobber_1.rs: likewise.
* rust/compile/inline_asm_faulty_clobber_2.rs: likewise.
* rust/compile/inline_asm_ident_first.rs: likewise.
* rust/compile/inline_asm_nop.rs: likewise.
* rust/compile/inline_asm_nop_2.rs: likewise.
|
|
This is without any mutually exclusive options checked, or
any relationship with reg_operands. Very primitive.
gcc/rust/ChangeLog:
* ast/rust-expr.h: parsing of options(...)
* expand/rust-macro-builtins-asm.cc (check_and_set):
likewise.
(parse_options): likewise.
(parseAsmArg): likewise.
* expand/rust-macro-builtins-asm.h (check_and_set):
likewise.
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_legal_options.rs: New test.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi):
implemented parse_clobber_abi
(parse_format_string): likewise.
(parseAsmArg): likewise.
(parse_asm): likewise.
* expand/rust-macro-builtins-asm.h (parseAsmArg): likewise.
|
|
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_faulty_clobber.rs: New test.
* rust/compile/inline_asm_faulty_clobber_1.rs: New test.
* rust/compile/inline_asm_faulty_clobber_2.rs: New test.
|
|
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_nop_2.rs: New test.
|
|
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_ident_first.rs: New test.
|
|
gcc/testsuite/ChangeLog:
* rust/compile/inline_asm_nop.rs: Simple test for asm!
|
|
Replace scaffolded InlineAsm with real InlineAsm node in rust-expr.h
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parseDirSpec): replace
scaffolded InlineAsm with real InlineAsm.
(parse_clobber_abi): likewise.
(check_and_set): likewise.
(parse_options): likewise.
(parseAsmArg): likewise.
(parse_asm): likewise.
* expand/rust-macro-builtins-asm.h (struct AsmParseError): likewise.
(enum InlineAsmDirSpec): likewise.
(enum InlineAsmRegOrRegClass): likewise.
(struct AsmArg): likewise.
(parseAsmArg): likewise.
(check_and_set): likewise.
(parse_operand): likewise.
(parse_options): likewise.
(parse_reg): likewise.
(parse_clobber_abi): likewise.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h: Make InlineAsm non-abstract for usage in parsing.
|
|
gcc/rust/ChangeLog:
* ast/rust-expr.h: Introduced is_global_asm to InlineAsm AST
|
|
Finish up on parse_option, formatted parse_clobber_abi
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi): format
(check_and_set): helper function, is try_set_option equivalent
(parse_options): new function
* expand/rust-macro-builtins-asm.h (enum InlineAsmOptions):
removed
(check_and_set): decl of helper function
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_options): title.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_clobber_abi): title.
(parseAsmArg): title.
* expand/rust-macro-builtins-asm.h (parse_clobber_abi): title.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (enum InlineAsmRegOrRegClass): title.
(parseAsmArg): title.
(check_identifier): title.
(parse_operand): title.
(parse_options): title.
(parse_reg): title.
(parseDirSpec): title.
(parse_asm): title.
|
|
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (struct AsmParseError): title.
(enum InlineAsmDirSpec): title.
(enum InlineAsmOptions): title.
(struct AsmArg): title.
(parseAsmArg): title.
(parse_global_asm): title.
(parse_nonglobal_asm): title.
(parse_asm): title.
(parseDirSpec): title.
(parse_format_string): title.
(MacroBuiltin::global_asm_handler): title.
(MacroBuiltin::nonglobal_asm_handler): title.
* expand/rust-macro-builtins.cc: title.
* expand/rust-macro-builtins.h: title.
|
|
Add a few test to check the exclusive range pattern feature. This feature
is experimental and shall not be enabled in stable rust.
gcc/testsuite/ChangeLog:
* rust/compile/exclusive_range_pattern.rs: New test.
* rust/compile/exclusive_range_pattern_feature_gate.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
This syntax is experimental and shall be explicitely enabled in the crate
attributes as it cannot be used in stable rust.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate the
excluded pattern.
* checks/errors/rust-feature-gate.h: Update the function prototype
and delete two empty implementations in order to use default visitor
behavior.
* checks/errors/rust-feature.cc (Feature::create): Add the new
exclusive range pattern feature gate.
* checks/errors/rust-feature.h: Add new feature enum variant for
exclusive range patterns.
* parse/rust-parse-impl.h (Parser::parse_pattern_no_alt): Forward the
token location to the AST.
(Parser::parse_ident_leading_pattern): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Exclusive range pattern were not handled by the parser as this an
experimental feature.
gcc/rust/ChangeLog:
* ast/rust-pattern.cc (tokenid_to_rangekind): Add a new function to
get a range kind from the current token type.
(RangePattern::as_string): Change the string representation for range
pattern in order to handle excluded ranges.
* ast/rust-pattern.h (enum class): Add new enum class to differentiate
range kinds.
(tokenid_to_rangekind): New prototype for a function that converts a
token id to it's corresponding range kind.
(class RangePattern): Change the class to accept a range kind instead
of an ellipsis boolean.
* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Abort
when an excluded pattern has been found as we do not handle their
lowering yet.
* parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern):
Parse excluded range patterns.
(Parser::parse_pattern_no_alt): Likewise.
(Parser::parse_ident_leading_pattern): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Add a test for the feature gate, as well as some test to ensure the raw
keyword stays weak. Also add some tests to check whether the raw_ref_op
syntax is parsed correctly.
gcc/testsuite/ChangeLog:
* rust/compile/not_raw_ref_op.rs: New test.
* rust/compile/raw_ref_op.rs: New test.
* rust/compile/raw_ref_op_feature_gate.rs: New test.
* rust/compile/raw_ref_op_invalid.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Raw ref operators are still experimental and shall not slip within
stable rust, they should therefore be feature gated.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): Gate raw
borrow.
* checks/errors/rust-feature-gate.h: Update function prototype.
* checks/errors/rust-feature.cc: Add raw_ref_op gate.
* checks/errors/rust-feature.h: Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
We do not handle those kind of references yet, we shall not let them
pass as a regular reference.
gcc/rust/ChangeLog:
* ast/rust-expr.h: Add a getter for mutability.
* hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Panic when a
raw reference is met.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
The raw ref operator is an unstable feature required to obtain a pointer
to unaligned adresses (mainly unaligned struct fields) without UB.
gcc/rust/ChangeLog:
* ast/rust-ast-builder.cc (Builder::ref): Adapt constructor to the new
API.
* ast/rust-ast-collector.cc (TokenCollector::visit): Emit a raw weak
keyword when required.
* ast/rust-ast.cc (BorrowExpr::as_string): Change as_string
representation to handle raw ref operator.
* ast/rust-expr.h (class BorrowExpr): Add raw discriminant.
* expand/rust-macro-builtins-include.cc: Adapt constructor to the new
API.
* parse/rust-parse-impl.h: Handle the raw weak keyword.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
We want to prevent regressions on struct expr field attribute parsing.
gcc/testsuite/ChangeLog:
* rust/compile/struct_expr_field_attributes.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Struct fields can have outer attributes on their field for various
purpose, this behavior should be reflected upon struct expr fields.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Output field
attributes.
* ast/rust-expr.h (class StructExprField): Add outer attributes member.
* parse/rust-parse-impl.h (Parser::parse_struct_expr_field): Parse
outer attributes and store them in the appropriate AST node.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
First test checks the may_dangle outer atttribute on generic params can
be parsed. The second one tests whether may_dangle attributes are
correctly feature gated.
gcc/testsuite/ChangeLog:
* rust/compile/dropck_eyepatch_feature_gate.rs: New test.
* rust/compile/may_dangle.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Add a new feature gate for may_dangle generic param outer attributes.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc: Visit and gate may_dangle
attributes.
* checks/errors/rust-feature-gate.h: Update visit function prototype
and add a new member function to check on a set of attributes whether
one is may_dangle.
* checks/errors/rust-feature.cc (Feature::create): Add new
dropck_eyepatch feature.
* checks/errors/rust-feature.h: Likewise.
* util/rust-attribute-values.h: Add new may_dangle attribute value.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Previously generic params only allowed one outer attribute in front of
them.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Visit outer
attributes.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change outer
attribute visit, we need to visit all of them.
* ast/rust-ast.cc (LifetimeParam::as_string): Change as_string
implementation to allow multiple outer attributes.
(TypeParam::as_string): Likewise.
* ast/rust-ast.h (class LifetimeParam): Allow multiple outer
attributes.
* ast/rust-item.h (class TypeParam): Likewise.
* ast/rust-path.h: Likewise.
* parse/rust-parse-impl.h (Parser::parse_generic_param): Change call
to outer attribute parsing to collect several attributes.
(Parser::parse_lifetime_param): Likewise.
(Parser::parse_type_param): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Generic parameter parsing failed when an outer attribute was used on it.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_generic_param): Change token
reference to be the last token after all outer attributes have been
parsed.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
Add a new test to prevent regressions on the box syntax as well as its
feature gate.
gcc/testsuite/ChangeLog:
* rust/compile/box_syntax.rs: New test.
* rust/compile/box_syntax_feature_gate.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|
|
The box syntax is experimental even though it is used in the standard
library. It should be feature gated to prevent anyone from using it in
stable rust.
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): Allow
visitor recursion in functions. Also add the gate for the box syntax.
* checks/errors/rust-feature-gate.h: Remove several recursion fences
in the feature gate visitor.
* checks/errors/rust-feature.cc (Feature::create): Add a new feature.
(Feature::as_name): Likewise.
* checks/errors/rust-feature.h: Add box_syntax gate.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
|