The recent unit tests we gained made clear that the semantics of APIntFromVal
are not clear, due to missing documentation. In this change we document both
the calling interface as well as the implementation of APIntFromVal. We also
make the implementation easier to read by removing the use of magic numbers.
Finally, we add tests to check the bitwidth of the created values as well as
the correct modeling of very large numbers.
Details
Diff Detail
Event Timeline
Thank you for the extensive documentation and adding more test cases.
include/polly/Support/GICHelper.h | ||
---|---|---|
46 | assert() is not a guaranteed behavior. Better mention that the function can only be called on integer isl_vals. | |
55–64 | Cool! More than I hoped for. I'd remove the Unsigned column. It gives the impression that an unsigned interpretation would make sense. But maybe add a bitwidth column? | |
lib/Support/GICHelper.cpp | ||
65 | Can you mention 'negate'=='two's complement'? | |
unittests/Isl/IslTest.cpp | ||
68 | Suggestion: | |
69–70 | Remove fixme | |
150 | Wow! Truly large integers. |
assert() is not a guaranteed behavior. Better mention that the function can only be called on integer isl_vals.