JJonas Devlieghere[NFC][Py Reformat] Reformat python files in lldb
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[LLDB][formatters] Add formatter for libc++'s std::span This patch adds a libcxx formatter for std::span. The implementation is based on the libcxx formatter for std::vector. The main difference is the fact that std::span conditionally has a __size member based on whether it has a static or dynamic extent. Example output of formatted span: (std::span<const int, 18446744073709551615>) $0 = size=6 { [0] = 0 [1] = 1 [2] = 2 [3] = 3 [4] = 4 [5] = 5 } The second template parameter here is actually std::dynamic_extent, but the type declaration we get back from the TypeSystemClang is the actual value (which in this case is (size_t)-1). This is consistent with diagnostics from clang, which doesn't desugar this value either. E.g.,: span.cpp:30:31: error: implicit instantiation of undefined template 'Undefined<std::span<int, 18446744073709551615>>' Testing: Added API-tests Confirmed manually using LLDB cli that printing spans works in various scenarios Patch by Michael Buch! Differential Revision: https://reviews.llvm.org/D127481 | 3 年前 | |
[NFC][Py Reformat] Reformat python files in lldb This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with black (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460 | 3 年前 | |
[LLDB][formatters] Add formatter for libc++'s std::span This patch adds a libcxx formatter for std::span. The implementation is based on the libcxx formatter for std::vector. The main difference is the fact that std::span conditionally has a __size member based on whether it has a static or dynamic extent. Example output of formatted span: (std::span<const int, 18446744073709551615>) $0 = size=6 { [0] = 0 [1] = 1 [2] = 2 [3] = 3 [4] = 4 [5] = 5 } The second template parameter here is actually std::dynamic_extent, but the type declaration we get back from the TypeSystemClang is the actual value (which in this case is (size_t)-1). This is consistent with diagnostics from clang, which doesn't desugar this value either. E.g.,: span.cpp:30:31: error: implicit instantiation of undefined template 'Undefined<std::span<int, 18446744073709551615>>' Testing: Added API-tests Confirmed manually using LLDB cli that printing spans works in various scenarios Patch by Michael Buch! Differential Revision: https://reviews.llvm.org/D127481 | 3 年前 |