This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeffdfa7d5f49: [clang][dataflow] Use `isRecordType()` where appropriate. (authored by mboehme).
Changed prior to commit: https://reviews.llvm.org/D147603?vs=511062&id=511298#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147603/new/ https://reviews.llvm.org/D147603 Files: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp Index: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp +++ clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp @@ -608,7 +608,7 @@ auto &AggregateLoc = *cast<AggregateStorageLocation>(&Loc); const QualType Type = AggregateLoc.getType(); - assert(Type->isStructureOrClassType() || Type->isUnionType()); + assert(Type->isRecordType()); for (const FieldDecl *Field : DACtx->getReferencedFields(Type)) { assert(Field != nullptr); @@ -708,7 +708,7 @@ return &create<PointerValue>(PointeeLoc); } - if (Type->isStructureOrClassType() || Type->isUnionType()) { + if (Type->isRecordType()) { CreatedValuesCount++; llvm::DenseMap<const ValueDecl *, Value *> FieldValues; for (const FieldDecl *Field : DACtx->getReferencedFields(Type)) { Index: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp +++ clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp @@ -45,8 +45,7 @@ } StorageLocation &DataflowAnalysisContext::createStorageLocation(QualType Type) { - if (!Type.isNull() && - (Type->isStructureOrClassType() || Type->isUnionType())) { + if (!Type.isNull() && Type->isRecordType()) { llvm::DenseMap<const ValueDecl *, StorageLocation *> FieldLocs; // During context-sensitive analysis, a struct may be allocated in one // function, but its field accessed in a function lower in the stack than
Index: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp +++ clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp @@ -608,7 +608,7 @@ auto &AggregateLoc = *cast<AggregateStorageLocation>(&Loc); const QualType Type = AggregateLoc.getType(); - assert(Type->isStructureOrClassType() || Type->isUnionType()); + assert(Type->isRecordType()); for (const FieldDecl *Field : DACtx->getReferencedFields(Type)) { assert(Field != nullptr); @@ -708,7 +708,7 @@ return &create<PointerValue>(PointeeLoc); } - if (Type->isStructureOrClassType() || Type->isUnionType()) { + if (Type->isRecordType()) { CreatedValuesCount++; llvm::DenseMap<const ValueDecl *, Value *> FieldValues; for (const FieldDecl *Field : DACtx->getReferencedFields(Type)) { Index: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp =================================================================== --- clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp +++ clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp @@ -45,8 +45,7 @@ } StorageLocation &DataflowAnalysisContext::createStorageLocation(QualType Type) { - if (!Type.isNull() && - (Type->isStructureOrClassType() || Type->isUnionType())) { + if (!Type.isNull() && Type->isRecordType()) { llvm::DenseMap<const ValueDecl *, StorageLocation *> FieldLocs; // During context-sensitive analysis, a struct may be allocated in one // function, but its field accessed in a function lower in the stack than
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits