summaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/ThreadSafetyCommon.cpp
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2025-09-10 15:25:31 -0700
committerGitHub <noreply@github.com>2025-09-10 15:25:31 -0700
commit1417dafa1db9cb1b2b09438aa9f53ea5ab6e36e2 (patch)
tree57f4b1f313c8cf74eed8819870f39c36ea263c68 /clang/lib/Analysis/ThreadSafetyCommon.cpp
parent898b813bc8a6d0276bf0f4769f5f2f64b34e632d (diff)
parentb8cefcb601ddaa18482555c4ff363c01a270c2fe (diff)
Merge branch 'main' into users/mingmingl-llvm/samplefdo-profile-formatusers/mingmingl-llvm/samplefdo-profile-format
Diffstat (limited to 'clang/lib/Analysis/ThreadSafetyCommon.cpp')
-rw-r--r--clang/lib/Analysis/ThreadSafetyCommon.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Analysis/ThreadSafetyCommon.cpp b/clang/lib/Analysis/ThreadSafetyCommon.cpp
index f560dd8ae1dd..68c27eeb7e8e 100644
--- a/clang/lib/Analysis/ThreadSafetyCommon.cpp
+++ b/clang/lib/Analysis/ThreadSafetyCommon.cpp
@@ -83,13 +83,11 @@ static std::pair<StringRef, bool> classifyCapability(QualType QT) {
// We need to look at the declaration of the type of the value to determine
// which it is. The type should either be a record or a typedef, or a pointer
// or reference thereof.
- if (const auto *RT = QT->getAs<RecordType>()) {
- if (const auto *RD = RT->getOriginalDecl())
- return classifyCapability(*RD->getDefinitionOrSelf());
- } else if (const auto *TT = QT->getAs<TypedefType>()) {
- if (const auto *TD = TT->getDecl())
- return classifyCapability(*TD);
- } else if (QT->isPointerOrReferenceType())
+ if (const auto *RD = QT->getAsRecordDecl())
+ return classifyCapability(*RD);
+ if (const auto *TT = QT->getAs<TypedefType>())
+ return classifyCapability(*TT->getDecl());
+ if (QT->isPointerOrReferenceType())
return classifyCapability(QT->getPointeeType());
return ClassifyCapabilityFallback;