clang  12.0.0git
DeclOccurrence.h
Go to the documentation of this file.
1 //===- DeclOccurrence.h - An occurrence of a decl within a file -*- C++ -*-===//
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 #ifndef LLVM_CLANG_INDEX_DECLOCCURRENCE_H
10 #define LLVM_CLANG_INDEX_DECLOCCURRENCE_H
11 
12 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/SmallVector.h"
16 
17 namespace clang {
18 class Decl;
19 
20 namespace index {
21 
24  unsigned Offset;
25  const Decl *Dcl;
27 
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()) {}
32 
33  friend bool operator<(const DeclOccurrence &LHS, const DeclOccurrence &RHS) {
34  return LHS.Offset < RHS.Offset;
35  }
36 };
37 
38 } // namespace index
39 } // namespace clang
40 
41 #endif // LLVM_CLANG_INDEX_DECLOCCURRENCE_H
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
unsigned SymbolRoleSet
Definition: IndexSymbol.h:130
friend bool operator<(const DeclOccurrence &LHS, const DeclOccurrence &RHS)
SmallVector< SymbolRelation, 3 > Relations
Dataflow Directional Tag Classes.
DeclOccurrence(SymbolRoleSet R, unsigned Offset, const Decl *D, ArrayRef< SymbolRelation > Relations)