Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4825501
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, Aug 25, 7:39 AM
Size
778 B
Mime Type
text/x-c++
Expires
Thu, Aug 27, 7:39 AM (1 d, 6 h)
Engine
blob
Format
Raw Data
Handle
287056
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