[cfe-commits] r138032 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Benjamin Kramer benny.kra at googlemail.com
Thu Aug 18 21:18:11 PDT 2011


Author: d0k
Date: Thu Aug 18 23:18:11 2011
New Revision: 138032

URL: http://llvm.org/viewvc/llvm-project?rev=138032&view=rev
Log:
Reflow code. No functionality change.

Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=138032&r1=138031&r2=138032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu Aug 18 23:18:11 2011
@@ -261,14 +261,15 @@
 
 /// \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





More information about the cfe-commits mailing list