aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2020-12-09 15:29:51 +0800
committerSimplyTheOther <simplytheother@gmail.com>2020-12-09 15:29:51 +0800
commit41c14b45ac604ebd69a6715445cdb10fc5c5ec07 (patch)
treefb9e6c7e60b9024b1857c0fcf6241c118f2f67f4 /gcc/rust/rust-session-manager.cc
parent815c9e8b0734d45a6e5b5a7d50f38d4af7120a8c (diff)
parentcef34bd730d80b4664d8633e2cc27a64c5cae246 (diff)
downloadgcc-41c14b45ac604ebd69a6715445cdb10fc5c5ec07.zip
gcc-41c14b45ac604ebd69a6715445cdb10fc5c5ec07.tar.gz
gcc-41c14b45ac604ebd69a6715445cdb10fc5c5ec07.tar.bz2
Merge branch 'master' of https://github.com/redbrain/gccrs
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r--gcc/rust/rust-session-manager.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index fd50bf1..5da2764 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -279,6 +279,12 @@ Session::init ()
// derived values from hook
options.target_data.init_derived_values ();
+
+ // setup singleton linemap
+ linemap = rust_get_linemap ();
+
+ // setup backend to GCC GIMPLE
+ backend = rust_get_backend ();
}
/* Initialise default options. Actually called before handle_option, unlike init
@@ -416,12 +422,10 @@ Session::parse_file (const char *filename)
rust_fatal_error (Location (), "cannot open filename %s: %m", filename);
}
- Backend *backend = rust_get_backend ();
-
// parse file here
/* create lexer and parser - these are file-specific and so aren't instance
* variables */
- Lexer lex (filename, std::move (file_wrap), rust_get_linemap ());
+ Lexer lex (filename, std::move (file_wrap), linemap);
Parser<Lexer> parser (std::move (lex));
// generate crate from parser