Make checker recognize OffsetOfExpr as a form of __builtin_offsetof.

llvm-svn: 110320
This commit is contained in:
Eli Friedman 2010-08-05 09:43:11 +00:00
parent b68bc59a2d
commit 0cdda02f44
1 changed files with 4 additions and 1 deletions

View 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)