Skip to content
Commits on Source (11)
/**
* @file App.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details APP class for Tindger program - main function App::run()
*/
......
/**
* @file App.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details APP class for Tindger program:
* works with input data structure (@see AppParams.h) and dependencies
......
/**
* @file AppParams.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Structure to hold parsed program options
*/
......
/**
* @file ArgParser.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Class for parsing CLI arguments to structure AppParams holding fomatted program options
* - arg parsing implemented using getopt lib
......
/**
* @file ConfigParse.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Simple class for parsing control config data pased in json formatted file to structure used by App
*/
......
/**
* @file Diagnostic.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Class for measuring and storing data about App run
*/
#ifndef TINDGER_DIAGNOSTIC_H
#define TINDGER_DIAGNOSTIC_H
......
/**
* @file ExtactionPath.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2019
*
* @details Structure for holding information about program path to be analysed.
*/
#ifndef TINDGER_EXTRACTIONPATHPLAN_H
#define TINDGER_EXTRACTIONPATHPLAN_H
......
llvmextractor - module handling LLVM IR input processing
model - module for LLVM IR model analysis
smt - module for generating SMT expressions for solving path semantics reachability
App.cpp - main Application class wrapping dependencies and basic workflow of tindger program \
App.h \
......
/**
* @file BasicBlockLabeler.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Class for generating llvm object names and assign them to IR model implementation.
*/
......
/**
* @file BasicBlockLabeler.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Class for generating llvm object names and assign them to IR model.
* The approach used is based on how llvm labels values internally in CFGPrinter for export to text representation.
......
/**
* @file FunctionSelector.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Wrapper class for accessing internal objects of LLVM in-memory model on Function level.
* @see ModuleSelector.h
......
/**
* @file FunctionSelector.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Wrapper class for accessing internal objects of LLVM in-memory model on Function level.
* @see ModuleSelector.h
......
/**
* @file LLVMExtractor.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details LLVMExtractorInterface default implementation
* @see LLVMExtractorInterface.h
......@@ -24,7 +24,6 @@ namespace tindger {
*/
std::unique_ptr<LLVMModuleSelectorInterface> LLVMExtractor::extractIRModule(const std::string inputFilename)
{
// todo change APP api to accept already extracted string with LLVM IR CODE
ErrorOr<std::unique_ptr<MemoryBuffer>> irFileOrError = MemoryBuffer::getFileOrSTDIN(inputFilename);
if (irFileOrError.getError()) {
throw LLVMExtractionException("LLVM IR file: " + inputFilename + " could not be parse. Error: " +
......@@ -71,15 +70,13 @@ namespace tindger {
for (const auto &instruction : basicBlock->getInstList()) {
std::vector<tindger::Value> operands{};
for (const auto &operand : instruction.operands()) {
/* todo auto value = tindgerValueFromLLVMValue(operand.get()); */
// use LLVM roled dynamic cast here
if (instruction.getOpcode() == llvm::Instruction::Alloca) {
// todo skip on allocas
continue;
}
if (instruction.getOpcode() == llvm::Instruction::Br) {
// todo skip on Br -> will be replaced with branch condition assert for correct BB label evaluation
// skip on Br -> will be replaced with branch condition assert for correct BB label evaluation
continue;
}
......@@ -106,7 +103,6 @@ namespace tindger {
std::unique_ptr<tindger::Type> instructionType;
if (instruction.getOpcode() == llvm::Instruction::Alloca) {
// todo
// for alloca instruction use pointer base class type
instructionType = typeConverter.convert(*(instruction.getOperand(0)->getType()));
} else {
......
/**
* @file LLVMExtractor.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details LLVMExtractorInterface default implementation
* @see LLVMExtractorInterface.h
......
/**
* @file LLVMExtractorInterface.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Interface for extracting in-memory model of LLVM IR code
* and converting it to simplified and linearized data model
......@@ -43,7 +43,8 @@ namespace tindger {
struct LLVMExtractionException : std::runtime_error
{
LLVMExtractionException(const std::string &message) : std::runtime_error("LLVM IR extraction failed: " + message) {}
LLVMExtractionException(const std::string &message) : std::runtime_error(
"LLVM IR extraction failed: " + message) {}
};
};
......
/**
* @file ModuleSelector.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Wrapper class for accessing internal objects of LLVM in-memory model on Module level.
* @see llvm/IR/Module.h
......
/**
* @file PathView.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Representation of function execution path for analysis containing list of visited Basic Blocks
* @see llvm/IR/BasicBlock.h
......
submodule for handling LLVM IR input processing
BasicBlockLabeler.cpp - class for assigning names to LLVM model basic blocks labels and variables names
BasicBlockLabeler.h
FunctionSelector.cpp - wrapper for accessing basic blocks and arguments of LLVM function object
......
/**
* @file TypeConverter.cpp
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Converts LLVM types to tindger type
*/
......
/**
* @file TypeConverter.h
* @author Tomas Susovsky <xsusov01@stud.fit.vutbr.cz>
* @date 2018
* @date 2019
*
* @details Converts LLVM types to tindger type
*/
......