本文整理汇总了C++中NodeValue::getNode方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeValue::getNode方法的具体用法?C++ NodeValue::getNode怎么用?C++ NodeValue::getNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeValue
的用法示例。
在下文中一共展示了NodeValue::getNode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printNode
/// printNodes -- print the node specified by NV
///
/// Format:
/// "flags:{value(s)}:{type(s)}"
///
/// Additionally, the user can specify to print just one piece
static void printNode(llvm::raw_ostream &O, NodeValue &NV) {
assert(
((!OnlyPrintFlags && !OnlyPrintValues)||
(!OnlyPrintFlags && !OnlyPrintTypes) ||
(!OnlyPrintValues && !OnlyPrintTypes)) &&
"Only one \"Only\" option allowed!");
if (OnlyPrintFlags) {
printFlags(O,NV.getNode());
} else if (OnlyPrintValues) {
printAllValuesForNode(O, NV);
} else if (OnlyPrintTypes) {
printTypesForNode(O, NV);
} else {
//Print all of them
printFlags(O,NV.getNode());
O << ":{";
printAllValuesForNode(O, NV);
O << "}:{";
printTypesForNode(O, NV);
O << "}";
}
O << "\n";
}
示例2: replaceAllUsesOfWith
void NodeValue::replaceAllUsesOfWith(NodeValue v) {
if (v.getNode()) {
assert(getType() == v.getType() && "Replacing value with the wrong type");
}
auto &users = node_->getUsers();
llvm::SmallVector<NodeUse, 4> usersVec(users.begin(), users.end());
for (auto &U : usersVec) {
NodeValue *site = U.get();
assert(site->getNode() == node_ && "Invalid user");
if (site->getResNo() == getResNo()) {
site->setOperand(v.getNode(), v.getResNo());
}
}
}
示例3: printTypesForNode
// printTypesForNode --prints all the types for the given NodeValue, without a newline
// (meant to be called as a helper)
static void printTypesForNode(llvm::raw_ostream &O, NodeValue &NV) {
DSNode *N = NV.getNode();
if (N->isNodeCompletelyFolded()) {
O << "Folded";
}
// Go through all the types, and just dump them.
// FIXME: Lifted from Printer.cpp, probably should be shared
bool firstType = true;
if (N->type_begin() != N->type_end())
for (DSNode::TyMapTy::const_iterator ii = N->type_begin(),
ee = N->type_end(); ii != ee; ++ii) {
if (!firstType) O << "::";
firstType = false;
O << ii->first << ":";
if (ii->second) {
bool first = true;
for (svset<Type*>::const_iterator ni = ii->second->begin(),
ne = ii->second->end(); ni != ne; ++ni) {
if (!first) O << "|";
Type * t = *ni;
t->print (O);
first = false;
}
}
else
O << "VOID";
}
else
O << "VOID";
if (N->isArrayNode())
O << "Array";
}
示例4: setOperand
void NodeUse::setOperand(NodeValue &other) {
if (other && site_->getNode()) {
assert(site_->getType() == other.getType() &&
"Setting operand to a node with a different type");
}
site_->setOperand(other.getNode(), other.getResNo());
}
示例5: count
bool UnownedNodeValueMap::count(NodeValue from) {
for (auto &E : entries_) {
auto &F = E.first;
if (F.first == from.getNode() && F.second == from.getResNo()) {
return true;
}
}
return false;
}
示例6: get
NodeValue UnownedNodeValueMap::get(NodeValue from) {
for (auto &E : entries_) {
auto &F = E.first;
auto &T = E.second;
if (F.first == from.getNode() && F.second == from.getResNo()) {
return NodeValue(T.first, T.second);
}
}
llvm_unreachable("Invalid node");
return NodeValue(nullptr, 0);
}
示例7: insert
void UnownedNodeValueMap::insert(NodeValue from, NodeValue to) {
entries_.push_front(
{{from.getNode(), from.getResNo()}, {to.getNode(), to.getResNo()}});
}