本文整理汇总了C++中Address::getAddressee方法的典型用法代码示例。如果您正苦于以下问题:C++ Address::getAddressee方法的具体用法?C++ Address::getAddressee怎么用?C++ Address::getAddressee使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::getAddressee方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resolveWholeGraph
/// \brief Resolves the whole graph
void OffsetBasedAliasAnalysis::resolveWholeGraph() {
std::deque<OffsetPointer*> dq;
for(auto i : offset_pointers) i.second->color = 0;
for(auto i : offset_pointers) {
if(i.second->getPointerType() != OffsetPointer::Cont
and i.second->color == 0) {
DFS_visit_t(i.second, &dq);
}
}
while(!dq.empty()) {
OffsetPointer* rp = dq.front();
dq.pop_front();
std::deque<Address*> ad;
std::set<Address*> fn;
for(auto j = rp->addr_begin(), je = rp->addr_end(); j != je; j++)
ad.push_front(*j);
while(!ad.empty()) {
Address* addr = ad.front();
ad.pop_front();
if(addr->getBase() == addr->getAddressee()) {
//if the base is the very addressee, then we have a meaningless loop
delete addr;
} else if(addr->getBase()->getPointerType() == OffsetPointer::Phi
or addr->getBase()->getPointerType() == OffsetPointer::Cont) {
//if its a phi or a continuous pointer there must be expansion
addr->Expand(ad, fn);
} else {
//if its not a phi or a continuous pointer there's nothing more to
// be done
fn.insert(addr);
}
}
}
}
示例2: resolveWholeGraph
// Resolves the whole graph
void RangeBasedPointerAnalysis::resolveWholeGraph()
{
std::deque<RangedPointer*> dq;
for(auto i : RangedPointers) i.second->color = 0;
for(auto i : RangedPointers)
{
if(i.second->getPointerType() != RangedPointer::Cont
and i.second->color == 0)
{
DFS_visit(i.second, &dq);
}
}
/*std::cout << "Expanded sizes:\n";
for(auto i : RangedPointers)
{
for(auto j : i.second->Addresses)
{
std::cout << j->expanded.size();
if(j->expanded.find(i.second) != j->expanded.end())
std::cout << "SIM ";
else
std::cout << "NAO ";
}
std::cout << "\n";
}
int n;
std::cin >> n;
*/
while(!dq.empty())
{
RangedPointer* rp = dq.front();
dq.pop_front();
std::deque<Address*> ad;
std::set<Address*> fn;
for(auto j = rp->addr_begin(), je = rp->addr_end(); j != je; j++)
ad.push_front(*j);
while(!ad.empty())
{
Address* addr = ad.front();
ad.pop_front();
if(addr->getBase() == addr->getAddressee())
{
delete addr;
}
else if(addr->getBase()->getPointerType() == RangedPointer::Phi
or addr->getBase()->getPointerType() == RangedPointer::Cont)
{
//std::cout << "expand ";
addr->Expand(ad, fn);
}
else
{
//std::cout << "insert\n";
fn.insert(addr);
}
}
}
}