Path: blob/main/contrib/llvm-project/clang/lib/Sema/SemaAVR.cpp
35233 views
//===------ SemaAVR.cpp ---------- AVR target-specific routines -----------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file implements semantic analysis functions specific to AVR.9//10//===----------------------------------------------------------------------===//1112#include "clang/Sema/SemaAVR.h"13#include "clang/AST/DeclBase.h"14#include "clang/Basic/DiagnosticSema.h"15#include "clang/Sema/Attr.h"16#include "clang/Sema/ParsedAttr.h"17#include "clang/Sema/Sema.h"1819namespace clang {20SemaAVR::SemaAVR(Sema &S) : SemaBase(S) {}2122void SemaAVR::handleInterruptAttr(Decl *D, const ParsedAttr &AL) {23if (!isFuncOrMethodForAttrSubject(D)) {24Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)25<< AL << AL.isRegularKeywordAttribute() << ExpectedFunction;26return;27}2829if (!AL.checkExactlyNumArgs(SemaRef, 0))30return;3132handleSimpleAttribute<AVRInterruptAttr>(*this, D, AL);33}3435void SemaAVR::handleSignalAttr(Decl *D, const ParsedAttr &AL) {36if (!isFuncOrMethodForAttrSubject(D)) {37Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)38<< AL << AL.isRegularKeywordAttribute() << ExpectedFunction;39return;40}4142if (!AL.checkExactlyNumArgs(SemaRef, 0))43return;4445handleSimpleAttribute<AVRSignalAttr>(*this, D, AL);46}4748} // namespace clang495051