mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Optimize away a move
This commit is contained in:
parent
6d34ec18c7
commit
edd08e020c
@ -136,11 +136,14 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
|
||||
Entry::Vacant(entry) => {
|
||||
// No job entry for this query. Return a new one to be started later
|
||||
return tls::with_related_context(tcx, |icx| {
|
||||
// Create the `parent` variable before `info`. This allows LLVM
|
||||
// to elide the move of `info`
|
||||
let parent = icx.query.clone();
|
||||
let info = QueryInfo {
|
||||
span,
|
||||
query: Q::query(key.clone()),
|
||||
};
|
||||
let job = Lrc::new(QueryJob::new(info, icx.query.clone()));
|
||||
let job = Lrc::new(QueryJob::new(info, parent));
|
||||
let owner = JobOwner {
|
||||
cache,
|
||||
job: job.clone(),
|
||||
|
Loading…
Reference in New Issue
Block a user