[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / tools / libclang / Index_Internal.h
blobd28438770e7d3497500bd3ef37c7e6a664447a32
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.
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"
18 #ifndef __has_feature
19 #define __has_feature(x) 0
20 #endif
22 #if __has_feature(blocks)
24 #define INVOKE_BLOCK2(block, arg1, arg2) block(arg1, arg2)
26 #else
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 {
33 void *isa;
34 int flags;
35 int reserved;
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.
45 RangeOverlap,
47 /// The first range ends before the second range starts.
48 RangeBefore,
50 /// The first range starts after the second range ends.
51 RangeAfter
54 #endif