From 6349a78bf906fb163442b8958e9a78be391d0fe6 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Thu, 6 Apr 2023 10:07:59 -0400 Subject: [PATCH] Adapt to Load gaining an explicit load type This bumps the `llvm-pretty` submodule to bring in the changes to the `Load` data constructor from elliottt/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. --- llvm-pretty | 2 +- src/Data/LLVM/BitCode/IR/Function.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm-pretty b/llvm-pretty index d099d5d0..1c4b6de9 160000 --- a/llvm-pretty +++ b/llvm-pretty @@ -1 +1 @@ -Subproject commit d099d5d0feab8066bc682f11c8a46c82fb7166b5 +Subproject commit 1c4b6de9e278734963bb02aaa8e4238f622f8a42 diff --git a/src/Data/LLVM/BitCode/IR/Function.hs b/src/Data/LLVM/BitCode/IR/Function.hs index c3b0a61c..f2484ff3 100644 --- a/src/Data/LLVM/BitCode/IR/Function.hs +++ b/src/Data/LLVM/BitCode/IR/Function.hs @@ -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 @@ -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]