Miscellneous refactorings of trans#41287
Conversation
eddyb
left a comment
There was a problem hiding this comment.
LGTM modulo some nits that can be addressed later.
src/librustc/middle/cstore.rs
Outdated
There was a problem hiding this comment.
This is one of the weirder structures in the whole compiler and it'd be nice if it'd just die already.
There was a problem hiding this comment.
oh yeah I meant to kill it altogether; it's just a newtype'd svh at this point
There was a problem hiding this comment.
I can do that in a follow-up though
src/librustc_trans/base.rs
Outdated
There was a problem hiding this comment.
I am surprised we don't have a wrapper for the llcx + llmod combo.
src/librustc_trans/base.rs
Outdated
There was a problem hiding this comment.
ModuleLlvm is what I mean I guess?
src/librustc_trans/base.rs
Outdated
There was a problem hiding this comment.
Again, it'd be nice if ccx actually kept a ModuleLlvm.
src/librustc_trans/context.rs
Outdated
There was a problem hiding this comment.
There's a bunch of stats that are irrelevant anymore AFAIK.
No good reason for them to be in there.
These do some low-level munging on the LLVM data structures. Unclear that they need to operate as a "second pass" but leave it for now.
A number of things were using `crate_hash` that really ought to be using `crate_disambiguator` (e.g., to create the plugin symbol names). They have been updated. It is important to remove `LinkMeta` from `SharedCrateContext` since it contains a hash of the entire crate, and hence it will change whenever **anything** changes (which would then require rebuilding **everything**).
shared mutable state is bad
d41ce38 to
07fb93e
Compare
|
@bors r+ |
|
📌 Commit 07fb93e has been approved by |
…ns, r=eddyb Miscellneous refactorings of trans This doesn't achieve any particular goal yet, but it's a collection of refactorings with the common goal of turning `SharedCrateContext` etc into stuff that we can use with on-demand and actually expect to hash in a stable fashion for incremental. Not there yet, clearly. r? @eddyb cc @michaelwoerister
This doesn't achieve any particular goal yet, but it's a collection of refactorings with the common goal of turning
SharedCrateContextetc into stuff that we can use with on-demand and actually expect to hash in a stable fashion for incremental. Not there yet, clearly.r? @eddyb
cc @michaelwoerister