clang 22.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/StringRef.h"
21#include <tuple>
22
23namespace llvm {
24template <typename T, unsigned N> class SmallVector;
25} // namespace llvm
26
27namespace clang {
28class ParsedAttr;
29class TargetInfo;
30
31class SemaARM : public SemaBase {
32public:
33 SemaARM(Sema &S);
34
36 ArmNonStreaming, /// Intrinsic is only available in normal mode
37 ArmStreaming, /// Intrinsic is only available in Streaming-SVE mode.
38 ArmStreamingCompatible, /// Intrinsic is available both in normal and
39 /// Streaming-SVE mode.
40 VerifyRuntimeMode /// Intrinsic is available in normal mode with
41 /// SVE flags, or in Streaming-SVE mode with SME
42 /// flags. Do Sema checks for the runtime mode.
43 };
44
45 bool CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy, unsigned ArgIdx,
46 unsigned EltBitWidth, unsigned VecBitWidth);
47 bool CheckARMBuiltinExclusiveCall(const TargetInfo &TI, unsigned BuiltinID,
48 CallExpr *TheCall);
49 bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
50 CallExpr *TheCall);
52 CallExpr *TheCall,
53 SmallVectorImpl<std::tuple<int, int, int, int>> &ImmChecks,
54 int OverloadType = -1);
55 bool
57 SmallVectorImpl<std::tuple<int, int, int>> &ImmChecks);
58 bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
59 bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
60 bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
61 bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
62 CallExpr *TheCall);
63 bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg,
64 bool WantCDE);
65 bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
66 CallExpr *TheCall);
67
68 bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
69 CallExpr *TheCall);
70 bool BuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum,
71 unsigned ExpectedFieldNum, bool AllowName);
72 bool BuiltinARMMemoryTaggingCall(unsigned BuiltinID, CallExpr *TheCall);
73
74 bool MveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
75 bool CdeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
76 bool SveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
77 bool SmeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
78 void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL);
79 void handleNewAttr(Decl *D, const ParsedAttr &AL);
80 void handleCmseNSEntryAttr(Decl *D, const ParsedAttr &AL);
81 void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
83
85
86 /// Return true if the given types are an SVE builtin and a VectorType that
87 /// is a fixed-length representation of the SVE builtin for a specific
88 /// vector-length.
89 bool areCompatibleSveTypes(QualType FirstType, QualType SecondType);
90
91 /// Return true if the given vector types are lax-compatible SVE vector types,
92 /// false otherwise.
93 bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType);
94
95 bool checkTargetVersionAttr(const StringRef Str, const SourceLocation Loc);
99};
100
102
103} // namespace clang
104
105#endif // LLVM_CLANG_SEMA_SEMAARM_H
const Decl * D
SourceLocation Loc
Definition: SemaObjC.cpp:754
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2879
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
This represents one expression.
Definition: Expr.h:112
Represents a function declaration or definition.
Definition: Decl.h:1999
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:119
A (possibly-)qualified type.
Definition: TypeBase.h:937
void CheckSMEFunctionDefAttributes(const FunctionDecl *FD)
Definition: SemaARM.cpp:1403
bool CheckARMBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:1012
void handleInterruptSaveFPAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1378
bool CheckSMEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:642
bool CheckARMCoprocessorImmediate(const TargetInfo &TI, const Expr *CoprocArg, bool WantCDE)
Definition: SemaARM.cpp:824
bool checkTargetVersionAttr(const StringRef Str, const SourceLocation Loc)
Definition: SemaARM.cpp:1582
bool CheckSVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:683
bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:712
bool CheckCDEBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:808
bool PerformNeonImmChecks(CallExpr *TheCall, SmallVectorImpl< std::tuple< int, int, int, int > > &ImmChecks, int OverloadType=-1)
Definition: SemaARM.cpp:513
bool CheckMVEBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:799
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1346
bool PerformSVEImmChecks(CallExpr *TheCall, SmallVectorImpl< std::tuple< int, int, int > > &ImmChecks)
Definition: SemaARM.cpp:532
void handleBuiltinAliasAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1231
@ ArmStreaming
Intrinsic is only available in normal mode.
Definition: SemaARM.h:37
@ ArmNonStreaming
Definition: SemaARM.h:36
@ VerifyRuntimeMode
Intrinsic is available both in normal and Streaming-SVE mode.
Definition: SemaARM.h:40
@ ArmStreamingCompatible
Intrinsic is only available in Streaming-SVE mode.
Definition: SemaARM.h:38
void handleNewAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaARM.cpp:1278
bool CheckARMBuiltinExclusiveCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:849
bool areCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an SVE builtin and a VectorType that is a fixed-length representat...
Definition: SemaARM.cpp:1473
bool SveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1217
bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible SVE vector types, false otherwise.
Definition: SemaARM.cpp:1517
bool CheckAArch64BuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaARM.cpp:1093
bool MveAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1204
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:1331
bool CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy, unsigned ArgIdx, unsigned EltBitWidth, unsigned VecBitWidth)
Definition: SemaARM.cpp:375
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:1224
bool checkTargetClonesAttr(SmallVectorImpl< StringRef > &Params, SmallVectorImpl< SourceLocation > &Locs, SmallVectorImpl< SmallString< 64 > > &NewParams)
Definition: SemaARM.cpp:1599
bool CdeAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaARM.cpp:1212
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:850
Encodes a location in the source.
Exposes information about the current target.
Definition: TargetInfo.h:226
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:545
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30