Emphasise that these functions look at the disk, not just the path
I thought that `PathBuf::new("foo/bar/").is_dir()` is always true, because the path ends in `/`. However, this is not what `is_dir()` function does. So I've updated the docs to make it clear.
Improve hir::map::Map::get_parent_node doc
The documentation says
```
/// Similar to get_parent, returns the parent node id or id if there is no
/// parent.
/// This function returns the immediate parent in the AST, whereas get_parent
/// returns the enclosing item.
```
One would think that one can walk up the tree by repeatedly calling `get_parent_node` until it returns the argument, and then work on the `NodeId`s that arise. However, that is not true: `get_parent_node` will return id 0 (the crate itself) for items that sit directly in the crate; calling `get` on that `NodeId` will panic.
So, the fact that `get_parent_node` returns the root when passed the root is actually not really useful, because the root itself is already a somewhat degenerate node. This improves the doc so hopefully people writing code that "walks up the tree" don't run into this issue like I did...
incr.comp.: Properly incorporate symbol linkage and visibility into CGU hash.
This PR fixes the way the CGU hash for incr. comp. is computed. The CGU hash represents which `TransItems` are emitted into which codegen unit with which linkage and visibility. Before the new, LLVM-independent symbol internalizer the CGU hash did not accurately contain `TransItem` linkage and visibility because we would not enable symbol internalization in incremental mode anyway. The new internalizer is also run in incremental mode which uncovered the inaccuracy of CGU hashing. Luckily, the fix is rather simple.
r? @eddyb
cc @nikomatsakis
Fix quadratic performance with lots of use statements
This fixes 2 problems that caused quadratic performance when lots of use-statements were present. After this patch, performance is linear (and very fast) even with 1M uses.
Fixes#43572.
Fixes#43573.
r? @eddyb
Derive `Hash` on `AssociatedKind`.
This is a trivial change useful in downstream code poking in rustc's
innards, in particular the semver verification tool I'm currently working on.
r? @eddyb
Fix the Solaris pthread_t raw type in std to match what's in libc
The old type causes failures when building cargo 0.20.0 after rust-lang/libc@8304e06b5.
rustc: Inline bitwise modification operators
These need to be inlined across crates to avoid showing up as one-instruction
functions in profiles! In the benchmark from #43578 this decreased the
translation item collection step from 30s to 23s, and looks like it also allowed
vectorization elsewhere of the operations!
Thread through the original error when opening archives
This updates the management of opening archives to thread through the original
piece of error information from LLVM over to the end consumer, trans.
Gate LLVMRustHasFeature on LLVM_RUSTLLVM
Commit c4710203c0 in #43492 make `LLVMRustHasFeature` "more robust"
by using `getFeatureTable()`. However, this function is specific to
Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
`#if LLVM_RUSTLLVM` to guard this call.
Closes#43555.
rustc_mir: don't build unused unwind cleanup blocks
When building a scope exit, don't build unwind cleanup blocks unless they will actually be used by the unwind path of a drop - the unused blocks are removed by SimplifyCfg, but they can cause a significant performance slowdown before they are removed. That fixes#43511.
Also a few other small MIR cleanups & optimizations.
r? @eddyb