llvm-project/lldb
Emmmer d0dcbb9b02 [LLDB][RISCV][NFC] Rewrite instruction in algebraic datatype
The old approach (dedicated ExecXXX for each instruction) is not flexible and results in duplicated code when RVC kicks in.

According to the spec, every compressed instruction can be decoded to a non-compressed one. So we can lower compressed instructions to instructions we already had, which requires a decoupling between the decoder and executor.

This patch:
- use llvm::Optional and its combinators AMAP.
- use template constraints on common instruction.
- make instructions strongly-typed (no uint32_t everywhere bc it is error-prone and burdens the developer when lowering the RVC) with the help of algebraic datatype (std::variant).

Note:
(NFC) because this is more of a refactoring in preparation for RVC.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D135015
2022-10-05 19:45:28 +08:00
..
bindings [lldb] Fix 'error: non-const lvalue...' caused by SWIG 4.1.0 2022-09-30 14:37:29 +02:00
cmake [CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited, part 2 2022-09-14 15:48:58 -04:00
docs [lldb][test] 1 - Don't do test-replication for gmodules debug_info variant 2022-09-26 19:54:24 +01:00
examples [lldb] Fixed a number of typos 2022-09-13 10:38:38 -07:00
include/lldb Change the Sanitizer report breakpoint callbacks to asynchronous. 2022-10-03 18:10:28 -07:00
packages/Python/lldbsuite [lldb][test] 1 - Don't do test-replication for gmodules debug_info variant 2022-09-26 19:54:24 +01:00
resources
scripts
source [LLDB][RISCV][NFC] Rewrite instruction in algebraic datatype 2022-10-05 19:45:28 +08:00
test buildbot-based-debugging a Microsoft lldb test XPASS 2022-10-04 21:38:33 +00:00
third_party/Python/module [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
tools When there are variable errors, display an error in VS Code's local variables view. 2022-09-29 10:55:16 -07:00
unittests [LLDB][RISCV][NFC] Rewrite instruction in algebraic datatype 2022-10-05 19:45:28 +08:00
utils Fix a bug in lldb-dotest that was uncovered by setting no value for dotest_args_str. 2022-08-31 18:00:18 -07:00
.clang-format
.clang-tidy [LLDB] Applying clang-tidy modernize-use-override over LLDB 2022-04-22 13:29:47 -07:00
.gitignore
CMakeLists.txt lldb: Disable unittests if llvm_gtest target does not exist 2022-08-10 16:56:08 -07:00
CODE_OWNERS.txt [CODE OWNERS] Add wallace as code owner 2022-01-12 12:36:30 -08:00
LICENSE.TXT
use_lldb_suite_root.py