From: Eli Friedman Date: Thu, 5 Aug 2010 09:43:11 +0000 (+0000) Subject: Make checker recognize OffsetOfExpr as a form of __builtin_offsetof. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=156361d434cdcb4cc88169dee5b3d5ca25c7f012;p=clang Make checker recognize OffsetOfExpr as a form of __builtin_offsetof. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110320 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Checker/CheckerHelpers.cpp b/lib/Checker/CheckerHelpers.cpp index 8a295fbf4c..e3cb36b00c 100644 --- a/lib/Checker/CheckerHelpers.cpp +++ b/lib/Checker/CheckerHelpers.cpp @@ -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(S); if (UO && UO->getOpcode() == UnaryOperator::OffsetOf) return true; + if (isa(S)) + return true; + for (Stmt::const_child_iterator I = S->child_begin(); I != S->child_end(); ++I) if (const Stmt *child = *I)