commit | 35ba2feaa1ca3088e0de36dc816f244e248c7669 | [log] [tgz] |
---|---|---|
author | Lukasz Anforowicz <lukasza@google.com> | Wed Nov 23 15:56:19 2022 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Nov 23 15:57:13 2022 -0800 |
tree | 1f96707c62373f1a11b793e879abba4c2cd8886a | |
parent | adb0c17c6fd98edf71ffee710487956b121cc703 [diff] |
Move NamespaceQualifier into `crubit/common/code_gen_utils.rs`. This CL helps prepare for reusing NamespaceQualifier from `crubit/cc_bindings_from_rs`. In addition to moving the code, the CL had to make the following changes: - `format_for_cc` has to return a `Result<...>` (since `format_for_cc` in `code_gen_utils` is not infallible, unlike the one in `rs_bindings_from_cc`) - NamespaceQualifier::new is rs_bindings_from_cc/IR-specific and therefore couldn't be moved into `common/code_gen_utils.rs`. It was refactored into a separate function. PiperOrigin-RevId: 490601254
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