llvm/clang/lib/Sema/SemaRISCV.cpp

//===------ SemaRISCV.cpp ------- RISC-V target-specific routines ---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file implements semantic analysis functions specific to RISC-V.
//
//===----------------------------------------------------------------------===//

#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 {

// Function definition of a RVV intrinsic.
struct RVVIntrinsicDef {};

struct RVVOverloadIntrinsicDef {};

} // namespace

static const PrototypeDescriptor RVVSignatureTable[] =;

static const PrototypeDescriptor RVSiFiveVectorSignatureTable[] =;

static const RVVIntrinsicRecord RVVIntrinsicRecords[] =;

static const RVVIntrinsicRecord RVSiFiveVectorIntrinsicRecords[] =;

// Get subsequence of signature table.
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 {};
} // namespace

void RISCVIntrinsicManagerImpl::ConstructRVVIntrinsics(
    ArrayRef<RVVIntrinsicRecord> Recs, IntrinsicKind K) {}

void RISCVIntrinsicManagerImpl::InitIntrinsicList() {}

// Compute name and signatures for intrinsic with practical types.
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) {}

/// Are the two types RVV-bitcast-compatible types? I.e. is bitcasting from the
/// first RVV type (e.g. an RVV scalable type) to the second type (e.g. an RVV
/// VLS type) allowed?
///
/// This will also return false if the two given types do not make sense from
/// the perspective of RVV bitcasts.
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) :{}

} // namespace clang