llvm/llvm/lib/IR/Type.cpp

//===- Type.cpp - Implement the Type class --------------------------------===//
//
// 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 the Type class for the IR library.
//
//===----------------------------------------------------------------------===//

#include "llvm/IR/Type.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/TypeSize.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/RISCVTargetParser.h"
#include <cassert>
#include <utility>

usingnamespacellvm;

//===----------------------------------------------------------------------===//
//                         Type Class Implementation
//===----------------------------------------------------------------------===//

Type *Type::getPrimitiveType(LLVMContext &C, TypeID IDNumber) {}

bool Type::isIntegerTy(unsigned Bitwidth) const {}

bool Type::isScalableTy() const {}

const fltSemantics &Type::getFltSemantics() const {}

bool Type::isIEEE() const {}

bool Type::isScalableTargetExtTy() const {}

Type *Type::getFloatingPointTy(LLVMContext &C, const fltSemantics &S) {}

bool Type::isRISCVVectorTupleTy() const {}

bool Type::canLosslesslyBitCastTo(Type *Ty) const {}

bool Type::isEmptyTy() const {}

TypeSize Type::getPrimitiveSizeInBits() const {}

unsigned Type::getScalarSizeInBits() const {}

int Type::getFPMantissaWidth() const {}

bool Type::isSizedDerivedType(SmallPtrSetImpl<Type*> *Visited) const {}

//===----------------------------------------------------------------------===//
//                          Primitive 'Type' data
//===----------------------------------------------------------------------===//

Type *Type::getVoidTy(LLVMContext &C) {}
Type *Type::getLabelTy(LLVMContext &C) {}
Type *Type::getHalfTy(LLVMContext &C) {}
Type *Type::getBFloatTy(LLVMContext &C) {}
Type *Type::getFloatTy(LLVMContext &C) {}
Type *Type::getDoubleTy(LLVMContext &C) {}
Type *Type::getMetadataTy(LLVMContext &C) {}
Type *Type::getTokenTy(LLVMContext &C) {}
Type *Type::getX86_FP80Ty(LLVMContext &C) {}
Type *Type::getFP128Ty(LLVMContext &C) {}
Type *Type::getPPC_FP128Ty(LLVMContext &C) {}
Type *Type::getX86_AMXTy(LLVMContext &C) {}

IntegerType *Type::getInt1Ty(LLVMContext &C) {}
IntegerType *Type::getInt8Ty(LLVMContext &C) {}
IntegerType *Type::getInt16Ty(LLVMContext &C) {}
IntegerType *Type::getInt32Ty(LLVMContext &C) {}
IntegerType *Type::getInt64Ty(LLVMContext &C) {}
IntegerType *Type::getInt128Ty(LLVMContext &C) {}

IntegerType *Type::getIntNTy(LLVMContext &C, unsigned N) {}

Type *Type::getWasm_ExternrefTy(LLVMContext &C) {}

Type *Type::getWasm_FuncrefTy(LLVMContext &C) {}

//===----------------------------------------------------------------------===//
//                       IntegerType Implementation
//===----------------------------------------------------------------------===//

IntegerType *IntegerType::get(LLVMContext &C, unsigned NumBits) {}

APInt IntegerType::getMask() const {}

//===----------------------------------------------------------------------===//
//                       FunctionType Implementation
//===----------------------------------------------------------------------===//

FunctionType::FunctionType(Type *Result, ArrayRef<Type*> Params,
                           bool IsVarArgs)
  :{}

// This is the factory function for the FunctionType class.
FunctionType *FunctionType::get(Type *ReturnType,
                                ArrayRef<Type*> Params, bool isVarArg) {}

FunctionType *FunctionType::get(Type *Result, bool isVarArg) {}

bool FunctionType::isValidReturnType(Type *RetTy) {}

bool FunctionType::isValidArgumentType(Type *ArgTy) {}

//===----------------------------------------------------------------------===//
//                       StructType Implementation
//===----------------------------------------------------------------------===//

// Primitive Constructors.

StructType *StructType::get(LLVMContext &Context, ArrayRef<Type*> ETypes,
                            bool isPacked) {}

bool StructType::containsScalableVectorType(
    SmallPtrSetImpl<Type *> *Visited) const {}

