LLVM will sometimes optimize uint8_t arrays into top-level string constants. For example, Clang will optimize uint8_t xs[4] = {0,1,2,3}; into the LLVM string constant "\00\01\02\03". This is still a value of type [4 x i8], but it uses string syntax for convenience. crucible-llvm mirrors this choice by having a dedicated LLVMValString value alongside the more general LLVMValArray, with the former using a ByteString as its payload for convenience.
While SAW's LLVM override matching logic had cases for LLVMValArray, it did not have cases for LLVMValString, which meant that any override that needs to match on an LLVM string constant argument would fail. This is easily fixed by adding the missing cases.
LLVM will sometimes optimize
uint8_t
arrays into top-level string constants. For example, Clang will optimizeuint8_t xs[4] = {0,1,2,3};
into the LLVM string constant"\00\01\02\03"
. This is still a value of type[4 x i8]
, but it uses string syntax for convenience.crucible-llvm
mirrors this choice by having a dedicatedLLVMValString
value alongside the more generalLLVMValArray
, with the former using aByteString
as its payload for convenience.While SAW's LLVM override matching logic had cases for
LLVMValArray
, it did not have cases forLLVMValString
, which meant that any override that needs to match on an LLVM string constant argument would fail. This is easily fixed by adding the missing cases.Fixes #2148.