clang 20.0.0git
SemaARM.h
Go to the documentation of this file.
1//===----- SemaARM.h ------- ARM target-specific routines -----*- 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/// \file
9/// This file declares semantic analysis functions specific to ARM.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_SEMA_SEMAARM_H
14#define LLVM_CLANG_SEMA_SEMAARM_H
15
16#include "clang/AST/DeclBase.h"
17#include "clang/AST/Expr.h"
19#include "clang/Sema/SemaBase.h"
20#include "llvm/ADT/SmallVector.h"
21#include <tuple>
22
23namespace clang {
24class ParsedAttr;
25
26class SemaARM : public SemaBase {
27public:
28 SemaARM(Sema &S);
29
31 ArmNonStreaming, /// Intrinsic is only available in normal mode
32 ArmStreaming, /// Intrinsic is only available in Streaming-SVE mode.
33 ArmStreamingCompatible, /// Intrinsic is available both in normal and
34 /// Streaming-SVE mode.
35 VerifyRuntimeMode /// Intrinsic is available in normal mode with
36 /// SVE flags, or in Streaming-SVE mode with SME
37 /// flags. Do Sema checks for the runtime mode.
38 };
39
40 bool CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall,
41 unsigned MaxWidth);
42 bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
43 CallExpr *TheCall);
44 bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
45 bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
46 bool
48 llvm::SmallVector<std::tuple<int, int, int>, 3> &ImmChecks);
49 bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
50 bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
51 CallExpr *TheCall);
52 bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg,
53 bool WantCDE);
54 bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
55 CallExpr *TheCall);
56
57 bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
58 CallExpr *TheCall);
59 bool BuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum,
60 unsigned ExpectedFieldNum, bool AllowName);
61 bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall);
62
63 bool MveAliasValid(unsigned BuiltinID, StringRef AliasName);
64 bool CdeAliasValid(unsigned BuiltinID, StringRef AliasName);
65 bool SveAliasValid(unsigned BuiltinID, StringRef AliasName);
66 bool SmeAliasValid(unsigned BuiltinID, StringRef AliasName);
67 void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL);
68 void handleNewAttr(Decl *D, const ParsedAttr &AL);
69 void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL);
70 void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
71};
72
74
75} // namespace clang
76
77#endif // LLVM_CLANG_SEMA_SEMAARM_H
const Decl * D
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2830
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
This represents one expression.
Definition: Expr.h:110
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
bool ParseSVEImmChecks(CallExpr *TheCall, llvm::SmallVector< std::tuple< int, int, int >, 3 > &ImmChecks)
Definition: SemaARM.cpp:406
bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:985
bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:659
bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg, bool WantCDE)
Definition: SemaARM.cpp:841
bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:699
bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:727
bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:825
bool MveAliasValid(unsigned BuiltinID, StringRef AliasName)
Definition: SemaARM.cpp:1168
bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:816
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1310
bool CdeAliasValid(unsigned BuiltinID, StringRef AliasName)
Definition: SemaARM.cpp:1176
void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1195
@ ArmStreaming
Intrinsic is only available in normal mode.
Definition: SemaARM.h:32
@ ArmNonStreaming
Definition: SemaARM.h:31
@ VerifyRuntimeMode
Intrinsic is available both in normal and Streaming-SVE mode.
Definition: SemaARM.h:35
@ ArmStreamingCompatible
Intrinsic is only available in Streaming-SVE mode.
Definition: SemaARM.h:33
void handleNewAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1242
bool CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall, unsigned MaxWidth)
Definition: SemaARM.cpp:866
bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:1063
bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall)
BuiltinARMMemoryTaggingCall - Handle calls of memory tagging extensions.
Definition: SemaARM.cpp:25
void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1295
bool SmeAliasValid(unsigned BuiltinID, StringRef AliasName)
Definition: SemaARM.cpp:1188
bool SveAliasValid(unsigned BuiltinID, StringRef AliasName)
Definition: SemaARM.cpp:1181
bool BuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum, unsigned ExpectedFieldNum, bool AllowName)
BuiltinARMSpecialReg - Handle a check if argument ArgNum of CallExpr TheCall is an ARM/AArch64 specia...
Definition: SemaARM.cpp:187
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:535
Exposes information about the current target.
Definition: TargetInfo.h:218
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD)
Definition: SemaARM.cpp:547