/// <summary> /// Execute Translation Unit Handling Test /// </summary> private void ExecuteTranslationUnitHandlingTest() { var(target_src, command_line_args) = this.CreateTranslationUnitHandlerParameters(); CursorVisitor.Execute(target_src, command_line_args); this.SendMessage(); InclusionVisitor.Execute(target_src, command_line_args); }
/// <summary> /// Visit the set of preprocessor inclusions in a translation unit. The visitor /// function is called with the provided data for every included file. This does /// not include headers included by the PCH file (unless one is inspecting the /// inclusions in the PCH file itself). /// </summary> /// <param name="visitor">The visiting delegate.</param> public void VisitInclusions(InclusionVisitor visitor) { Interop.InclusionVisitor nativeVisitor = (file, stack, size, data) => { var inclusionStack = new SourceLocation[(int)size]; unsafe { var srcPtr = (Interop.SourceLocation *)stack; for (uint i = 0; i < size; ++i) { inclusionStack[i] = (new SourceLocation(*(srcPtr + i))); } } visitor(new File(file), inclusionStack); }; Interop.clang_getInclusions(Native, nativeVisitor, IntPtr.Zero); }
/// <summary> /// Visit the set of preprocessor inclusions in a translation unit. The visitor /// function is called with the provided data for every included file. This does /// not include headers included by the PCH file (unless one is inspecting the /// inclusions in the PCH file itself). /// </summary> /// <param name="visitor">The visiting delegate.</param> public void VisitInclusions(InclusionVisitor visitor) { Interop.InclusionVisitor nativeVisitor = (file, stack, size, data) => { var inclusionStack = new SourceLocation[(int)size]; unsafe { var srcPtr = (Interop.SourceLocation*)stack; for (uint i = 0; i < size; ++i) { inclusionStack[i] = (new SourceLocation(*(srcPtr + i))); } } visitor(new File(file), inclusionStack); }; Interop.clang_getInclusions(Native, nativeVisitor, IntPtr.Zero); }
public static extern void clang_getInclusions(IntPtr tu, InclusionVisitor visitor, ClientData data);