#include "clang/Sema/SemaRISCV.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Attr.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedAttr.h"
#include "clang/Sema/RISCVIntrinsicManager.h"
#include "clang/Sema/Sema.h"
#include "clang/Support/RISCVVIntrinsicUtils.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/TargetParser/RISCVTargetParser.h"
#include <optional>
#include <string>
#include <vector>
usingnamespacellvm;
usingnamespaceclang;
usingnamespaceclang::RISCV;
IntrinsicKind;
namespace {
struct RVVIntrinsicDef { … };
struct RVVOverloadIntrinsicDef { … };
}
static const PrototypeDescriptor RVVSignatureTable[] = …;
static const PrototypeDescriptor RVSiFiveVectorSignatureTable[] = …;
static const RVVIntrinsicRecord RVVIntrinsicRecords[] = …;
static const RVVIntrinsicRecord RVSiFiveVectorIntrinsicRecords[] = …;
static ArrayRef<PrototypeDescriptor>
ProtoSeq2ArrayRef(IntrinsicKind K, uint16_t Index, uint8_t Length) { … }
static QualType RVVType2Qual(ASTContext &Context, const RVVType *Type) { … }
namespace {
class RISCVIntrinsicManagerImpl : public sema::RISCVIntrinsicManager { … };
}
void RISCVIntrinsicManagerImpl::ConstructRVVIntrinsics(
ArrayRef<RVVIntrinsicRecord> Recs, IntrinsicKind K) { … }
void RISCVIntrinsicManagerImpl::InitIntrinsicList() { … }
void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
const RVVIntrinsicRecord &Record, StringRef SuffixStr,
StringRef OverloadedSuffixStr, bool IsMasked, RVVTypes &Signature,
bool HasPolicy, Policy PolicyAttrs) { … }
void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult &LR,
IdentifierInfo *II,
Preprocessor &PP,
uint32_t Index,
bool IsOverload) { … }
bool RISCVIntrinsicManagerImpl::CreateIntrinsicIfFound(LookupResult &LR,
IdentifierInfo *II,
Preprocessor &PP) { … }
namespace clang {
std::unique_ptr<clang::sema::RISCVIntrinsicManager>
CreateRISCVIntrinsicManager(Sema &S) { … }
bool SemaRISCV::CheckLMUL(CallExpr *TheCall, unsigned ArgNum) { … }
static bool CheckInvalidVLENandLMUL(const TargetInfo &TI, CallExpr *TheCall,
Sema &S, QualType Type, int EGW) { … }
bool SemaRISCV::CheckBuiltinFunctionCall(const TargetInfo &TI,
unsigned BuiltinID,
CallExpr *TheCall) { … }
void SemaRISCV::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D,
const llvm::StringMap<bool> &FeatureMap) { … }
bool SemaRISCV::isValidRVVBitcast(QualType srcTy, QualType destTy) { … }
void SemaRISCV::handleInterruptAttr(Decl *D, const ParsedAttr &AL) { … }
bool SemaRISCV::isAliasValid(unsigned BuiltinID, StringRef AliasName) { … }
bool SemaRISCV::isValidFMVExtension(StringRef Ext) { … }
SemaRISCV::SemaRISCV(Sema &S) : … { … }
}