void DefUseManager::ForEachUser( uint32_t id, const std::function<void(Instruction*)>& f) const { ForEachUser(GetDef(id), f); }
bool DefUseManager::WhileEachUse( uint32_t id, const std::function<bool(Instruction*, uint32_t)>& f) const { return WhileEachUse(GetDef(id), f); }
bool Hex::HasArtifact() const { return GetDef().HasArtifact(); }
bool Hex::HasDiscovery() const { return GetDef().HasDiscovery(); }
EdgeSet Hex::GetWormholes() const { return GetDef().GetWormholes(); }
int Hex::GetVictoryPoints() const { return GetDef().GetVictoryPoints(); }
SquareType Square::GetType() const { return GetDef().GetType(); }
int Square::GetY() const { return GetDef().GetY(); }
void Hex::InitSquares() { VERIFY_MODEL(m_squares.empty()); for (int i = 0; i < GetDef().GetSquareCount(); ++i) m_squares.push_back(Square(*this, i)); }
bool Hex::HasWormhole(Edge e) const { return GetDef().GetWormholes()[RotateEdge(e, -m_nRotation)]; }
TechType Square::GetRequiredTech() const { return GetDef().GetRequiredTech(); }
bool RangeCheck::IsMonotonicallyIncreasing(GenTreePtr expr, SearchPath* path) { JITDUMP("[RangeCheck::IsMonotonicallyIncreasing] %p\n", dspPtr(expr)); if (path->Lookup(expr)) { return true; } // Add hashtable entry for expr. path->Set(expr, NULL); // Remove hashtable entry for expr when we exit the present scope. auto code = [&] { path->Remove(expr); }; jitstd::utility::scoped_code<decltype(code)> finally(code); // If the rhs expr is constant, then it is not part of the dependency // loop which has to increase monotonically. ValueNum vn = expr->gtVNPair.GetConservative(); if (path->GetCount() > MAX_SEARCH_DEPTH) { return false; } else if (m_pCompiler->vnStore->IsVNConstant(vn)) { return true; } // If the rhs expr is local, then try to find the def of the local. else if (expr->IsLocal()) { Location* loc = GetDef(expr); if (loc == nullptr) { return false; } GenTreePtr asg = loc->parent; assert(asg->OperKind() & GTK_ASGOP); switch (asg->OperGet()) { case GT_ASG: return IsMonotonicallyIncreasing(asg->gtGetOp2(), path); case GT_ASG_ADD: return IsBinOpMonotonicallyIncreasing(asg->gtGetOp1(), asg->gtGetOp2(), GT_ADD, path); default: // All other 'asg->OperGet()' kinds, return false break; } JITDUMP("Unknown local definition type\n"); return false; } else if (expr->OperGet() == GT_ADD) { return IsBinOpMonotonicallyIncreasing(expr->gtGetOp1(), expr->gtGetOp2(), GT_ADD, path); } else if (expr->OperGet() == GT_PHI) { for (GenTreeArgList* args = expr->gtOp.gtOp1->AsArgList(); args != nullptr; args = args->Rest()) { // If the arg is already in the path, skip. if (path->Lookup(args->Current())) { continue; } if (!IsMonotonicallyIncreasing(args->Current(), path)) { JITDUMP("Phi argument not monotonic\n"); return false; } } return true; } JITDUMP("Unknown tree type\n"); return false; }
HRESULT SymTypedef::GetDecl( CString &Info ) { return GetDef(Info); }
HRESULT SymDataType::GetDecl( CString &Info ) { return GetDef(Info); }
Pt3dr cReadObject::GetDef(const Pt3dr & aVal,const double & aDef) { return Pt3dr ( GetDef(aVal.x,aDef), GetDef(aVal.y,aDef), GetDef(aVal.z,aDef)); }