Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F3995708
cfgpass.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jul 7, 9:45 PM
Size
778 B
Mime Type
text/x-c++
Expires
Thu, Jul 9, 9:45 PM (1 d, 12 h)
Engine
blob
Format
Raw Data
Handle
271655
Attached To
rXR Xreate
cfgpass.cpp
View Options
#include "cfgpass.h"
#include <QString>
using namespace std;
using namespace xreate;
void
CFGPass::start()
{
__context.graph = CFGraph();
}
void
CFGPass::finish()
{
man->clasp->addCFGData(move(__context.graph));
}
CFGPass::CFGPass(PassManager* manager)
: ASTPass(manager)
{
man->registerFilter(this, PassFilter:: FUNCTION);
man->registerFilter(this, PassFilter:: FUNCTIONCALL);
}
void
CFGPass::process(ManagedFnPtr function, PassContext context)
{
//FUNCTION decl
if (context.function == function)
{
const string& name = function->getName();
__context.graph.addNode(function.id(), string(name));
return;
}
//FUNCTIONCALL decl
__context.graph.addLink(context.function.id(), function.id());
}
Event Timeline
Log In to Comment