EquivalenceClasses: Sample code incorrect?
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/ADT/EquivalenceClasses.h#L50
Does this need to be `(*it)->isLeader()` and `.member_begin(**it)`? All the `*`s are missing.
See, for example:
* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/mlir/tensorflow/transforms/convert_control_to_data_outputs.cc#L428
* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/mlir/tensorflow/transforms/convert_control_to_data_outputs.cc#L449
I get the impression this contract changed at some point, but I didn't dig into it to find out when.
Contributor guide
Research direction
Read the sample at llvm/include/llvm/ADT/EquivalenceClasses.h around line 50 and compare its iterator and member usage with the linked TensorFlow examples. Verify whether the EquivalenceClasses contract changed and whether the missing dereferences make the sample incorrect. Done means correcting the sample if needed and confirming it matches the current API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100