llvm/clang/lib/CodeGen/Targets/LoongArch.cpp

//===- LoongArch.cpp ------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "ABIInfoImpl.h"
#include "TargetInfo.h"

usingnamespaceclang;
usingnamespaceclang::CodeGen;

// LoongArch ABI Implementation. Documented at
// https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
//
//===----------------------------------------------------------------------===//

namespace {
class LoongArchABIInfo : public DefaultABIInfo {};
} // end anonymous namespace

void LoongArchABIInfo::computeInfo(CGFunctionInfo &FI) const {}

// Returns true if the struct is a potential candidate to be passed in FARs (and
// GARs). If this function returns true, the caller is responsible for checking
// that if there is only a single field then that field is a float.
bool LoongArchABIInfo::detectFARsEligibleStructHelper(
    QualType Ty, CharUnits CurOff, llvm::Type *&Field1Ty, CharUnits &Field1Off,
    llvm::Type *&Field2Ty, CharUnits &Field2Off) const {}

// Determine if a struct is eligible to be passed in FARs (and GARs) (i.e., when
// flattened it contains a single fp value, fp+fp, or int+fp of appropriate
// size). If so, NeededFARs and NeededGARs are incremented appropriately.
bool LoongArchABIInfo::detectFARsEligibleStruct(
    QualType Ty, llvm::Type *&Field1Ty, CharUnits &Field1Off,
    llvm::Type *&Field2Ty, CharUnits &Field2Off, int &NeededGARs,
    int &NeededFARs) const {}

// Call getCoerceAndExpand for the two-element flattened struct described by
// Field1Ty, Field1Off, Field2Ty, Field2Off. This method will create an
// appropriate coerceToType and unpaddedCoerceToType.
ABIArgInfo LoongArchABIInfo::coerceAndExpandFARsEligibleStruct(
    llvm::Type *Field1Ty, CharUnits Field1Off, llvm::Type *Field2Ty,
    CharUnits Field2Off) const {}

ABIArgInfo LoongArchABIInfo::classifyArgumentType(QualType Ty, bool IsFixed,
                                                  int &GARsLeft,
                                                  int &FARsLeft) const {}

ABIArgInfo LoongArchABIInfo::classifyReturnType(QualType RetTy) const {}

RValue LoongArchABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
                                   QualType Ty, AggValueSlot Slot) const {}

ABIArgInfo LoongArchABIInfo::extendType(QualType Ty) const {}

namespace {
class LoongArchTargetCodeGenInfo : public TargetCodeGenInfo {};
} // namespace

std::unique_ptr<TargetCodeGenInfo>
CodeGen::createLoongArchTargetCodeGenInfo(CodeGenModule &CGM, unsigned GRLen,
                                          unsigned FLen) {}