1 //===- DeclOccurrence.h - An occurrence of a decl within a file -*- C++ -*-===//
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 #ifndef LLVM_CLANG_INDEX_DECLOCCURRENCE_H
10 #define LLVM_CLANG_INDEX_DECLOCCURRENCE_H
12 #include "clang/Basic/LLVM.h"
13 #include "clang/Index/IndexSymbol.h"
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/SmallVector.h"
22 struct DeclOccurrence {
26 SmallVector<SymbolRelation, 3> Relations;
28 DeclOccurrence(SymbolRoleSet R, unsigned Offset, const Decl *D,
29 ArrayRef<SymbolRelation> Relations)
30 : Roles(R), Offset(Offset), Dcl(D),
31 Relations(Relations.begin(), Relations.end()) {}
33 friend bool operator<(const DeclOccurrence &LHS, const DeclOccurrence &RHS) {
34 return LHS.Offset < RHS.Offset;
41 #endif // LLVM_CLANG_INDEX_DECLOCCURRENCE_H