Does KLEE actually generate code? Does it carry out any of the other Benchmark steps of compilers/interpreters? (Lexical Analysis, Syntax Analysis, Semantic analysis, code optimization, intermediate code generation, code generation, symbol table linking )
Asked
Active
Viewed 131 times
1 Answers
2
It mainly relies on LLVM regular optimizations, but also provides a few customized transformations; see lib/Module
for details.
For the libc runtime, it links the additional IRs that is specified by the option -libc
(none, klee, uclibc) ; and if posix runtime is enabled (-posix-runtime
), the original main function in the input bitcode file is replaced with the one that can symbolize the argv
. The final IR that is executed/interpreted by KLEE is assembly.ll
in klee-last directory of your test case. In the rest part, KLEE is an interpreter for assembly.ll
.

Hongxu Chen
- 5,240
- 2
- 45
- 85
-
OK, it interprets llvm bit code. During this process process does it carry out lexical analysis, syntax analysis, semantic analysis, code optimization (I believe it does this), code generation and symbol table linking – user56683 Feb 20 '15 at 13:52
-
what do you mean by saying *lexical analysis, syntax analysis, semantic analysis*? bitcode is encoded in a binary file. – Hongxu Chen Feb 21 '15 at 04:21
-
So by it being in a binary file, it is unabale to check for lexicon, syntax and semantic errors? – user56683 Feb 23 '15 at 03:45
-
as [wikipedia](https://en.wikipedia.org/wiki/Lexical_analysis) says: lexical analysis is the process of converting a sequence of characters into a sequence of tokens. You should tell exactly what you are going to do with KLEE. – Hongxu Chen Feb 23 '15 at 04:07