commit | f8cfa56c7491b2b72d02f3f35d48354c374a45d1 | [log] [tgz] |
---|---|---|
author | Lukasz Anforowicz <lukasza@google.com> | Thu Sep 22 11:06:43 2022 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Sep 22 11:07:13 2022 -0700 |
tree | a98001ba0a2082bc7261ab807217b4b8a382bf3b | |
parent | efd635d1642fc2a29e11988d28bff7372f4595a4 [diff] |
Delete `RcEq<T>` and instead provide `impl PartialEq for RsSnippet`. `salsa` requires that all query keys and query results can be compared for equality. Key equality is needed for basic `salsa` functionality (memoization of previous computations). Result equality is needed to determine that a changed input doesn't affect the result of a given computation (and therefore computations transitively depending on the result don't need to be redone). Before this CL, equality of some query results was provided by `RcEq<T>` in Crubit's `salsa_utils.rs` (inspired by Chalk's `ArcEq`). This worked but pointer-based-equality would unnecessary treat equivalent results as different. This doesn't matter in practice, because Crubit never resets `salsa` inputs (i.e. only calls `set_ir` once) and so `salsa` would never need to check equality of `RcEq`. Still, having real, non-pointer-based equality should help with incremental computations in the future (if they ever become used by Crubit). And deleting `salsa_utils.rs` also means the code is smaller and easier to understand. PiperOrigin-RevId: 476146950
Extremely experimental interop tooling for C++ and Rust.
Please don‘t use, this is an experiment and we don’t yet know where will it take us. There will be breaking changes without warning. Unfortunately, we can't take contributions at this point.
$ apt install clang lld bazel $ git clone git@github.com:google/crubit.git $ cd crubit $ bazel build --linkopt=-fuse-ld=/usr/bin/ld.lld //rs_bindings_from_cc:rs_bindings_from_cc_impl
$ git clone https://github.com/llvm/llvm-project $ cd llvm-project $ CC=clang CXX=clang++ cmake -S llvm -B build -DLLVM_ENABLE_PROJECTS='clang' -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install $ cmake --build build -j $ # wait... $ cmake --install build $ cd ../crubit $ LLVM_INSTALL_PATH=../llvm-project/install bazel build //rs_bindings_from_cc:rs_bindings_from_cc_impl