Skip to content

Commit

Permalink
crucible-llvm-syntax: Additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Nov 2, 2023
1 parent adcb3f6 commit 22bd7b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crucible-llvm-syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ If the numeral `w` is the width of a pointer and `n` is an arbitrary numeral,

The LLVM parser hooks can be further customized by passing yet another `ParserHooks`
to them. The `TypeAlias` module implements one such example, for translating
types like `Long` into `(Ptr n)` or `(Bitvector n)` for appropriate `n`.
types like `Long` into `(Bitvector n)` and `Pointer` into `(Ptr n)` for
appropriate `n`.

[syn]: ../crucible-syntax
16 changes: 16 additions & 0 deletions crucible-llvm-syntax/src/Lang/Crucible/LLVM/Syntax/TypeAlias.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
{-
Module : Lang.Crucible.LLVM.Syntax.TypeAlias
Copyright : (c) Galois, Inc 2023
Maintainer : Langston Barrett <[email protected]>
License : BSD3
This module provides facilities for parsing C-like types and translating them
to appropriate Crucible-LLVM types, given a target triple. For example, the
syntax @Long@ is parsed as the Crucible-LLVM 64-bit bitvector type for the
x86_64 Linux target ('x86_64LinuxTypes'), but the 32-bit bitvector type for
32-bit ARM Linux targets ('aarch32LinuxTypes'). This can be useful if you want
to write Crucible CFGs that can be simulated in the context of LLVM modules
for several different architectures, for example if you want to override system
calls.
-}

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
Expand Down

0 comments on commit 22bd7b7

Please sign in to comment.