clang  10.0.0svn
Attributes.h
Go to the documentation of this file.
1 //===--- Attributes.h - Attributes header -----------------------*- 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_BASIC_ATTRIBUTES_H
10 #define LLVM_CLANG_BASIC_ATTRIBUTES_H
11 
13 #include "clang/Basic/TargetInfo.h"
14 
15 namespace clang {
16 
17 class IdentifierInfo;
18 
19 enum class AttrSyntax {
20  /// Is the identifier known as a GNU-style attribute?
21  GNU,
22  /// Is the identifier known as a __declspec-style attribute?
23  Declspec,
24  /// Is the identifier known as a [] Microsoft-style attribute?
25  Microsoft,
26  // Is the identifier known as a C++-style attribute?
27  CXX,
28  // Is the identifier known as a C-style attribute?
29  C,
30  // Is the identifier known as a pragma attribute?
31  Pragma
32 };
33 
34 /// Return the version number associated with the attribute if we
35 /// recognize and implement the attribute specified by the given information.
36 int hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
37  const IdentifierInfo *Attr, const TargetInfo &Target,
38  const LangOptions &LangOpts);
39 
40 } // end namespace clang
41 
42 #endif // LLVM_CLANG_BASIC_ATTRIBUTES_H
Is the identifier known as a __declspec-style attribute?
Is the identifier known as a GNU-style attribute?
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:49
AttrSyntax
Definition: Attributes.h:19
Scope - A scope is a transient data structure that is used while parsing the program.
Definition: Scope.h:40
Is the identifier known as a [] Microsoft-style attribute?
int hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope, const IdentifierInfo *Attr, const TargetInfo &Target, const LangOptions &LangOpts)
Return the version number associated with the attribute if we recognize and implement the attribute s...
Definition: Attributes.cpp:7
Exposes information about the current target.
Definition: TargetInfo.h:161
Defines the clang::LangOptions interface.
Dataflow Directional Tag Classes.
Defines the clang::TargetInfo interface.
Attr - This represents one attribute.
Definition: Attr.h:43