[cfe-commits] r110320 - /cfe/trunk/lib/Checker/CheckerHelpers.cpp

Eli Friedman eli.friedman at gmail.com
Thu Aug 5 04:43:11 CDT 2010


Author: efriedma
Date: Thu Aug  5 04:43:11 2010
New Revision: 110320

URL: http://llvm.org/viewvc/llvm-project?rev=110320&view=rev
Log:
Make checker recognize OffsetOfExpr as a form of __builtin_offsetof.


Modified:
    cfe/trunk/lib/Checker/CheckerHelpers.cpp

Modified: cfe/trunk/lib/Checker/CheckerHelpers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CheckerHelpers.cpp?rev=110320&r1=110319&r2=110320&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/CheckerHelpers.cpp (original)
+++ cfe/trunk/lib/Checker/CheckerHelpers.cpp Thu Aug  5 04:43:11 2010
@@ -65,13 +65,16 @@
   return false;
 }
 
-// Recursively find any substatements containing __builtin_offset_of
+// Recursively find any substatements containing __builtin_offsetof
 bool clang::containsBuiltinOffsetOf(const Stmt *S) {
   const UnaryOperator *UO = dyn_cast<UnaryOperator>(S);
 
   if (UO && UO->getOpcode() == UnaryOperator::OffsetOf)
     return true;
 
+  if (isa<OffsetOfExpr>(S))
+    return true;
+
   for (Stmt::const_child_iterator I = S->child_begin(); I != S->child_end();
       ++I)
     if (const Stmt *child = *I)




More information about the cfe-commits mailing list