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