clang 22.0.0git
AttributeScopeInfo.h
Go to the documentation of this file.
1//==- AttributeScopeInfo.h - Base info about an Attribute Scope --*- 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// This file defines the AttributeScopeInfo type, which represents information
10// about the scope of an attribute.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_BASIC_ATTRIBUTESCOPEINFO_H
15#define LLVM_CLANG_BASIC_ATTRIBUTESCOPEINFO_H
16
18
19namespace clang {
20
21class IdentifierInfo;
22
24public:
25 AttributeScopeInfo() = default;
26
28 : Name(Name), NameLoc(NameLoc) {}
29
31 SourceLocation CommonScopeLoc)
32 : Name(Name), NameLoc(NameLoc), CommonScopeLoc(CommonScopeLoc) {}
33
34 const IdentifierInfo *getName() const { return Name; }
35 SourceLocation getNameLoc() const { return NameLoc; }
36
37 bool isValid() const { return Name != nullptr; }
38 bool isExplicit() const { return CommonScopeLoc.isInvalid(); }
39
40private:
41 const IdentifierInfo *Name = nullptr;
42 SourceLocation NameLoc;
43 SourceLocation CommonScopeLoc;
44};
45
46} // namespace clang
47
48#endif // LLVM_CLANG_BASIC_ATTRIBUTESCOPEINFO_H
Defines the clang::SourceLocation class and associated facilities.
SourceLocation getNameLoc() const
const IdentifierInfo * getName() const
AttributeScopeInfo(const IdentifierInfo *Name, SourceLocation NameLoc, SourceLocation CommonScopeLoc)
AttributeScopeInfo(const IdentifierInfo *Name, SourceLocation NameLoc)
One of these records is kept for each identifier that is lexed.
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.