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
47 /// Indicate RISC-V vector builtin functions enabled or not.
48 bool DeclareRVVBuiltins = false;
49
50 /// Indicate RISC-V SiFive vector builtin functions enabled or not.
52
53 std::unique_ptr<sema::RISCVIntrinsicManager> IntrinsicManager;
54};
55
56std::unique_ptr<sema::RISCVIntrinsicManager>
58} // namespace clang
59
60#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:2830
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:941
bool CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaRISCV.cpp:565
bool CheckLMUL(CallExpr *TheCall, unsigned ArgNum)
Definition: SemaRISCV.cpp:515
bool isAliasValid(unsigned BuiltinID, llvm::StringRef AliasName)
Definition: SemaRISCV.cpp:1490
std::unique_ptr< sema::RISCVIntrinsicManager > IntrinsicManager
Definition: SemaRISCV.h:53
bool DeclareSiFiveVectorBuiltins
Indicate RISC-V SiFive vector builtin functions enabled or not.
Definition: SemaRISCV.h:51
void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D, const llvm::StringMap< bool > &FeatureMap)
Definition: SemaRISCV.cpp:1380
bool isValidRVVBitcast(QualType srcType, QualType destType)
Are the two types RVV-bitcast-compatible types? I.e.
Definition: SemaRISCV.cpp:1417
void handleInterruptAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaRISCV.cpp:1432
bool DeclareRVVBuiltins
Indicate RISC-V vector builtin functions enabled or not.
Definition: SemaRISCV.h:48
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:493
Encodes a location in the source.
Exposes information about the current target.
Definition: TargetInfo.h:218
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< sema::RISCVIntrinsicManager > CreateRISCVIntrinsicManager(Sema &S)
Definition: SemaRISCV.cpp:511