1 //===- CXString.h - Routines for manipulating CXStrings -------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines routines for manipulating CXStrings.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_TOOLS_LIBCLANG_INDEX_INTERNAL_H
14 #define LLVM_CLANG_TOOLS_LIBCLANG_INDEX_INTERNAL_H
16 #include "clang-c/Index.h"
19 #define __has_feature(x) 0
22 #if __has_feature(blocks)
24 #define INVOKE_BLOCK2(block, arg1, arg2) block(arg1, arg2)
27 // If we are compiled with a compiler that doesn't have native blocks support,
28 // define and call the block manually.
30 #define INVOKE_BLOCK2(block, arg1, arg2) block->invoke(block, arg1, arg2)
32 typedef struct _CXCursorAndRangeVisitorBlock
{
36 enum CXVisitorResult (*invoke
)(_CXCursorAndRangeVisitorBlock
*,
37 CXCursor
, CXSourceRange
);
38 } *CXCursorAndRangeVisitorBlock
;
40 #endif // !__has_feature(blocks)
42 /// The result of comparing two source ranges.
43 enum RangeComparisonResult
{
44 /// Either the ranges overlap or one of the ranges is invalid.
47 /// The first range ends before the second range starts.
50 /// The first range starts after the second range ends.