Skip to content

Commit

Permalink
Adapt to Load gaining an explicit load type
Browse files Browse the repository at this point in the history
This bumps the `llvm-pretty` submodule to bring in the changes to the `Load`
data constructor from GaloisInc/llvm-pretty#110 and adapts the code in
`llvm-pretty-bc-parser` accordingly.

This is necessary in order to `load` from an opaque pointer. See #177. A test
case will be added in a subsequent commit.
  • Loading branch information
RyanGlScott committed May 30, 2023
1 parent 4c857a8 commit 6349a78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm-pretty
4 changes: 2 additions & 2 deletions src/Data/LLVM/BitCode/IR/Function.hs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ parseFunctionBlockEntry _ t d (fromEntry -> Just r) = case recordCode r of
aval <- parseField r ix' numeric
let align | aval > 0 = Just (bit aval `shiftR` 1)
| otherwise = Nothing
result ret (Load (tv { typedType = PtrTo ret }) Nothing align) d
result ret (Load ret tv Nothing align) d

-- 21 is unused
-- 22 is unused
Expand Down Expand Up @@ -825,7 +825,7 @@ parseFunctionBlockEntry _ t d (fromEntry -> Just r) = case recordCode r of
when (ordval /= Nothing && align == Nothing)
(fail "Invalid record")

result ret (Load (tv { typedType = PtrTo ret }) ordval align) d
result ret (Load ret tv ordval align) d


-- [ptrty, ptr, val, align, vol, ordering, synchscope]
Expand Down

0 comments on commit 6349a78

Please sign in to comment.