Libclang visitChildren does not properly handle aborting the visit

Hi All,

I found that CursorVisitor::VisitChildren() does not properly honor the
user's request to break the visiting by returning CXChildVisit_Break from
the visitor callback. This can be a problem in certain scenarios, like when
there is an out of memory error and the user wants to abort the visiting

The block of code causing the problem seems to be the following:
// Walk the preprocessing record.
if (CXXUnit->getPreprocessor().getPreprocessingRecord())

which as far as I can tell needs to be changed based on how other visiting
calls are made (to stop the 'for' loop):
if (CXXUnit->getPreprocessor().getPreprocessingRecord())
  if (visitPreprocessedEntitiesInRegion())
    return true;

Thank you,

Can you please open a new bug at Providing a standalone minimal example that demonstrates the problem will generally speed things up.