Skip to content

Commit

Permalink
[NFC][TableGen] Refactor IntrinsicEmitter code
Browse files Browse the repository at this point in the history
- Use formatv() and raw string literals to simplify emission code.
- Use range based for loops and structured bindings to simplify loops.
- Use const Pointers to Records.
- Rename `ComputeFixedEncoding` to `ComputeTypeSignature` to reflect
  what the function actually does, cnd change it to return a vector.
- Use reverse() and for_each() for loop to pack 8 nibbles into 32-bits.
- Rename some variables to follow LLVM coding standards.
  • Loading branch information
jurahul committed Aug 29, 2024
1 parent 3a5c578 commit 60eb6ae
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 192 deletions.
2 changes: 1 addition & 1 deletion llvm/test/TableGen/intrinsic-attrs.td
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def int_deref_ptr_ret : Intrinsic<[llvm_ptr_ty], [], [Dereferenceable<RetIndex,
// CHECK-NEXT: default: llvm_unreachable("Invalid attribute set number");
// CHECK-NEXT: case 0:
// CHECK-NEXT: return AttributeSet::get(C, {
// CHECK-NEXT: Attribute::get(C, Attribute::Dereferenceable, 16),
// CHECK-NEXT: Attribute::get(C, Attribute::Dereferenceable, 16),
// CHECK-NEXT: });
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand Down
Loading

0 comments on commit 60eb6ae

Please sign in to comment.