Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:05

0001 //===----- SemaRISCV.h ---- RISC-V target-specific routines ---*- C++ -*---===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 /// This file declares semantic analysis functions specific to RISC-V.
0010 ///
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_CLANG_SEMA_SEMARISCV_H
0014 #define LLVM_CLANG_SEMA_SEMARISCV_H
0015 
0016 #include "clang/AST/ASTFwd.h"
0017 #include "clang/AST/Type.h"
0018 #include "clang/Basic/SourceLocation.h"
0019 #include "clang/Sema/SemaBase.h"
0020 #include "llvm/ADT/StringMap.h"
0021 #include "llvm/ADT/StringRef.h"
0022 #include <memory>
0023 
0024 namespace clang {
0025 namespace sema {
0026 class RISCVIntrinsicManager;
0027 } // namespace sema
0028 
0029 class ParsedAttr;
0030 class TargetInfo;
0031 
0032 class SemaRISCV : public SemaBase {
0033 public:
0034   SemaRISCV(Sema &S);
0035 
0036   bool CheckLMUL(CallExpr *TheCall, unsigned ArgNum);
0037   bool CheckBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
0038                                 CallExpr *TheCall);
0039   void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D,
0040                            const llvm::StringMap<bool> &FeatureMap);
0041 
0042   bool isValidRVVBitcast(QualType srcType, QualType destType);
0043 
0044   void handleInterruptAttr(Decl *D, const ParsedAttr &AL);
0045   bool isAliasValid(unsigned BuiltinID, llvm::StringRef AliasName);
0046   bool isValidFMVExtension(StringRef Ext);
0047 
0048   /// Indicate RISC-V vector builtin functions enabled or not.
0049   bool DeclareRVVBuiltins = false;
0050 
0051   /// Indicate RISC-V SiFive vector builtin functions enabled or not.
0052   bool DeclareSiFiveVectorBuiltins = false;
0053 
0054   std::unique_ptr<sema::RISCVIntrinsicManager> IntrinsicManager;
0055 };
0056 
0057 std::unique_ptr<sema::RISCVIntrinsicManager>
0058 CreateRISCVIntrinsicManager(Sema &S);
0059 } // namespace clang
0060 
0061 #endif // LLVM_CLANG_SEMA_SEMARISCV_H