mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 04:14:03 +08:00
[clang] Call *set::insert without checking membership first (NFC)
This commit is contained in:
@@ -457,8 +457,7 @@ Value *Environment::createValueUnlessSelfReferential(
|
||||
QualType PointeeType = Type->castAs<ReferenceType>()->getPointeeType();
|
||||
auto &PointeeLoc = createStorageLocation(PointeeType);
|
||||
|
||||
if (!Visited.contains(PointeeType.getCanonicalType())) {
|
||||
Visited.insert(PointeeType.getCanonicalType());
|
||||
if (Visited.insert(PointeeType.getCanonicalType()).second) {
|
||||
Value *PointeeVal = createValueUnlessSelfReferential(
|
||||
PointeeType, Visited, Depth, CreatedValuesCount);
|
||||
Visited.erase(PointeeType.getCanonicalType());
|
||||
@@ -475,8 +474,7 @@ Value *Environment::createValueUnlessSelfReferential(
|
||||
QualType PointeeType = Type->castAs<PointerType>()->getPointeeType();
|
||||
auto &PointeeLoc = createStorageLocation(PointeeType);
|
||||
|
||||
if (!Visited.contains(PointeeType.getCanonicalType())) {
|
||||
Visited.insert(PointeeType.getCanonicalType());
|
||||
if (Visited.insert(PointeeType.getCanonicalType()).second) {
|
||||
Value *PointeeVal = createValueUnlessSelfReferential(
|
||||
PointeeType, Visited, Depth, CreatedValuesCount);
|
||||
Visited.erase(PointeeType.getCanonicalType());
|
||||
|
||||
@@ -14473,8 +14473,7 @@ static void RecordModifiableNonNullParam(Sema &S, const Expr *Exp) {
|
||||
if (!FD->hasAttr<NonNullAttr>() && !Param->hasAttr<NonNullAttr>())
|
||||
return;
|
||||
if (FunctionScopeInfo *FD = S.getCurFunction())
|
||||
if (!FD->ModifiedNonNullParams.count(Param))
|
||||
FD->ModifiedNonNullParams.insert(Param);
|
||||
FD->ModifiedNonNullParams.insert(Param);
|
||||
}
|
||||
|
||||
/// CheckIndirectionOperand - Type check unary indirection (prefix '*').
|
||||
|
||||
@@ -4321,9 +4321,8 @@ void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) {
|
||||
if (Attr.isSubClassOf("TargetSpecificAttr") &&
|
||||
!Attr.isValueUnset("ParseKind")) {
|
||||
AttrName = std::string(Attr.getValueAsString("ParseKind"));
|
||||
if (Seen.find(AttrName) != Seen.end())
|
||||
if (!Seen.insert(AttrName).second)
|
||||
continue;
|
||||
Seen.insert(AttrName);
|
||||
} else
|
||||
AttrName = NormalizeAttrName(StringRef(Attr.getName())).str();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user