Skip to content

Commit 9cfe442

Browse files
committed
Draft: Support up to LLVM 20
This bumps the `llvm-pretty`, `llvm-pretty-bc-parser`, and `crucible` submodules in order to bring in several downstream changes that, in total, allow SAW to support LLVM versions up to 20. These include: * `llvm-pretty`: GaloisInc/llvm-pretty#168, GaloisInc/llvm-pretty#169, and GaloisInc/llvm-pretty#170 * `llvm-pretty-bc-parser`: GaloisInc/llvm-pretty-bc-parser#316, GaloisInc/llvm-pretty-bc-parser#317, and GaloisInc/llvm-pretty-bc-parser#318 * `crucible`: GaloisInc/crucible#1600, GaloisInc/crucible#1602, GaloisInc/crucible#1603, and GaloisInc/crucible#1606 The only code changes that had to be made in SAW itself involve the LLVM backend's skeleton-related commands, which look up debug metadata to figure out which variables are declared. For the time being, I have opted not to make these commands look into LLVM's new debug records to find equivalent information, although it probably should. (TODO RGS: Open an issue about this.)
1 parent 919d427 commit 9cfe442

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ This release supports [version
150150
- importing ambiguous symbols is allowed
151151
- referring to ambiguous (qualified) symbols is an error.
152152

153+
* Support LLVM versions up to 20.
154+
153155
## New Features
154156

155157
* SAW has new commands `llvm_unint: [String] -> LLVMSetup ()` and

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ SAW can analyze LLVM programs (usually derived from C, but potentially
117117
for other languages). The only tool strictly required for this is a
118118
compiler that can generate LLVM bitcode, such as `clang`. However,
119119
having the full LLVM tool suite available can be useful. We have tested
120-
SAW with LLVM and `clang` versions from 3.5 to 16.0, as well as the
120+
SAW with LLVM and `clang` versions from 3.5 to 20.0, as well as the
121121
version of `clang` bundled with Apple Xcode. We welcome bug reports on
122122
any failure to parse bitcode from LLVM versions in that range.
123123

deps/crucible

Submodule crucible updated 54 files

saw-central/src/SAWCentral/Crucible/LLVM/Skeleton.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ parseArg LLVM.Typed { LLVM.typedType = t } (nm, loc) = do
140140

141141
stmtCalls :: [LLVM.Stmt] -> Set Text
142142
stmtCalls [] = Set.empty
143-
stmtCalls (LLVM.Result _ (LLVM.Call _ _ (LLVM.ValSymbol (LLVM.Symbol s)) _) _:stmts) =
143+
stmtCalls (LLVM.Result _ (LLVM.Call _ _ (LLVM.ValSymbol (LLVM.Symbol s)) _) _ _:stmts) =
144144
Set.insert (Text.pack s) $ stmtCalls stmts
145-
stmtCalls (LLVM.Effect (LLVM.Call _ _ (LLVM.ValSymbol (LLVM.Symbol s)) _) _:stmts) =
145+
stmtCalls (LLVM.Effect (LLVM.Call _ _ (LLVM.ValSymbol (LLVM.Symbol s)) _) _ _:stmts) =
146146
Set.insert (Text.pack s) $ stmtCalls stmts
147147
stmtCalls (_:stmts) = stmtCalls stmts
148148

@@ -158,7 +158,7 @@ stmtDebugDeclares
158158
LLVM.ValMd (LLVM.ValMdDebugInfo (LLVM.DebugInfoLocalVariable LLVM.DILocalVariable { LLVM.dilvArg = a }))
159159
}
160160
, _
161-
]) md:stmts)
161+
]) _dr md:stmts) -- TODO RGS: Should we also look into the debug records?
162162
| s == "llvm.dbg.declare" || s == "llvm.dbg.value"
163163
, Just (LLVM.ValMdLoc LLVM.DebugLoc { LLVM.dlLine = line, LLVM.dlCol = col }) <- lookup "dbg" md
164164
= Map.insert (fromIntegral a) (Location (fromIntegral line) . Just $ fromIntegral col) $ stmtDebugDeclares stmts
@@ -172,7 +172,7 @@ stmtDebugDeclares
172172
LLVM.ValMd (LLVM.ValMdDebugInfo (LLVM.DebugInfoLocalVariable LLVM.DILocalVariable { LLVM.dilvArg = a }))
173173
}
174174
, _
175-
]) md:stmts)
175+
]) _dr md:stmts) -- TODO RGS: Should we also look into the debug records?
176176
| s == "llvm.dbg.declare" || s == "llvm.dbg.value"
177177
, Just (LLVM.ValMdLoc LLVM.DebugLoc { LLVM.dlLine = line, LLVM.dlCol = col }) <- lookup "dbg" md
178178
= Map.insert (fromIntegral a) (Location (fromIntegral line) . Just $ fromIntegral col) $ stmtDebugDeclares stmts

0 commit comments

Comments
 (0)