]> granicus.if.org Git - clang/commitdiff
Make checker recognize OffsetOfExpr as a form of __builtin_offsetof.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 5 Aug 2010 09:43:11 +0000 (09:43 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 5 Aug 2010 09:43:11 +0000 (09:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110320 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/CheckerHelpers.cpp

index 8a295fbf4c42beb3abe8702345915cec5e333830..e3cb36b00cd7b955daed92f519c5b02a6e6cd8e6 100644 (file)
@@ -65,13 +65,16 @@ bool clang::containsStaticLocal(const Stmt *S) {
   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)