diff options
author | Martin Braenne <mboehme@google.com> | 2023-04-05 12:32:13 +0000 |
---|---|---|
committer | Martin Braenne <mboehme@google.com> | 2023-04-06 07:26:24 +0000 |
commit | effdfa7d5f49b00b4c0d36f7c6835b519b0f46bb (patch) | |
tree | 5df593ba44930581e297c05fb5af09e3c226d7dd /clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | |
parent | db6b30b1831095c216378a9df215b7c0ae6b959f (diff) | |
download | llvm-effdfa7d5f49b00b4c0d36f7c6835b519b0f46bb.zip llvm-effdfa7d5f49b00b4c0d36f7c6835b519b0f46bb.tar.gz llvm-effdfa7d5f49b00b4c0d36f7c6835b519b0f46bb.tar.bz2 |
[clang][dataflow] Use `isRecordType()` where appropriate.
This is less verbose than checking for class, struct, and union individually,
and I believe it's also more efficient (not that that should be the overriding
concern).
Reviewed By: sammccall, xazax.hun
Differential Revision: https://reviews.llvm.org/D147603
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp')
-rw-r--r-- | clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp index 4d8a42c..1fbc375 100644 --- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp +++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp @@ -45,8 +45,7 @@ DataflowAnalysisContext::getReferencedFields(QualType Type) { } 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 |