From: Benjamin Kramer Date: Fri, 19 Aug 2011 04:18:11 +0000 (+0000) Subject: Reflow code. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d23b4a6e855f156bbd30cf2702ebbeb5bc57028;p=clang Reflow code. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138032 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(); - // now check if we point to record type - if(!RT && QT->isPointerType()){ - QualType PT = QT->getAs()->getPointeeType(); - RT = PT->getAs(); - } +static const RecordType *getRecordType(QualType QT) { + if (const RecordType *RT = QT->getAs()) return RT; + + // Now check if we point to record type. + if (const PointerType *PT = QT->getAs()) + return PT->getPointeeType()->getAs(); + + return 0; } /// \brief Thread Safety Analysis: Checks that all attribute arguments, starting