diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-03-04 11:41:32 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-03-08 16:09:05 +0000 |
commit | 749a419a2e92bab004b7be7addbfab0cae5357e0 (patch) | |
tree | 0b6986fbd073895c64774d8651ec0988a43de1f6 /gcc/rust/parse | |
parent | 865b6090a8f8981cdfc050ea2ee44abbe92de141 (diff) | |
download | gcc-749a419a2e92bab004b7be7addbfab0cae5357e0.zip gcc-749a419a2e92bab004b7be7addbfab0cae5357e0.tar.gz gcc-749a419a2e92bab004b7be7addbfab0cae5357e0.tar.bz2 |
Refactor ABI options as part of HIR function qualifiers
The AST has an ABI string as part of the function qualifiers, this was the
same in the HIR as it was initially a copy-paste. This patch changes the
HIR function qualifiers to have an enum of ABI options, during HIR lowering
the enum is setup and if an unknown ABI option is specified an error is
emitted.
Diffstat (limited to 'gcc/rust/parse')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 8559c3b..db73828 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -2620,13 +2620,13 @@ AST::FunctionQualifiers Parser<ManagedTokenSource>::parse_function_qualifiers () { AsyncConstStatus const_status = NONE; - // bool has_const = false; bool has_unsafe = false; bool has_extern = false; std::string abi; // Check in order of const, unsafe, then extern const_TokenPtr t = lexer.peek_token (); + Location locus = t->get_locus (); switch (t->get_id ()) { case CONST: @@ -2662,7 +2662,7 @@ Parser<ManagedTokenSource>::parse_function_qualifiers () } } - return AST::FunctionQualifiers (const_status, has_unsafe, has_extern, + return AST::FunctionQualifiers (locus, const_status, has_unsafe, has_extern, std::move (abi)); } |