|
clang
5.0.0
|
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset], [Vector: N * APValue], [Array: N * APValue]. More...
#include "clang/AST/APValue.h"
Classes | |
| struct | LV |
| union | LValuePathEntry |
| struct | MemberPointerData |
| struct | NoLValuePath |
| struct | UninitArray |
| struct | UninitStruct |
Public Types | |
| enum | ValueKind { Uninitialized, Int, Float, ComplexInt, ComplexFloat, LValue, Vector, Array, Struct, Union, MemberPointer, AddrLabelDiff } |
| typedef llvm::PointerUnion < const ValueDecl *, const Expr * > | LValueBase |
| typedef llvm::PointerIntPair < const Decl *, 1, bool > | BaseOrMemberType |
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset], [Vector: N * APValue], [Array: N * APValue].
| typedef llvm::PointerIntPair<const Decl *, 1, bool> clang::APValue::BaseOrMemberType |
| typedef llvm::PointerUnion<const ValueDecl *, const Expr *> clang::APValue::LValueBase |
|
inlineexplicit |
|
inlineexplicit |
Definition at line 124 of file APValue.h.
References setFloat().
Definition at line 127 of file APValue.h.
References setVector().
|
inline |
Definition at line 130 of file APValue.h.
References setComplexInt().
|
inline |
Definition at line 133 of file APValue.h.
References setComplexFloat().
| APValue::APValue | ( | const APValue & | RHS | ) |
Definition at line 124 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, Float, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFloat(), getInt(), getKind(), getLValueBase(), getLValueCallIndex(), getLValueOffset(), getLValuePath(), getMemberPointerDecl(), getMemberPointerPath(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionField(), getUnionValue(), getVectorLength(), hasArrayFiller(), hasLValuePath(), I, Int, isLValueOnePastTheEnd(), isMemberPointerToDerivedMember(), isNullPointer(), LValue, MemberPointer, setAddrLabelDiff(), setComplexFloat(), setComplexInt(), setFloat(), setInt(), setLValue(), setUnion(), setVector(), Struct, Uninitialized, Union, and Vector.
|
inline |
|
inline |
Definition at line 138 of file APValue.h.
References setLValue().
|
inline |
Definition at line 143 of file APValue.h.
References setLValue().
|
inline |
|
inline |
Definition at line 154 of file APValue.h.
References setUnion().
|
inline |
|
inline |
Definition at line 162 of file APValue.h.
References setAddrLabelDiff().
| LLVM_DUMP_METHOD void APValue::dump | ( | ) | const |
Definition at line 258 of file APValue.cpp.
Referenced by dump().
| void APValue::dump | ( | raw_ostream & | OS | ) | const |
Definition at line 271 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, dump(), Float, GetApproxValue(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), getArraySize(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFloat(), getInt(), getKind(), getStructBase(), getStructField(), getStructNumBases(), getStructNumFields(), getUnionValue(), getVectorElt(), getVectorLength(), hasArrayFiller(), I, Int, LValue, MemberPointer, Struct, Uninitialized, Union, and Vector.
|
inline |
Definition at line 340 of file APValue.h.
References isAddrLabelDiff().
Referenced by APValue(), clang::CodeGen::CodeGenModule::EmitConstantValue(), and printPretty().
|
inline |
Definition at line 344 of file APValue.h.
References isAddrLabelDiff().
Referenced by APValue(), clang::CodeGen::CodeGenModule::EmitConstantValue(), and printPretty().
|
inline |
Definition at line 284 of file APValue.h.
References getArrayInitializedElts(), hasArrayFiller(), and isArray().
Referenced by APValue(), CheckConstantExpression(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), expandArray(), expandStringLiteral(), findSubobject(), and getArrayFiller().
|
inline |
Definition at line 289 of file APValue.h.
References getArrayFiller().
Definition at line 273 of file APValue.h.
References getArrayInitializedElts(), I, and isArray().
Referenced by APValue(), CheckConstantExpression(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), expandArray(), expandStringLiteral(), findSubobject(), getArrayInitializedElt(), and printPretty().
Definition at line 278 of file APValue.h.
References getArrayInitializedElt().
|
inline |
Definition at line 292 of file APValue.h.
References isArray().
Referenced by APValue(), CheckConstantExpression(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), expandArray(), expandStringLiteral(), findSubobject(), getArrayFiller(), getArrayInitializedElt(), hasArrayFiller(), and printPretty().
|
inline |
Definition at line 296 of file APValue.h.
References isArray().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), expandArray(), and hasArrayFiller().
| std::string APValue::getAsString | ( | ASTContext & | Ctx, |
| QualType | Ty | ||
| ) | const |
Definition at line 545 of file APValue.cpp.
References printPretty(), and clang::Result.
Referenced by CheckConvertedConstantExpression(), clang::Sema::CheckTemplateArgument(), and DiagnoseNarrowingInInitList().
|
inline |
Definition at line 241 of file APValue.h.
References isComplexFloat().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), findSubobject(), getComplexFloatImag(), HandleConversionToBool(), needsCleanup(), and printPretty().
|
inline |
Definition at line 245 of file APValue.h.
References getComplexFloatImag().
|
inline |
Definition at line 233 of file APValue.h.
References isComplexFloat().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), findSubobject(), getComplexFloatReal(), HandleConversionToBool(), needsCleanup(), and printPretty().
|
inline |
Definition at line 237 of file APValue.h.
References getComplexFloatReal().
|
inline |
Definition at line 225 of file APValue.h.
References isComplexInt().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), findSubobject(), getComplexIntImag(), HandleConversionToBool(), needsCleanup(), and printPretty().
|
inline |
Definition at line 229 of file APValue.h.
References getComplexIntImag().
|
inline |
Definition at line 217 of file APValue.h.
References isComplexInt().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), findSubobject(), getComplexIntReal(), HandleConversionToBool(), needsCleanup(), and printPretty().
|
inline |
Definition at line 221 of file APValue.h.
References getComplexIntReal().
|
inline |
Definition at line 209 of file APValue.h.
References isFloat().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), EvalAndBitcastToAPInt(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), HandleConversionToBool(), needsCleanup(), and printPretty().
|
inline |
Definition at line 213 of file APValue.h.
References getFloat().
|
inline |
Definition at line 201 of file APValue.h.
References isInt().
Referenced by APValue(), clang::Sema::CheckEnableIf(), clang::Sema::CheckTemplateArgument(), clang::Sema::diagnoseArgDependentDiagnoseIfAttrs(), dump(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), EvalAndBitcastToAPInt(), EvaluateCPlusPlus11IntegralConstantExpr(), EvaluateInteger(), getInt(), HandleConversionToBool(), needsCleanup(), printPretty(), truncateBitfieldValue(), and clang::Sema::VerifyIntegerConstantExpression().
|
inline |
|
inline |
Definition at line 181 of file APValue.h.
Referenced by APValue(), clang::Sema::CheckTemplateArgument(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EvaluateBuiltinConstantP(), HandleConversionToBool(), needsCleanup(), and printPretty().
| const APValue::LValueBase APValue::getLValueBase | ( | ) | const |
Definition at line 553 of file APValue.cpp.
References isLValue().
Referenced by APValue(), clang::Sema::CheckTemplateArgument(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EvalPointerValueAsBool(), findSubobject(), isNullPointerValueTemplateArgument(), and printPretty().
| unsigned APValue::getLValueCallIndex | ( | ) | const |
| CharUnits & APValue::getLValueOffset | ( | ) |
Definition at line 563 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EvalPointerValueAsBool(), getLValueOffset(), and printPretty().
|
inline |
Definition at line 251 of file APValue.h.
References getLValueOffset().
| ArrayRef< APValue::LValuePathEntry > APValue::getLValuePath | ( | ) | const |
Definition at line 573 of file APValue.cpp.
References clang::APValue::LV::getPath(), hasLValuePath(), and isLValue().
Referenced by APValue(), clang::Sema::CheckTemplateArgument(), findSubobject(), and printPretty().
| const ValueDecl * APValue::getMemberPointerDecl | ( | ) | const |
Definition at line 615 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), CheckMemberPointerConstantExpression(), clang::Sema::CheckTemplateArgument(), clang::CodeGen::CGCXXABI::getMemberPointerPathAdjustment(), HandleConversionToBool(), isNullPointerValueTemplateArgument(), and printPretty().
| ArrayRef< const CXXRecordDecl * > APValue::getMemberPointerPath | ( | ) | const |
Definition at line 629 of file APValue.cpp.
References clang::APValue::MemberPointerData::getPath(), and isMemberPointer().
Referenced by APValue(), clang::Sema::CheckTemplateArgument(), and clang::CodeGen::CGCXXABI::getMemberPointerPathAdjustment().
Definition at line 309 of file APValue.h.
References isStruct().
Referenced by APValue(), CheckConstantExpression(), dump(), findSubobject(), getStructBase(), HandleConstructorCall(), and printPretty().
Definition at line 317 of file APValue.h.
References getStructBase().
Definition at line 313 of file APValue.h.
References getStructNumBases(), and isStruct().
Referenced by APValue(), CheckConstantExpression(), dump(), findSubobject(), getStructField(), HandleConstructorCall(), and printPretty().
Definition at line 320 of file APValue.h.
References getStructField().
|
inline |
Definition at line 301 of file APValue.h.
References isStruct().
Referenced by APValue(), dump(), getStructField(), and printPretty().
|
inline |
Definition at line 305 of file APValue.h.
References isStruct().
|
inline |
Definition at line 324 of file APValue.h.
References isUnion().
Referenced by APValue(), CheckConstantExpression(), findSubobject(), HandleConstructorCall(), and printPretty().
|
inline |
Definition at line 328 of file APValue.h.
References isUnion().
Referenced by APValue(), CheckConstantExpression(), dump(), findSubobject(), getUnionValue(), HandleConstructorCall(), and printPretty().
|
inline |
Definition at line 332 of file APValue.h.
References getUnionValue().
Definition at line 260 of file APValue.h.
References getVectorLength(), I, and isVector().
Referenced by dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EvalAndBitcastToAPInt(), getVectorElt(), and printPretty().
Definition at line 265 of file APValue.h.
References getVectorElt().
|
inline |
Definition at line 268 of file APValue.h.
References isVector().
Referenced by APValue(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EvalAndBitcastToAPInt(), getVectorElt(), and printPretty().
|
inline |
Definition at line 281 of file APValue.h.
References getArrayInitializedElts(), and getArraySize().
Referenced by APValue(), CheckConstantExpression(), dump(), clang::CodeGen::CodeGenModule::EmitConstantValue(), expandArray(), expandStringLiteral(), and getArrayFiller().
| bool APValue::hasLValuePath | ( | ) | const |
Definition at line 568 of file APValue.cpp.
References isLValue().
Referenced by addOrSubLValueAsInteger(), APValue(), clang::Sema::CheckTemplateArgument(), findSubobject(), getLValuePath(), and printPretty().
|
inline |
Definition at line 193 of file APValue.h.
References AddrLabelDiff.
Referenced by getAddrLabelDiffLHS(), and getAddrLabelDiffRHS().
|
inline |
Definition at line 189 of file APValue.h.
References Array.
Referenced by CheckConstantExpression(), getArrayFiller(), getArrayInitializedElt(), getArrayInitializedElts(), and getArraySize().
|
inline |
Definition at line 186 of file APValue.h.
References ComplexFloat.
Referenced by findSubobject(), getComplexFloatImag(), getComplexFloatReal(), and setComplexFloat().
|
inline |
Definition at line 185 of file APValue.h.
References ComplexInt.
Referenced by findSubobject(), getComplexIntImag(), getComplexIntReal(), and setComplexInt().
|
inline |
Definition at line 184 of file APValue.h.
References Float.
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), EvalAndBitcastToAPInt(), getFloat(), clang::StandardConversionSequence::getNarrowingKind(), and setFloat().
|
inline |
Definition at line 183 of file APValue.h.
References Int.
Referenced by CheckConvertedConstantExpression(), clang::Sema::CheckEnableIf(), CheckEvalInICE(), clang::Sema::diagnoseArgDependentDiagnoseIfAttrs(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenModule::EmitConstantValue(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), EvalAndBitcastToAPInt(), EvaluateCPlusPlus11IntegralConstantExpr(), EvaluateInteger(), getInt(), setInt(), truncateBitfieldValue(), and clang::Sema::VerifyIntegerConstantExpression().
|
inline |
Definition at line 187 of file APValue.h.
References LValue.
Referenced by CheckConstantExpression(), findSubobject(), getLValueBase(), getLValueCallIndex(), getLValueOffset(), getLValuePath(), hasLValuePath(), isLValueOnePastTheEnd(), isNullPointer(), isNullPointerValueTemplateArgument(), setLValue(), and truncateBitfieldValue().
| bool APValue::isLValueOnePastTheEnd | ( | ) | const |
Definition at line 558 of file APValue.cpp.
References isLValue().
Referenced by APValue(), clang::Sema::CheckTemplateArgument(), and printPretty().
|
inline |
Definition at line 192 of file APValue.h.
References MemberPointer.
Referenced by CheckConstantExpression(), getMemberPointerDecl(), getMemberPointerPath(), isMemberPointerToDerivedMember(), and isNullPointerValueTemplateArgument().
| bool APValue::isMemberPointerToDerivedMember | ( | ) | const |
Definition at line 622 of file APValue.cpp.
References isMemberPointer().
Referenced by APValue(), and clang::CodeGen::CGCXXABI::getMemberPointerPathAdjustment().
| bool APValue::isNullPointer | ( | ) | const |
Definition at line 584 of file APValue.cpp.
References isLValue().
Referenced by APValue(), and clang::CodeGen::CodeGenModule::EmitConstantValue().
|
inline |
Definition at line 190 of file APValue.h.
References Struct.
Referenced by CheckConstantExpression(), getStructBase(), getStructField(), getStructNumBases(), and getStructNumFields().
|
inline |
Definition at line 182 of file APValue.h.
References Uninitialized.
Referenced by CheckConstantExpression(), clang::CodeGen::CodeGenFunction::EmitDeclRefExprDbgValue(), clang::VarDecl::evaluateValue(), findSubobject(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), and HandleConstructorCall().
|
inline |
Definition at line 191 of file APValue.h.
References Union.
Referenced by CheckConstantExpression(), getUnionField(), getUnionValue(), HandleConstructorCall(), and setUnion().
|
inline |
Definition at line 188 of file APValue.h.
References Vector.
Referenced by EvalAndBitcastToAPInt(), getVectorElt(), getVectorLength(), and setVector().
| bool APValue::needsCleanup | ( | ) | const |
Returns whether the object performed allocations.
If APValues are constructed via placement new, needsCleanup() indicates whether the destructor must be called in order to correctly free all allocated memory.
Definition at line 215 of file APValue.cpp.
References AddrLabelDiff, Array, ComplexFloat, ComplexInt, Float, getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), getFloat(), getInt(), getKind(), Int, LValue, MemberPointer, Struct, Uninitialized, Union, and Vector.
Referenced by clang::VarDecl::evaluateValue().
| void APValue::printPretty | ( | raw_ostream & | OS, |
| ASTContext & | Ctx, | ||
| QualType | Ty | ||
| ) | const |
Definition at line 344 of file APValue.cpp.
References AddrLabelDiff, Array, clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), ComplexFloat, ComplexInt, E, clang::RecordDecl::fields(), Float, getAddrLabelDiffLHS(), getAddrLabelDiffRHS(), GetApproxValue(), getArrayInitializedElt(), getArrayInitializedElts(), clang::Type::getAs(), clang::ASTContext::getAsArrayType(), getComplexFloatImag(), getComplexFloatReal(), getComplexIntImag(), getComplexIntReal(), clang::ArrayType::getElementType(), getFloat(), getInt(), getKind(), clang::AddrLabelExpr::getLabel(), getLValueBase(), getLValueOffset(), getLValuePath(), getMemberPointerDecl(), clang::NamedDecl::getName(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::ASTContext::getPrintingPolicy(), clang::ASTContext::getRecordType(), getStructBase(), getStructField(), getStructNumBases(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), getUnionField(), getUnionValue(), getVectorElt(), getVectorLength(), hasLValuePath(), I, Int, clang::Type::isBooleanType(), isLValueOnePastTheEnd(), clang::QualType::isNull(), clang::Type::isReferenceType(), clang::CharUnits::isZero(), LValue, MemberPointer, clang::CharUnits::One(), printPretty(), clang::Stmt::printPretty(), S, Struct, Uninitialized, Union, and Vector.
Referenced by describeCall(), getAsString(), and printPretty().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void APValue::setLValue | ( | LValueBase | B, |
| const CharUnits & | O, | ||
| NoLValuePath | , | ||
| unsigned | CallIndex, | ||
| bool | IsNullPtr | ||
| ) |
Definition at line 589 of file APValue.cpp.
References isLValue(), and clang::APValue::LV::resizePath().
Referenced by APValue().
| void APValue::setLValue | ( | LValueBase | B, |
| const CharUnits & | O, | ||
| ArrayRef< LValuePathEntry > | Path, | ||
| bool | OnePastTheEnd, | ||
| unsigned | CallIndex, | ||
| bool | IsNullPtr | ||
| ) |
Definition at line 601 of file APValue.cpp.
References clang::APValue::LV::getPath(), isLValue(), and clang::APValue::LV::resizePath().
| void APValue::swap | ( | APValue & | RHS | ) |
Swaps the contents of this and the given APValue.
Definition at line 250 of file APValue.cpp.
Referenced by APValue(), expandArray(), and operator=().
1.8.6