clang 22.0.0git
SemaRISCV.h
Go to the documentation of this file.
1//===----- SemaRISCV.h ---- RISC-V 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 RISC-V.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_SEMA_SEMARISCV_H
14#define LLVM_CLANG_SEMA_SEMARISCV_H
15
16#include "clang/AST/ASTFwd.h"
17#include "clang/AST/Type.h"
19#include "clang/Sema/SemaBase.h"
20#include "llvm/ADT/StringMap.h"
21#include "llvm/ADT/StringRef.h"
22#include <memory>
23
24namespace clang {
25namespace sema {
26class RISCVIntrinsicManager;
27} // namespace sema
28
29class ParsedAttr;
30class TargetInfo;
31
32class SemaRISCV : public SemaBase {
33public:
34 SemaRISCV(Sema &S);
35
36 bool CheckLMUL(CallExpr *TheCall, unsigned ArgNum);
37 bool CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
38 CallExpr *TheCall);
40 const llvm::StringMap<bool> &FeatureMap);
41
42 bool isValidRVVBitcast(QualType srcType, QualType destType);
43
44 void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
45 bool isAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
46 bool isValidFMVExtension(StringRef Ext);
47
48 /// Indicate RISC-V vector builtin functions enabled or not.
49 bool DeclareRVVBuiltins = false;
50
51 /// Indicate RISC-V SiFive vector builtin functions enabled or not.
53
54 /// Indicate RISC-V Andes vector builtin functions enabled or not.
56
57 std::unique_ptr<sema::RISCVIntrinsicManager> IntrinsicManager;
58
59 bool checkTargetVersionAttr(const StringRef Param, const SourceLocation Loc);
63};
64
65std::unique_ptr<sema::RISCVIntrinsicManager>
67} // namespace clang
68
69#endif // LLVM_CLANG_SEMA_SEMARISCV_H
Forward declaration of all AST node types.
const Decl * D
SourceLocation Loc
Definition: SemaObjC.cpp:754
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
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
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:119
A (possibly-)qualified type.
Definition: TypeBase.h:937
bool CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaRISCV.cpp:554
bool CheckLMUL(CallExpr *TheCall, unsigned ArgNum)
Definition: SemaRISCV.cpp:502
bool isAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaRISCV.cpp:1651
bool isValidFMVExtension(StringRef Ext)
Definition: SemaRISCV.cpp:1656
bool DeclareAndesVectorBuiltins
Indicate RISC-V Andes vector builtin functions enabled or not.
Definition: SemaRISCV.h:55
std::unique_ptr< sema::RISCVIntrinsicManager > IntrinsicManager
Definition: SemaRISCV.h:57
bool DeclareSiFiveVectorBuiltins
Indicate RISC-V SiFive vector builtin functions enabled or not.
Definition: SemaRISCV.h:52
void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D, const llvm::StringMap< bool > &FeatureMap)
Definition: SemaRISCV.cpp:1439
bool isValidRVVBitcast(QualType srcType, QualType destType)
Are the two types RVV-bitcast-compatible types? I.e.
Definition: SemaRISCV.cpp:1489
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaRISCV.cpp:1504
bool checkTargetClonesAttr(SmallVectorImpl< StringRef > &Params, SmallVectorImpl< SourceLocation > &Locs, SmallVectorImpl< SmallString< 64 > > &NewParams)
Definition: SemaRISCV.cpp:1716
bool DeclareRVVBuiltins
Indicate RISC-V vector builtin functions enabled or not.
Definition: SemaRISCV.h:49
bool checkTargetVersionAttr(const StringRef Param, const SourceLocation Loc)
Definition: SemaRISCV.cpp:1666
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
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< sema::RISCVIntrinsicManager > CreateRISCVIntrinsicManager(Sema &S)
Definition: SemaRISCV.cpp:498