Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
konradweiss committed Sep 11, 2023
1 parent e365a88 commit 5bff6c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ class ExpressionHandler(lang: LLVMIRLanguageFrontend) :
* [`extractvalue`](https://llvm.org/docs/LangRef.html#extractvalue-instruction) instruction
* which works in a similar way.
*
* We try to convert it either into an [SubscriptExpression] or an [MemberExpression],
* depending on whether the accessed variable is a struct or an array. Furthermore, since
* `getelementptr` allows an (infinite) chain of sub-element access within a single instruction,
* we need to unwrap those into individual expressions.
* We try to convert it either into an [SubscriptExpression] or an [MemberExpression], depending
* on whether the accessed variable is a struct or an array. Furthermore, since `getelementptr`
* allows an (infinite) chain of sub-element access within a single instruction, we need to
* unwrap those into individual expressions.
*/
internal fun handleGetElementPtr(instr: LLVMValueRef): Expression {
val isGetElementPtr =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,7 @@ class LLVMIRLanguageFrontendTest {
assertEquals(1, yMod.rhs.size)
assertEquals(
3L,
((yMod.lhs.first() as? SubscriptExpression)?.subscriptExpression as? Literal<*>)
?.value
((yMod.lhs.first() as? SubscriptExpression)?.subscriptExpression as? Literal<*>)?.value
)
assertSame(
yModInit,
Expand All @@ -875,20 +874,17 @@ class LLVMIRLanguageFrontendTest {
assertNotNull(shuffledInit)
assertSame(
origX,
((shuffledInit.initializers[0] as? SubscriptExpression)?.arrayExpression
as? Reference)
((shuffledInit.initializers[0] as? SubscriptExpression)?.arrayExpression as? Reference)
?.refersTo
)
assertSame(
yModInit,
((shuffledInit.initializers[1] as? SubscriptExpression)?.arrayExpression
as? Reference)
((shuffledInit.initializers[1] as? SubscriptExpression)?.arrayExpression as? Reference)
?.refersTo
)
assertSame(
yModInit,
((shuffledInit.initializers[2] as? SubscriptExpression)?.arrayExpression
as? Reference)
((shuffledInit.initializers[2] as? SubscriptExpression)?.arrayExpression as? Reference)
?.refersTo
)
assertSame(
Expand Down

0 comments on commit 5bff6c4

Please sign in to comment.