Implement some of the methods in DccImpl

This commit is contained in:
nemerle 2016-04-26 09:23:34 +02:00
parent d1738ea630
commit a944ea5da8
2 changed files with 48 additions and 41 deletions

View File

@ -32,8 +32,8 @@ public:
typedef llvm::iplist<Function> FunctionListType;
typedef FunctionListType lFunction;
typedef FunctionListType::iterator ilFunction;
SYMTAB symtab; /* Global symbol table */
SYMTAB symtab; /* Global symbol table */
FunctionListType pProcList;
CALL_GRAPH * callGraph; /* Pointer to the head of the call graph */
PROG prog; /* Loaded program image parameters */
@ -67,6 +67,7 @@ public:
SourceMachine *machine();
const FunctionListType &functions() const { return pProcList; }
FunctionListType &functions() { return pProcList; }
protected:
void initialize();
void writeGlobSymTable();

View File

@ -2,21 +2,23 @@
#include "dcc.h"
#include "project.h"
struct DccImpl : public IDcc {
ilFunction m_current_func;
// IDcc interface
public:
void BaseInit()
{
m_current_func = Project::get()->functions().end();
}
void Init(QObject *tgt)
{
}
ilFunction GetFirstFuncHandle()
{
return Project::get()->functions().begin();
}
ilFunction GetCurFuncHandle()
{
return m_current_func;
}
void analysis_Once()
{
@ -34,13 +36,17 @@ public:
}
size_t getFuncCount()
{
return Project::get()->functions().size();
}
const lFunction &validFunctions() const
{
return Project::get()->functions();
}
void SetCurFunc_by_Name(QString)
void SetCurFunc_by_Name(QString v)
{
if(m_current_func!=Project::get()->functions().end()) {
m_current_func->name = v;
}
}
QDir installDir() {
return QDir(".");