clang: lib/Sema/SemaMSP430.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
20
22
24
26
27
29 Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type)
31 return;
32 }
33
35 Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid)
36 << 1 << 0;
37 return;
38 }
39
41 Diag(D->getLocation(), diag::warn_interrupt_attribute_invalid)
42 << 1 << 1;
43 return;
44 }
45
46
48 return;
49
51 Diag(AL.getLoc(), diag::err_attribute_argument_type)
53 return;
54 }
55
57 std::optionalllvm::APSInt NumParams = llvm::APSInt(32);
59 Diag(AL.getLoc(), diag::err_attribute_argument_type)
62 return;
63 }
64
65 unsigned Num = NumParams->getLimitedValue(255);
66 if (Num > 63) {
67 Diag(AL.getLoc(), diag::err_attribute_argument_out_of_bounds)
68 << AL << (int)NumParams->getSExtValue()
70 return;
71 }
72
75 D->addAttr(UsedAttr::CreateImplicit(getASTContext()));
76}
77
78}
Defines the clang::ASTContext interface.
This file declares semantic analysis functions specific to MSP430.
bool isRegularKeywordAttribute() const
SourceLocation getLoc() const
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
std::optional< llvm::APSInt > getIntegerConstantExpr(const ASTContext &Ctx, SourceLocation *Loc=nullptr) const
isIntegerConstantExpr - Return the value if this expression is a valid integer constant expression.
ParsedAttr - Represents a syntactic attribute.
bool checkExactlyNumArgs(class Sema &S, unsigned Num) const
Check if the attribute has exactly as many args as Num.
Expr * getArgAsExpr(unsigned Arg) const
bool isArgExpr(unsigned Arg) const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Sema - This implements semantic analysis and AST building for C.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
The JSON file list parser is used to communicate input to InstallAPI.
@ ExpectedFunctionOrMethod
QualType getFunctionOrMethodResultType(const Decl *D)
@ AANT_ArgumentIntegerConstant
bool isFuncOrMethodForAttrSubject(const Decl *D)
isFuncOrMethodForAttrSubject - Return true if the given decl has function type (function or function-...
bool hasFunctionProto(const Decl *D)
hasFunctionProto - Return true if the given decl has a argument information.
unsigned getFunctionOrMethodNumParams(const Decl *D)
getFunctionOrMethodNumParams - Return number of function or method parameters.