bool StructType::containsHomogeneousScalableVectorTypes() const {}

bool StructType::containsHomogeneousTypes() const {}

void StructType::setBody(ArrayRef<Type*> Elements, bool isPacked) {}

void StructType::setName(StringRef Name) {}

//===----------------------------------------------------------------------===//
// StructType Helper functions.

StructType *StructType::create(LLVMContext &Context, StringRef Name) {}

StructType *StructType::get(LLVMContext &Context, bool isPacked) {}

StructType *StructType::create(LLVMContext &Context, ArrayRef<Type*> Elements,
                               StringRef Name, bool isPacked) {}

StructType *StructType::create(LLVMContext &Context, ArrayRef<Type*> Elements) {}

StructType *StructType::create(LLVMContext &Context) {}

StructType *StructType::create(ArrayRef<Type*> Elements, StringRef Name,
                               bool isPacked) {}

StructType *StructType::create(ArrayRef<Type*> Elements) {}

bool StructType::isSized(SmallPtrSetImpl<Type*> *Visited) const {}

StringRef StructType::getName() const {}

bool StructType::isValidElementType(Type *ElemTy) {}

bool StructType::isLayoutIdentical(StructType *Other) const {}

Type *StructType::getTypeAtIndex(const Value *V) const {}

bool StructType::indexValid(const Value *V) const {}

StructType *StructType::getTypeByName(LLVMContext &C, StringRef Name) {}

//===----------------------------------------------------------------------===//
//                           ArrayType Implementation
//===----------------------------------------------------------------------===//

ArrayType::ArrayType(Type *ElType, uint64_t NumEl)
    :{}

ArrayType *ArrayType::get(Type *ElementType, uint64_t NumElements) {}

bool ArrayType::isValidElementType(Type *ElemTy) {}

//===----------------------------------------------------------------------===//
//                          VectorType Implementation
//===----------------------------------------------------------------------===//

VectorType::VectorType(Type *ElType, unsigned EQ, Type::TypeID TID)
    :{}

VectorType *VectorType::get(Type *ElementType, ElementCount EC) {}

bool VectorType::isValidElementType(Type *ElemTy) {}

//===----------------------------------------------------------------------===//
//                        FixedVectorType Implementation
//===----------------------------------------------------------------------===//

FixedVectorType *FixedVectorType::get(Type *ElementType, unsigned NumElts) {}

//===----------------------------------------------------------------------===//
//                       ScalableVectorType Implementation
//===----------------------------------------------------------------------===//

ScalableVectorType *ScalableVectorType::get(Type *ElementType,
                                            unsigned MinNumElts) {}

//===----------------------------------------------------------------------===//
//                         PointerType Implementation
//===----------------------------------------------------------------------===//

PointerType *PointerType::get(Type *EltTy, unsigned AddressSpace) {}

PointerType *PointerType::get(LLVMContext &C, unsigned AddressSpace) {}

PointerType::PointerType(LLVMContext &C, unsigned AddrSpace)
    :{}

PointerType *Type::getPointerTo(unsigned AddrSpace) const {}

bool PointerType::isValidElementType(Type *ElemTy) {}

bool PointerType::isLoadableOrStorableType(Type *ElemTy) {}

//===----------------------------------------------------------------------===//
//                       TargetExtType Implementation
//===----------------------------------------------------------------------===//

TargetExtType::TargetExtType(LLVMContext &C, StringRef Name,
                             ArrayRef<Type *> Types, ArrayRef<unsigned> Ints)
    :{}

TargetExtType *TargetExtType::get(LLVMContext &C, StringRef Name,
                                  ArrayRef<Type *> Types,
                                  ArrayRef<unsigned> Ints) {}

Expected<TargetExtType *> TargetExtType::getOrError(LLVMContext &C,
                                                    StringRef Name,
                                                    ArrayRef<Type *> Types,
                                                    ArrayRef<unsigned> Ints) {}

Expected<TargetExtType *> TargetExtType::checkParams(TargetExtType *TTy) {}

namespace {
struct TargetTypeInfo {};
} // anonymous namespace

static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) {}

Type *TargetExtType::getLayoutType() const {}

bool TargetExtType::hasProperty(Property Prop) const {}