clang 20.0.0git
SemaAVR.cpp
Go to the documentation of this file.
1//===------ SemaAVR.cpp ---------- AVR target-specific routines -----------===//
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 implements semantic analysis functions specific to AVR.
10//
11//===----------------------------------------------------------------------===//
12
13#include "clang/Sema/SemaAVR.h"
14#include "clang/AST/DeclBase.h"
16#include "clang/Sema/Attr.h"
18#include "clang/Sema/Sema.h"
19
20namespace clang {
22
25 Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
27 return;
28 }
29
30 if (!AL.checkExactlyNumArgs(SemaRef, 0))
31 return;
32
33 handleSimpleAttribute<AVRInterruptAttr>(*this, D, AL);
34}
35
38 Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
40 return;
41 }
42
43 if (!AL.checkExactlyNumArgs(SemaRef, 0))
44 return;
45
46 handleSimpleAttribute<AVRSignalAttr>(*this, D, AL);
47}
48
49} // namespace clang
const Decl * D
This file declares semantic analysis functions specific to AVR.
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
bool checkExactlyNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has exactly as many args as Num.
Definition: ParsedAttr.cpp:296
SemaAVR(Sema &S)
Definition: SemaAVR.cpp:21
void handleSignalAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAVR.cpp:36
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaAVR.cpp:23
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
Definition: SemaBase.cpp:60
Sema & SemaRef
Definition: SemaBase.h:40
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:463
The JSON file list parser is used to communicate input to InstallAPI.
@ ExpectedFunction
Definition: ParsedAttr.h:1089
bool isFuncOrMethodForAttrSubject(const Decl *D)
isFuncOrMethodForAttrSubject - Return true if the given decl has function type (function or function-...
Definition: Attr.h:34