Implement some of the methods in DccImpl
This commit is contained in:
parent
d1738ea630
commit
a944ea5da8
@ -32,8 +32,8 @@ public:
|
|||||||
typedef llvm::iplist<Function> FunctionListType;
|
typedef llvm::iplist<Function> FunctionListType;
|
||||||
typedef FunctionListType lFunction;
|
typedef FunctionListType lFunction;
|
||||||
typedef FunctionListType::iterator ilFunction;
|
typedef FunctionListType::iterator ilFunction;
|
||||||
SYMTAB symtab; /* Global symbol table */
|
|
||||||
|
|
||||||
|
SYMTAB symtab; /* Global symbol table */
|
||||||
FunctionListType pProcList;
|
FunctionListType pProcList;
|
||||||
CALL_GRAPH * callGraph; /* Pointer to the head of the call graph */
|
CALL_GRAPH * callGraph; /* Pointer to the head of the call graph */
|
||||||
PROG prog; /* Loaded program image parameters */
|
PROG prog; /* Loaded program image parameters */
|
||||||
@ -67,6 +67,7 @@ public:
|
|||||||
SourceMachine *machine();
|
SourceMachine *machine();
|
||||||
|
|
||||||
const FunctionListType &functions() const { return pProcList; }
|
const FunctionListType &functions() const { return pProcList; }
|
||||||
|
FunctionListType &functions() { return pProcList; }
|
||||||
protected:
|
protected:
|
||||||
void initialize();
|
void initialize();
|
||||||
void writeGlobSymTable();
|
void writeGlobSymTable();
|
||||||
|
|||||||
@ -2,21 +2,23 @@
|
|||||||
#include "dcc.h"
|
#include "dcc.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
struct DccImpl : public IDcc {
|
struct DccImpl : public IDcc {
|
||||||
|
ilFunction m_current_func;
|
||||||
|
|
||||||
// IDcc interface
|
// IDcc interface
|
||||||
public:
|
public:
|
||||||
void BaseInit()
|
void BaseInit()
|
||||||
{
|
{
|
||||||
|
m_current_func = Project::get()->functions().end();
|
||||||
}
|
}
|
||||||
void Init(QObject *tgt)
|
void Init(QObject *tgt)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
ilFunction GetFirstFuncHandle()
|
ilFunction GetFirstFuncHandle()
|
||||||
{
|
{
|
||||||
|
return Project::get()->functions().begin();
|
||||||
}
|
}
|
||||||
ilFunction GetCurFuncHandle()
|
ilFunction GetCurFuncHandle()
|
||||||
{
|
{
|
||||||
|
return m_current_func;
|
||||||
}
|
}
|
||||||
void analysis_Once()
|
void analysis_Once()
|
||||||
{
|
{
|
||||||
@ -34,13 +36,17 @@ public:
|
|||||||
}
|
}
|
||||||
size_t getFuncCount()
|
size_t getFuncCount()
|
||||||
{
|
{
|
||||||
|
return Project::get()->functions().size();
|
||||||
}
|
}
|
||||||
const lFunction &validFunctions() const
|
const lFunction &validFunctions() const
|
||||||
{
|
{
|
||||||
return Project::get()->functions();
|
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() {
|
QDir installDir() {
|
||||||
return QDir(".");
|
return QDir(".");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user