about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
AgeCommit message (Collapse)AuthorLines
2024-11-09Auto merge of #132584 - Zalathar:includes, r=cuviperbors-0/+4
Trim and tidy includes in `rustc_llvm` These includes tend to accumulate over time, and are usually only removed when something breaks in a new LLVM version, so it's nice to clean them up manually once in a while. General strategy used for this PR: - Remove all includes from `LLVMWrapper.h` that aren't needed by the header itself, transplanting them to individual source files as necessary. - For each source file, temporarily remove each include if doing so doesn't cause a compile error. - If a “required” include looks like it shouldn't be needed, try replacing it with its sub-includes, then trim that list. - After doing all of the above, go back and re-add any removed include if the file does actually use things defined in that header, even if the header happens to also be included by something else.
2024-11-05coverage: Tidy up coverage-specific FFI functionsZalathar-26/+28
2024-11-04Trim and tidy includes in `rustc_llvm`Zalathar-0/+4
2024-10-20Pass coverage mappings to LLVM as separate structsZalathar-91/+91
2024-10-11coverage: Remove code related to LLVM 17Zalathar-1/+1
2024-10-08coverage. Disable supporting mcdc on llvm-18zhuyunxing-36/+9
2024-09-18Update the minimum external LLVM to 18Josh Stone-10/+3
2024-04-19coverage. Generate Mappings of decisions and conditions for MC/DCzhuyunxing-3/+91
2024-04-04Rollup merge of #123437 - Zalathar:clang-format, r=cuviperJacob Pratt-28/+20
Manually run `clang-format` on `CoverageMappingWrapper.cpp` In the current version of #123409, there are several unrelated changes to `CoverageMappingWrapper.cpp` that seem to be the result of running `clang-format` on that file. Instead of asking for those changes to be undone, I figure it's easier to just make them myself as a separate PR, since I was vaguely intending to do that at some point anyway. In a few cases I've strategically added comments to make the grouping of parameters a little nicer, but mostly it doesn't matter much.
2024-04-04Manually run `clang-format` on `CoverageMappingWrapper.cpp`Zalathar-28/+20
2024-04-03coverage: Correctly report and check LLVM's coverage mapping versionZalathar-1/+4
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