about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
AgeCommit message (Collapse)AuthorLines
2024-03-05Explicitly assign constructed C++ classesJubilee Young-7/+7
C++ style guides I am aware of recommend specifically preferring = syntax for any classes with fairly obvious constructors[^0] that do not perform any complicated logic in their constructor. I contend that all constructors that the `rustc_llvm` code uses qualify. This has only become more common since C++ 17 guaranteed many cases of copy initialization elision. The other detail is that I tried to ask another contributor with infinitely more C++ experience than me (i.e. any) what this constructor syntax was, and they thought it was a macro. I know of no other language that has adopted this same syntax. As the rustc codebase features many contributors experienced in many other languages, using a less... unique... style has many other benefits in making this code more lucid and maintainable, which is something it direly needs. [^0]: e.g. https://abseil.io/tips/88
2024-02-13RustWrapper: adapt for coverage mapping API changesTim Neumann-1/+1
2023-12-18llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-0/+3
Adapt for https://github.com/llvm/llvm-project/commit/8ecbb0404d740d1ab173554e47cef39cd5e3ef8c.
2023-08-04coverage: Don't convert symbol names to `CString` for FFIZalathar-2/+5
2023-08-04coverage: Don't convert filenames to `CString` for FFIZalathar-2/+10
2023-07-13Remove `LLVMRustCoverageHashCString`Zalathar-5/+0
Coverage has two FFI functions for computing the hash of a byte string. One takes a ptr/len pair, and the other takes a NUL-terminated C string. But on closer inspection, the C string version is unnecessary. The calling-side code converts a Rust `&str` into a C string, and the C++ code then immediately turns it back into a ptr/len string before actually hashing it.
2023-07-13Fix the length parameter type of `LLVMRustCoverageHashByteArray`Zalathar-1/+1
The Rust-side declaration uses `libc::size_t` for the number of bytes, but the C++ declaration was using `unsigned` instead of `size_t`.
2023-05-09Correctly mark parameter `RustMappingRegions` as pointer-to-`const`Zalathar-1/+1
The regions don't need to be mutable because we pass a copy of them to LLVM instead, and this matches the `*const` in the Rust-side signature.
2023-05-09Isolate coverage FFI type layouts from their underlying LLVM C++ typesZalathar-7/+100
2023-01-11rustc_llvm: replace llvm::makeArrayRef with ArrayRef constructors.Dmitri Gribenko-5/+6
LLVM upstream has deprecated llvm::makeArrayRef and will remove it.
2022-08-14Update the minimum external LLVM to 13Josh Stone-11/+0
2021-11-23Update CoverageMappingFormat Support to Version6Arpad Borsos-2/+7
Version 5 adds Branch Regions which are a prerequisite for branch coverage. Version 6 can use the zeroth filename as prefix for other relative files.
2021-10-22Update the minimum external LLVM to 11Josh Stone-7/+0
2021-03-19fix: I meant LLVM version 13, not 12Augie Fackler-1/+1
2021-03-16llvm-wrapper: pass std::string instead of StringRefAugie Fackler-0/+7
LLVM change 5fbd1a333aa1a0b70903d036b98ea56c51ae5224 modified this function to want std::string instead of StringRef, which is easily done.
2021-03-01Don't directly expose coverage::CounterMappingRegion via FFINikita Popov-2/+22
The definition of this struct changes in LLVM 12 due to the addition of branch coverage support. To avoid future mismatches, declare our own struct and then convert between them.
2020-11-25Improved version checkRich Kadel-3/+2
2020-11-24Check for LLVM 11+ when using `-Z instrument-coverage`Rich Kadel-0/+8
* `rustc` should now compile under LLVM 9 or 10 * Compiler generates an error if `-Z instrument-coverage` is specified but LLVM version is less than 11 * Coverage tests that require `-Z instrument-coverage` and run codegen should be skipped if LLVM version is less than 11
2020-11-23Upgrades the coverage map to Version 4Rich Kadel-16/+31
Changes the coverage map injected into binaries compiled with `-Zinstrument-coverage` to LLVM Coverage Mapping Format, Version 4 (from Version 3). Note, binaries compiled with this version will require LLVM tools from at least LLVM Version 11.
2020-09-09Move `rustllvm` into `rustc_llvm`Vadim Petrochenkov-0/+70