Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Definitions for classes related to type representation. More...
#include "type.h"
#include "expr.h"
#include "llvmutil.h"
#include "module.h"
#include "sym.h"
#include <llvm/BinaryFormat/Dwarf.h>
#include <llvm/IR/DIBuilder.h>
#include <llvm/IR/DebugInfo.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Value.h>
#include <llvm/Support/MathExtras.h>
#include <map>
#include <stdio.h>
Go to the source code of this file.
Functions | |
static bool | lShouldPrintName (const std::string &name) |
static llvm::DIType * | lCreateDIArray (llvm::DIType *eltType, int count) |
static llvm::Type * | lGetAtomicLLVMType (llvm::LLVMContext *ctx, const AtomicType *aType, bool isStorageType) |
static llvm::Type * | lGetVectorLLVMType (llvm::LLVMContext *ctx, const VectorType *vType, bool isStorage) |
static std::string | lMangleStructName (const std::string &name, Variability variability) |
static std::string | lMangleStruct (Variability variability, bool isConst, const std::string &name) |
static const Type * | lVectorConvert (const Type *type, SourcePos pos, const char *reason, int vecSize) |
static bool | lCheckTypeEquality (const Type *a, const Type *b, bool ignoreConst) |
Variables | |
static std::map< std::string, llvm::StructType * > | lStructTypeMap |
Definitions for classes related to type representation.
Definition in file type.cpp.
Definition at line 2767 of file type.cpp.
References AtomicType::basicType, Type::GetBaseType(), PointerType::GetBaseType(), ArrayType::GetElementCount(), VectorType::GetElementCount(), ArrayType::GetElementType(), VectorType::GetElementType(), FunctionType::GetNumParameters(), FunctionType::GetParameterType(), Type::GetReferenceTarget(), ReferenceType::GetReferenceTarget(), FunctionType::GetReturnType(), StructType::GetStructName(), Type::GetVariability(), AtomicType::GetVariability(), EnumType::GetVariability(), Type::IsConstType(), FunctionType::isExported, FunctionType::isExternC, PointerType::IsFrozenSlice(), PointerType::IsSlice(), FunctionType::isTask, Type::IsUniformType(), FunctionType::isUnmasked, and EnumType::pos.
Referenced by Type::Equal(), and Type::EqualIgnoringConst().
|
static |
Utility routine to create a llvm array type of the given number of the given element type.
Definition at line 70 of file type.cpp.
References Module::diBuilder, and m.
Referenced by EnumType::GetDIType(), PointerType::GetDIType(), and ArrayType::GetDIType().
|
static |
Definition at line 467 of file type.cpp.
References Assert, AtomicType::basicType, LLVMTypes::BoolStorageType, LLVMTypes::BoolType, LLVMTypes::BoolVectorStorageType, LLVMTypes::BoolVectorType, LLVMTypes::DoubleType, LLVMTypes::DoubleVectorType, FATAL, LLVMTypes::FloatType, LLVMTypes::FloatVectorType, AtomicType::GetAsUniformType(), AtomicType::GetVariability(), LLVMTypes::Int16Type, LLVMTypes::Int16VectorType, LLVMTypes::Int32Type, LLVMTypes::Int32VectorType, LLVMTypes::Int64Type, LLVMTypes::Int64VectorType, LLVMTypes::Int8Type, LLVMTypes::Int8VectorType, ArrayType::LLVMType(), Variability::soaWidth, Variability::type, AtomicType::TYPE_BOOL, AtomicType::TYPE_DOUBLE, AtomicType::TYPE_FLOAT, AtomicType::TYPE_INT16, AtomicType::TYPE_INT32, AtomicType::TYPE_INT64, AtomicType::TYPE_INT8, AtomicType::TYPE_UINT16, AtomicType::TYPE_UINT32, AtomicType::TYPE_UINT64, AtomicType::TYPE_UINT8, AtomicType::TYPE_VOID, Variability::Unbound, Variability::Uniform, AtomicType::variability, and Variability::Varying.
Referenced by AtomicType::LLVMStorageType(), and AtomicType::LLVMType().
|
static |
Definition at line 1420 of file type.cpp.
References Assert, VectorType::base, Module::errorCount, FATAL, VectorType::GetBaseType(), VectorType::GetElementCount(), VectorType::getVectorMemoryCount(), Type::IsSOAType(), Type::IsUniformType(), Type::IsVaryingType(), Type::LLVMStorageType(), Type::LLVMType(), m, and VectorType::numElements.
Referenced by VectorType::LLVMStorageType(), and VectorType::LLVMType().
|
static |
Mangle a struct name for use in function name mangling.
Definition at line 1772 of file type.cpp.
References Assert, Variability::MangleString(), and Variability::Unbound.
Referenced by StructType::Mangle(), and UndefinedStructType::Mangle().
|
static |
Using a struct's name, its variability, and the vector width for the current compilation target, this function generates a string that encodes that full structure type, for use in the lStructTypeMap. Note that the vector width is needed in order to differentiate between 'varying' structs with different compilation targets, which have different memory layouts...
Definition at line 1538 of file type.cpp.
References FATAL, g, Target::getVectorWidth(), Variability::SOA, Variability::soaWidth, Globals::target, Variability::type, Variability::Uniform, and Variability::Varying.
Referenced by StructType::GetCStructName(), StructType::LLVMType(), UndefinedStructType::LLVMType(), StructType::StructType(), and UndefinedStructType::UndefinedStructType().
|
static |
Utility routine used in code that prints out declarations; returns true if the given name should be printed, false otherwise. This allows us to omit the names for various internal things (whose names start with double underscores) and emit anonymous declarations for them instead.
Definition at line 59 of file type.cpp.
Referenced by AtomicType::GetCDeclaration(), EnumType::GetCDeclaration(), StructType::GetCDeclaration(), UndefinedStructType::GetCDeclaration(), and ReferenceType::GetCDeclaration().
|
static |
Given an atomic or vector type, return a vector type of the given vecSize. Issue an error if given a vector type that isn't already that size.
Definition at line 2578 of file type.cpp.
References Error(), VectorType::GetElementCount(), and Type::GetString().
Referenced by Type::MoreGeneralType().
|
static |
Definition at line 1529 of file type.cpp.
Referenced by StructType::LLVMType(), UndefinedStructType::LLVMType(), StructType::StructType(), and UndefinedStructType::UndefinedStructType().