UserValue *LDVImpl::getUserValue(const MDNode *Var, unsigned Offset) { UserValue *&Leader = userVarMap[Var]; if (Leader) { UserValue *UV = Leader->getLeader(); Leader = UV; for (; UV; UV = UV->getNext()) if (UV->match(Var, Offset)) return UV; } UserValue *UV = new UserValue(Var, Offset, allocator); userValues.push_back(UV); Leader = UserValue::merge(Leader, UV); return UV; }
UserValue *LDVImpl::getUserValue(const MDNode *Var, const MDNode *Expr, bool IsIndirect, const DebugLoc &DL) { UserValue *&Leader = userVarMap[Var]; if (Leader) { UserValue *UV = Leader->getLeader(); Leader = UV; for (; UV; UV = UV->getNext()) if (UV->match(Var, Expr, DL->getInlinedAt(), IsIndirect)) return UV; } userValues.push_back( llvm::make_unique<UserValue>(Var, Expr, IsIndirect, DL, allocator)); UserValue *UV = userValues.back().get(); Leader = UserValue::merge(Leader, UV); return UV; }
UserValue *LDVImpl::getUserValue(const MDNode *Var, unsigned Offset, bool IsIndirect, DebugLoc DL) { UserValue *&Leader = userVarMap[Var]; if (Leader) { UserValue *UV = Leader->getLeader(); Leader = UV; for (; UV; UV = UV->getNext()) if (UV->match(Var, Offset, IsIndirect)) return UV; } userValues.push_back( make_unique<UserValue>(Var, Offset, IsIndirect, DL, allocator)); UserValue *UV = userValues.back().get(); Leader = UserValue::merge(Leader, UV); return UV; }