clang 20.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 std::unique_ptr<sema::RISCVIntrinsicManager> IntrinsicManager;
55};
56
57std::unique_ptr<sema::RISCVIntrinsicManager>
59} // namespace clang
60
61#endif // LLVM_CLANG_SEMA_SEMARISCV_H
Forward declaration of all AST node types.
const Decl * D
SourceLocation Loc
Definition: SemaObjC.cpp:759
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:2874
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
A (possibly-)qualified type.
Definition: Type.h:929
bool CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaRISCV.cpp:552
bool CheckLMUL(CallExpr *TheCall, unsigned ArgNum)
Definition: SemaRISCV.cpp:502
bool isAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaRISCV.cpp:1482
bool isValidFMVExtension(StringRef Ext)
Definition: SemaRISCV.cpp:1487
std::unique_ptr< sema::RISCVIntrinsicManager > IntrinsicManager
Definition: SemaRISCV.h:54
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:1372
bool isValidRVVBitcast(QualType srcType, QualType destType)
Are the two types RVV-bitcast-compatible types? I.e.
Definition: SemaRISCV.cpp:1409
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaRISCV.cpp:1424
bool DeclareRVVBuiltins
Indicate RISC-V vector builtin functions enabled or not.
Definition: SemaRISCV.h:49
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:463
Encodes a location in the source.
Exposes information about the current target.
Definition: TargetInfo.h:220
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< sema::RISCVIntrinsicManager > CreateRISCVIntrinsicManager(Sema &S)
Definition: SemaRISCV.cpp:498