Don't reject macro definitions in system headers

Before, an assert() macro expansion jumps to __assert_fail but not
assert. This is because OnIndexReference finds a reference to __assert_fail
but VisitMacroDefinitionAndExpansions rejects the expansion.
This commit is contained in:
Fangrui Song 2017-12-29 19:18:40 -08:00
parent 48e88950e1
commit 11aa09fac2

View File

@ -923,9 +923,6 @@ ClangCursor::VisitResult VisitMacroDefinitionAndExpansions(ClangCursor cursor,
// Resolve location, find IndexFile instance.
CXSourceRange cx_source_range =
clang_Cursor_getSpellingNameRange(cursor.cx_cursor, 0, 0);
CXSourceLocation start = clang_getRangeStart(cx_source_range);
if (clang_Location_isInSystemHeader(start))
break;
CXFile file;
Range decl_loc_spelling = Resolve(cx_source_range, &file);
IndexFile* db = ConsumeFile(param, file);