about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-03-21 14:17:00 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-04-16 13:02:53 +1000
commit3e1136049706c90ae6ab30bfaf8c63839059aa36 (patch)
tree32b968d7c21d8703d745585cd9062cfda6bc4cb4 /compiler/rustc_codegen_llvm/src/errors.rs
parent2e989dc2809937fe33c17995e2147873977d2235 (diff)
downloadrust-3e1136049706c90ae6ab30bfaf8c63839059aa36.tar.gz
rust-3e1136049706c90ae6ab30bfaf8c63839059aa36.zip
Construct `SourceMap` at the same time as `SessionGlobals`.
Currently `SourceMap` is constructed slightly later than
`SessionGlobals`, and inserted. This commit changes things so they are
done at the same time.

Benefits:
- `SessionGlobals::source_map` changes from
  `Lock<Option<Lrc<SourceMap>>>` to `Option<Lrc<SourceMap>>`. It's still
  optional, but mutability isn't required because it's initialized at
  construction.
- `set_source_map` is removed, simplifying `run_compiler`, which is
  good because that's a critical function and it's nice to make it
  simpler.

This requires moving things around a bit, so the necessary inputs are
available when `SessionGlobals` is created, in particular the `loader`
and `hash_kind`, which are no longer computed by `build_session`. These
inputs are captured by the new `SourceMapInputs` type, which is threaded
through various places.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions