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/ASTFwd.h"
17#include "clang/Sema/SemaBase.h"
18#include "llvm/ADT/StringRef.h"
19#include <tuple>
20
21namespace llvm {
22template <typename T, unsigned N> class SmallVector;
23} // namespace llvm
24
25namespace clang {
26class ParsedAttr;
27class TargetInfo;
28
29class SemaARM : public SemaBase {
30public:
31 SemaARM(Sema &S);
32
34 ArmNonStreaming, /// Intrinsic is only available in normal mode
35 ArmStreaming, /// Intrinsic is only available in Streaming-SVE mode.
36 ArmStreamingCompatible, /// Intrinsic is available both in normal and
37 /// Streaming-SVE mode.
38 VerifyRuntimeMode /// Intrinsic is available in normal mode with
39 /// SVE flags, or in Streaming-SVE mode with SME
40 /// flags. Do Sema checks for the runtime mode.
41 };
42
43 bool CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall,
44 unsigned MaxWidth);
45 bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
46 CallExpr *TheCall);
47 bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
48 bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
49 bool
51 llvm::SmallVector<std::tuple<int, int, int>, 3> &ImmChecks);
52 bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
53 bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
54 CallExpr *TheCall);
55 bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg,
56 bool WantCDE);
57 bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
58 CallExpr *TheCall);
59
60 bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
61 CallExpr *TheCall);
62 bool BuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum,
63 unsigned ExpectedFieldNum, bool AllowName);
64 bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall);
65
66 bool MveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
67 bool CdeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
68 bool SveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
69 bool SmeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
70 void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL);
71 void handleNewAttr(Decl *D, const ParsedAttr &AL);
72 void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL);
73 void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
74};
75
77
78} // namespace clang
79
80#endif // LLVM_CLANG_SEMA_SEMAARM_H
Forward declaration of all AST node types.
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:407
bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:986
bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:660
bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg, bool WantCDE)
Definition: SemaARM.cpp:842
bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:700
bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:728
bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:826
bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:817
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1311
void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1196
@ ArmStreaming
Intrinsic is only available in normal mode.
Definition: SemaARM.h:35
@ ArmNonStreaming
Definition: SemaARM.h:34
@ VerifyRuntimeMode
Intrinsic is available both in normal and Streaming-SVE mode.
Definition: SemaARM.h:38
@ ArmStreamingCompatible
Intrinsic is only available in Streaming-SVE mode.
Definition: SemaARM.h:36
void handleNewAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1243
bool CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall, unsigned MaxWidth)
Definition: SemaARM.cpp:867
bool SveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1182
bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:1064
bool MveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1169
bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall)
BuiltinARMMemoryTaggingCall - Handle calls of memory tagging extensions.
Definition: SemaARM.cpp:26
void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1296
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:188
bool SmeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1189
bool CdeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1177
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:493
Exposes information about the current target.
Definition: TargetInfo.h:218
The JSON file list parser is used to communicate input to InstallAPI.
SemaARM::ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD)
Definition: SemaARM.cpp:548
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30