Skip to content

Commit d7b8b65

Browse files
authored
[LLVM][TableGen][DecoderEmitter] Add wrapper struct for bit_value_t (#146248)
Add a convenience wrapper struct for the `bit_value_t` enum type to host various constructors, query, and printing support. Also refactor related code in several places. In `getBitsField`, use `llvm::append_range` and `SmallVector::append()` and eliminate manual loops. Eliminate `emitNameWithID` and instead use the `operator <<` that does the same thing as this function. Have `BitValue::getValue()` (replacement for `Value`) return std::optional<> instead of -1 for unset bits. Terminate with a fatal error when a decoding conflict is encountered.
1 parent e99da2b commit d7b8b65

File tree

2 files changed

+108
-133
lines changed

2 files changed

+108
-133
lines changed

llvm/test/TableGen/FixedLenDecoderEmitter/conflict.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: llvm-tblgen -gen-disassembler -I %p/../../../include %s -o - 2>%t
1+
// RUN: not llvm-tblgen -gen-disassembler -I %p/../../../include %s -o - 2>%t
22
// RUN: FileCheck %s < %t
33

44
include "llvm/Target/Target.td"

0 commit comments

Comments
 (0)