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