crux-llvm-0.8: A verification tool for C programs.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crux.LLVM.Compile

Synopsis

Documentation

getClang :: IO FilePath Source #

attempt to find Clang executable by searching the file system throw an error if it cannot be found this way. (NOTE: do not look for environment var CLANG. That is assumed to be tried already.)

genBitCode :: Logs msgs => SupportsCruxLLVMLogMessage msgs => CruxOptions -> LLVMOptions -> IO FilePath Source #

Generates compiled LLVM bitcode for the set of input files specified in the CruxOptions argument, writing the output to a pre-determined filename in the build directory specified in CruxOptions.

genBitCodeToFile :: Logs msgs => SupportsCruxLLVMLogMessage msgs => String -> [FilePath] -> CruxOptions -> LLVMOptions -> Bool -> IO FilePath Source #

Given the target filename and a list of input files, along with the crux and llvm options, bitcode-compile each input .c file and link the resulting files, along with any input .ll files into the target bitcode (BC) file. Returns the filepath of the target bitcode file.

crucibleFlagsFromSrc :: FilePath -> IO [String] Source #

A C source file being compiled and evaluated by crux can contain zero or more lines matching the following:

  /* CRUCIBLE clang_flags: {FLAGS} */
  // CRUCIBLE clang_flags: {FLAGS}
  /* CRUX clang_flags: {FLAGS} */
  // CRUX clang_flags: {FLAGS}

Note that the "clang_flags" portion is case-insensitive, although the CRUCIBLE or CRUX prefix is case sensitive and must be capitalized.

All {FLAGS} will be collected as a set of space-separated words. Flags from multiple lines will be concatenated together (without any attempt to eliminate duplicates or conflicts) and the result will be passed as additional flags to the clang compilation of the source by Crux.

The above line matching is whitespace-sensitive and case-sensitive. When C-style comment syntax is used, the comment must be closed on the same line as it was opened (although there is no line length restriction).