clang 10.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"
13 #include "clang/Index/IndexSymbol.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
22 struct DeclOccurrence {
23 SymbolRoleSet Roles;
24 unsigned Offset;
25 const Decl *Dcl;
26 SmallVector<SymbolRelation, 3> Relations;
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
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:88
clang::CodeGen::AlignmentSource::Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
clang::index::DeclOccurrence::Offset
unsigned Offset
Definition: DeclOccurrence.h:24
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
llvm::ArrayRef
Definition: LLVM.h:31
clang::index::SymbolRoleSet
unsigned SymbolRoleSet
Definition: IndexSymbol.h:127
IndexSymbol.h
clang::index::DeclOccurrence::operator<
friend bool operator<(const DeclOccurrence &LHS, const DeclOccurrence &RHS)
Definition: DeclOccurrence.h:33
llvm::SmallVector
Definition: LLVM.h:35
clang::index::DeclOccurrence::Relations
SmallVector< SymbolRelation, 3 > Relations
Definition: DeclOccurrence.h:26
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::index::DeclOccurrence::Roles
SymbolRoleSet Roles
Definition: DeclOccurrence.h:23
clang::index::DeclOccurrence::Dcl
const Decl * Dcl
Definition: DeclOccurrence.h:25
clang::index::DeclOccurrence
Definition: DeclOccurrence.h:22
clang::index::DeclOccurrence::DeclOccurrence
DeclOccurrence(SymbolRoleSet R, unsigned Offset, const Decl *D, ArrayRef< SymbolRelation > Relations)
Definition: DeclOccurrence.h:28