clang
3.7.0
|
#include "CodeGenFunction.h"
#include "CGCXXABI.h"
#include "CGCall.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CGOpenMPRuntime.h"
#include "CGRecordLayout.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/MathExtras.h"
Go to the source code of this file.
Enumerations | |
enum | ConstantEmissionKind { CEK_None, CEK_AsReferenceOnly, CEK_AsValueOrReference, CEK_AsValueOnly } |
enum | CheckRecoverableKind |
Specify under what conditions this check can be recovered. More... | |
|
strong |
Specify under what conditions this check can be recovered.
Definition at line 2237 of file CGExpr.cpp.
enum ConstantEmissionKind |
Can we constant-emit a load of a reference to a variable of the given type? This is different from predicates like Decl::isUsableInConstantExpressions because we do want it to apply in situations that don't necessarily satisfy the language's rules for this (e.g. C++'s ODR-use rules). For example, we want to able to do this with const float variables even if those variables aren't marked 'constexpr'.
Enumerator | |
---|---|
CEK_None | |
CEK_AsReferenceOnly | |
CEK_AsValueOrReference | |
CEK_AsValueOnly |
Definition at line 970 of file CGExpr.cpp.
|
static |
Definition at line 976 of file CGExpr.cpp.
References CEK_AsReferenceOnly, CEK_AsValueOnly, CEK_AsValueOrReference, CEK_None, clang::QualType::getCanonicalType(), and isConstantEmittableObjectType().
Referenced by clang::CodeGen::CodeGenFunction::tryEmitAsConstant().
|
static |
Definition at line 300 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CreateMemTemp(), clang::CodeGen::CodeGenModule::EmitConstantExpr(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getModule(), clang::CharUnits::getQuantity(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), clang::Type::isArrayType(), clang::Type::isRecordType(), clang::CodeGen::CodeGenModule::isTypeConstant(), clang::SD_Automatic, clang::SD_Dynamic, clang::SD_FullExpression, clang::SD_Static, and clang::SD_Thread.
Referenced by clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr().
|
static |
Definition at line 1829 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::Builder.
Referenced by EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(), and EmitThreadPrivateVarDeclLValue().
|
static |
Definition at line 1894 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::getContext(), clang::FieldDecl::getParent(), clang::ASTContext::getTagDeclType(), and clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
|
static |
Definition at line 2261 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), clang::CodeGen::CodeGenFunction::getLLVMContext(), and Unrecoverable.
Referenced by clang::CodeGen::CodeGenFunction::EmitCheck().
|
static |
Definition at line 1875 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::Type::getAs(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getDeclAlign(), clang::ASTContext::getFunctionNoProtoType(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::FunctionDecl::hasPrototype(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and clang::CodeGen::CodeGenFunction::EmitMemberExpr().
|
static |
Named Registers are named metadata pointing to the register name which will be read from/written to as an argument to the intrinsic .read/write_register. So far, only the name is being passed down, but other options such as register type, allocation type or even optimization options could be passed down via the metadata node.
Definition at line 1907 of file CGExpr.cpp.
References clang::Decl::getAttr(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::CodeGen::CodeGenModule::getModule(), and clang::ValueDecl::getType().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue().
|
static |
Definition at line 1844 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), EmitBitCastOfLValueToProperType(), clang::CodeGen::CGCXXABI::EmitThreadLocalVarDeclLValue(), EmitThreadPrivateVarDeclLValue(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::ASTContext::getDeclAlign(), clang::Expr::getExprLoc(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::CharUnits::getQuantity(), clang::VarDecl::getTLSKind(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenFunction::getTypes(), clang::Decl::hasAttr(), clang::Type::isReferenceType(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), setObjCGCLValueClass(), clang::VarDecl::TLS_Dynamic, and clang::CodeGen::CGCXXABI::usesThreadWrapperFunction().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and clang::CodeGen::CodeGenFunction::EmitMemberExpr().
|
static |
Emit the hash_16_bytes function from include/llvm/ADT/Hashing.h.
Definition at line 471 of file CGExpr.cpp.
|
static |
Emit the operand of a glvalue conditional operator. This is either a glvalue or a (possibly-parenthesized) throw-expression. If this is a throw, no LValue is returned and the current block has been terminated.
Definition at line 2856 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::Expr::IgnoreParens(), and clang::None.
Referenced by clang::CodeGen::CodeGenFunction::EmitConditionalOperatorLValue().
|
static |
Definition at line 3504 of file CGExpr.cpp.
References clang::CodeGen::AggValueSlot::asRValue(), clang::CodeGen::CodeGenFunction::EmitAggExpr(), clang::CodeGen::CodeGenFunction::EmitAnyExpr(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::AggValueSlot::getAddr(), clang::PseudoObjectExpr::getResultExpr(), clang::Expr::isRValue(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::PseudoObjectExpr::semantics_begin(), and clang::PseudoObjectExpr::semantics_end().
Referenced by clang::CodeGen::CodeGenFunction::EmitPseudoObjectLValue(), and clang::CodeGen::CodeGenFunction::EmitPseudoObjectRValue().
|
static |
Definition at line 1836 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::CGM, EmitBitCastOfLValueToProperType(), clang::CodeGen::CodeGenModule::getOpenMPRuntime(), and clang::CodeGen::CodeGenFunction::MakeAddrLValue().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and EmitGlobalVarDeclLValue().
|
static |
Definition at line 2577 of file CGExpr.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr().
|
static |
If Base is known to point to the start of an array, return the length of that array. Return 0 if the length cannot be determined.
Definition at line 675 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAsArrayTypeUnsafe(), clang::CK_ArrayToPointerDecay, clang::Type::getAs(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getVLASize(), clang::Expr::IgnoreParens(), and isFlexibleArrayMemberExpr().
Referenced by clang::CodeGen::CodeGenFunction::EmitBoundsCheck().
|
static |
Definition at line 1076 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), End, clang::Type::getAs(), clang::CodeGen::CodeGenFunction::getContext(), clang::EnumType::getDecl(), clang::EnumDecl::getIntegerType(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::EnumDecl::getNumNegativeBits(), clang::EnumDecl::getNumPositiveBits(), clang::ASTContext::getTypeSize(), hasBooleanRepresentation(), and clang::EnumDecl::isFixed().
Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfScalar().
|
static |
Definition at line 2248 of file CGExpr.cpp.
References Unrecoverable.
Referenced by clang::CodeGen::CodeGenFunction::EmitCheck().
Definition at line 1063 of file CGExpr.cpp.
References clang::Type::getAs(), and clang::Type::isBooleanType().
Referenced by clang::CodeGen::CodeGenFunction::EmitFromMemory(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitToMemory(), and getRangeForType().
Given an object of the given canonical type, can we safely copy a value out of it based on its initializer?
Definition at line 945 of file CGExpr.cpp.
References clang::QualType::getLocalQualifiers(), clang::QualType::isCanonical(), and clang::Type::isReferenceType().
Referenced by checkVarTypeForConstantEmission().
Determine whether this expression refers to a flexible array member in a struct. We disable array bounds checks for such members.
Definition at line 647 of file CGExpr.cpp.
References clang::Type::castAsArrayTypeUnsafe(), clang::Expr::getType(), and clang::Expr::IgnoreParens().
Referenced by getArrayIndexingBound().
isSimpleArrayDecayOperand - If the specified expr is a simple decay from an array to pointer, return the array subexpression.
Definition at line 2431 of file CGExpr.cpp.
References clang::CK_ArrayToPointerDecay, clang::Expr::getType(), and clang::Type::isVariableArrayType().
Referenced by clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr().
|
static |
Definition at line 180 of file CGExpr.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::Complete, clang::CodeGen::CodeGenFunction::destroyARCStrongImprecise, clang::CodeGen::CodeGenFunction::destroyARCStrongPrecise, clang::CodeGen::CodeGenFunction::destroyARCWeak, clang::CodeGen::CodeGenFunction::destroyCXXObject, clang::CodeGen::EHCleanup, clang::CodeGen::CodeGenFunction::generateDestroyHelper(), clang::CodeGen::CodeGenModule::getAddrOfCXXStructor(), clang::CodeGen::CodeGenFunction::getARCCleanupKind(), clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::QualType::getObjCLifetime(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::Type::isArrayType(), clang::Type::isObjCLifetimeType(), clang::CodeGen::NormalAndEHCleanup, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::CodeGen::CodeGenFunction::pushDestroy(), clang::CodeGen::CodeGenFunction::pushLifetimeExtendedDestroy(), clang::CodeGen::CGCXXABI::registerGlobalDtor(), clang::SD_Automatic, clang::SD_Dynamic, clang::SD_FullExpression, clang::SD_Static, and clang::SD_Thread.
Referenced by clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr().
|
static |
Definition at line 1731 of file CGExpr.cpp.
References clang::Type::getAs(), clang::ASTContext::getLangOpts(), clang::PointerType::getPointeeType(), clang::Expr::getType(), clang::Type::isArrayType(), clang::CodeGen::LValue::isGlobalObjCRef(), clang::CodeGen::LValue::isObjCArray(), clang::CodeGen::LValue::isObjCIvar(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::LangOptions::NonGC, clang::CodeGen::LValue::setBaseIvarExp(), clang::CodeGen::LValue::setGlobalObjCRef(), clang::CodeGen::LValue::setObjCArray(), clang::CodeGen::LValue::setObjCIvar(), clang::CodeGen::LValue::setThreadLocalRef(), and clang::VarDecl::TLS_None.
Referenced by clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), EmitGlobalVarDeclLValue(), clang::CodeGen::CodeGenFunction::EmitMemberExpr(), and clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue().