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/DeclBase.h"
17#include "clang/AST/Expr.h"
18#include "clang/AST/Type.h"
22#include "clang/Sema/SemaBase.h"
23#include "llvm/ADT/StringMap.h"
24#include <memory>
25
26namespace clang {
27class ParsedAttr;
28
29class SemaRISCV : public SemaBase {
30public:
31 SemaRISCV(Sema &S);
32
33 bool CheckLMUL(CallExpr *TheCall, unsigned ArgNum);
34 bool CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
35 CallExpr *TheCall);
37 const llvm::StringMap<bool> &FeatureMap);
38
39 bool isValidRVVBitcast(QualType srcType, QualType destType);
40
41 void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
42 bool isAliasValid(unsigned BuiltinID, StringRef AliasName);
43
44 /// Indicate RISC-V vector builtin functions enabled or not.
45 bool DeclareRVVBuiltins = false;
46
47 /// Indicate RISC-V SiFive vector builtin functions enabled or not.
49
50 std::unique_ptr<sema::RISCVIntrinsicManager> IntrinsicManager;
51};
52
53std::unique_ptr<sema::RISCVIntrinsicManager>
55} // namespace clang
56
57#endif // LLVM_CLANG_SEMA_SEMARISCV_H
const Decl * D
SourceLocation Loc
Definition: SemaObjC.cpp:758
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
std::unique_ptr< sema::RISCVIntrinsicManager > IntrinsicManager
Definition: SemaRISCV.h:50
bool DeclareSiFiveVectorBuiltins
Indicate RISC-V SiFive vector builtin functions enabled or not.
Definition: SemaRISCV.h:48
bool isAliasValid(unsigned BuiltinID, StringRef AliasName)
Definition: SemaRISCV.cpp:1490
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:45
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:535
Encodes a location in the source.
Exposes information about the current target.
Definition: TargetInfo.h:218
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< sema::RISCVIntrinsicManager > CreateRISCVIntrinsicManager(Sema &S)
Definition: SemaRISCV.cpp:511