aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-08-12 15:06:52 +0000
committerGitHub <noreply@github.com>2021-08-12 15:06:52 +0000
commit3610c9b202b3197bd92ce7b8dbabcb86d4641ee6 (patch)
treea8be78ea928d605ce6ea8f29a896fcbb48f42af4 /gcc/rust/parse/rust-parse-impl.h
parent7be0232c686a75f98b2ca3c27f7de3139b8999c6 (diff)
parentb4993a629348279023b2c0159169ed62f10ac453 (diff)
downloadgcc-3610c9b202b3197bd92ce7b8dbabcb86d4641ee6.zip
gcc-3610c9b202b3197bd92ce7b8dbabcb86d4641ee6.tar.gz
gcc-3610c9b202b3197bd92ce7b8dbabcb86d4641ee6.tar.bz2
Merge #613
613: Resolve module filename r=philberty a=CohenArthur This PR is a first attempt at resolving the filename corresponding to an external module correctly. Some of the cases are not handled yet and a lot of FIXMEs are still here, as I am looking for feedback on certain things: * Am I correct in assuming that we have to go through directories the C way because we are using C++11 and the `filesystem` header is not available until C++17? Is there some gcc abstraction for this that I'm overlooking? * How important is the existence of a separate SEPARATOR macro for Windows? From what I'm understanding, the OS also understands normal slashes `/` on top of the backward slashes it usually uses `\`. I don't know what happens when they are mixed and matched or how the file system handles it. * For review simplicity, outer attributes could be accessed in a later PR. I believe they can already be accessed and looked at but haven't looked into it. I'm also unsure if this would be the right place to implement that outer_attr lookup Co-authored-by: CohenArthur <arthur.cohen@epita.fr>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index c94c637..731e0b3 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -2101,10 +2101,11 @@ Parser<ManagedTokenSource>::parse_module (AST::Visibility vis,
case SEMICOLON:
lexer.skip_token ();
+ // Construct an external module
return std::unique_ptr<AST::Module> (
new AST::Module (std::move (name), std::move (vis),
- std::move (outer_attrs),
- locus)); // module name?
+ std::move (outer_attrs), locus,
+ lexer.get_filename ()));
case LEFT_CURLY: {
lexer.skip_token ();