diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-08-19 04:18:11 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-08-19 04:18:11 +0000 |
commit | 7d23b4a6e855f156bbd30cf2702ebbeb5bc57028 (patch) | |
tree | 19784f2f95a772a30d04ca123abb30f626a3baa5 | |
parent | 0473cd52eac6f1e831777ed899be3ea4509c7b24 (diff) |
Reflow code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138032 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 4856278cf4..70e684b36e 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -261,14 +261,15 @@ static bool checkIsPointer(Sema &S, const Decl *D, const AttributeList &Attr) { /// \brief Checks that the passed in QualType either is of RecordType or points /// to RecordType. Returns the relevant RecordType, null if it does not exit. -const RecordType *getRecordType(QualType QT) { - const RecordType *RT = QT->getAs<RecordType>(); - // now check if we point to record type - if(!RT && QT->isPointerType()){ - QualType PT = QT->getAs<PointerType>()->getPointeeType(); - RT = PT->getAs<RecordType>(); - } +static const RecordType *getRecordType(QualType QT) { + if (const RecordType *RT = QT->getAs<RecordType>()) return RT; + + // Now check if we point to record type. + if (const PointerType *PT = QT->getAs<PointerType>()) + return PT->getPointeeType()->getAs<RecordType>(); + + return 0; } /// \brief Thread Safety Analysis: Checks that all attribute arguments, starting |