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 13 #ifndef LLVM_CLANG_TOOLS_LIBCLANG_INDEX_INTERNAL_H 14 #define LLVM_CLANG_TOOLS_LIBCLANG_INDEX_INTERNAL_H 15 16 #include "clang-c/Index.h" 17 18 #ifndef __has_feature 19 #define __has_feature(x) 0 20 #endif 21 22 #if __has_feature(blocks) 23 24 #define INVOKE_BLOCK2(block, arg1, arg2) block(arg1, arg2) 25 26 #else 27 // If we are compiled with a compiler that doesn't have native blocks support, 28 // define and call the block manually. 29 30 #define INVOKE_BLOCK2(block, arg1, arg2) block->invoke(block, arg1, arg2) 31 32 typedef struct _CXCursorAndRangeVisitorBlock { 33 void *isa; 34 int flags; 35 int reserved; 36 enum CXVisitorResult (*invoke)(_CXCursorAndRangeVisitorBlock *, 37 CXCursor, CXSourceRange); 38 } *CXCursorAndRangeVisitorBlock; 39 40 #endif // !__has_feature(blocks) 41 42 /// The result of comparing two source ranges. 43 enum RangeComparisonResult { 44 /// Either the ranges overlap or one of the ranges is invalid. 45 RangeOverlap, 46 47 /// The first range ends before the second range starts. 48 RangeBefore, 49 50 /// The first range starts after the second range ends. 51 RangeAfter 52 }; 53 54 #endif 55