Index_Internal.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //===- CXString.h - Routines for manipulating CXStrings -------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines routines for manipulating CXStrings.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_CLANG_TOOLS_LIBCLANG_INDEX_INTERNAL_H
  13. #define LLVM_CLANG_TOOLS_LIBCLANG_INDEX_INTERNAL_H
  14. #include "clang-c/Index.h"
  15. #ifndef __has_feature
  16. #define __has_feature(x) 0
  17. #endif
  18. #if __has_feature(blocks)
  19. #define INVOKE_BLOCK2(block, arg1, arg2) block(arg1, arg2)
  20. #else
  21. // If we are compiled with a compiler that doesn't have native blocks support,
  22. // define and call the block manually.
  23. #define INVOKE_BLOCK2(block, arg1, arg2) block->invoke(block, arg1, arg2)
  24. typedef struct _CXCursorAndRangeVisitorBlock {
  25. void *isa;
  26. int flags;
  27. int reserved;
  28. enum CXVisitorResult (*invoke)(_CXCursorAndRangeVisitorBlock *,
  29. CXCursor, CXSourceRange);
  30. } *CXCursorAndRangeVisitorBlock;
  31. #endif // !__has_feature(blocks)
  32. /// The result of comparing two source ranges.
  33. enum RangeComparisonResult {
  34. /// Either the ranges overlap or one of the ranges is invalid.
  35. RangeOverlap,
  36. /// The first range ends before the second range starts.
  37. RangeBefore,
  38. /// The first range starts after the second range ends.
  39. RangeAfter
  40. };
  41. #endif