43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "libSage++.h"
|
|
#include <map>
|
|
#include <string>
|
|
#include <set>
|
|
#include <vector>
|
|
|
|
using ResultSet = std::set<std::tuple<std::string, int, std::string>>;
|
|
|
|
enum class MODE
|
|
{
|
|
BEFORE,
|
|
AFTER
|
|
};
|
|
|
|
static std::map<FuncInfo*, std::vector<SAPFOR::Instruction*>> call_sites;
|
|
|
|
template<typename Iterator>
|
|
void extract_vars_from_reg(std::set<SAPFOR::Argument*>& worklist,
|
|
SAPFOR::Argument* reg,
|
|
Iterator instr,
|
|
Iterator first_instr);
|
|
|
|
|
|
template<typename Iterator>
|
|
void processArgument(std::set<SAPFOR::Argument*>& worklist,
|
|
SAPFOR::Argument* arg,
|
|
Iterator instr,
|
|
Iterator first_instr);
|
|
|
|
void lookup_for_vars(std::set<std::tuple<SgStatement*, std::string, MODE>>& where_to_add,
|
|
std::set<SAPFOR::Argument*>& worklist,
|
|
SAPFOR::Instruction* instr,
|
|
SAPFOR::BasicBlock* bblock,
|
|
FuncInfo* cur_func,
|
|
const std::map<FuncInfo*, std::vector<SAPFOR::BasicBlock*>>& fullIR);
|
|
|
|
void
|
|
findParameters(ResultSet& foundParameters,
|
|
std::map<FuncInfo*, std::vector<SAPFOR::BasicBlock*>>& fullIR,
|
|
const std::map<std::tuple<int, std::string, std::string>, std::pair<DIST::Array*, DIST::ArrayAccessInfo*>>& declaredArrays);
|