clang
8.0.0
|
#include "clang/AST/ComparisonCategories.h"
Public Member Functions | |
ValueInfo (ComparisonCategoryResult Kind, VarDecl *VD) | |
bool | hasValidIntValue () const |
True iff we've successfully evaluated the variable as a constant expression and extracted its integer value. More... | |
llvm::APSInt | getIntValue () const |
Get the constant integer value used by this variable to represent the comparison category result type. More... | |
Public Attributes | |
ComparisonCategoryResult | Kind |
VarDecl * | VD |
Definition at line 77 of file ComparisonCategories.h.
|
inline |
Definition at line 81 of file ComparisonCategories.h.
llvm::APSInt ComparisonCategoryInfo::ValueInfo::getIntValue | ( | ) | const |
Get the constant integer value used by this variable to represent the comparison category result type.
Attempt to determine the integer value used to represent the comparison category result by evaluating the initializer for the specified VarDecl as a constant expression and retreiving the value of the class's first (and only) field.
Note: The STL types are expected to have the form: struct X { T value; }; where T is an integral or enumeration type.
Definition at line 46 of file ComparisonCategories.cpp.
References clang::DeclContextLookupResult::back(), clang::VarDecl::evaluateValue(), clang::DeclContextLookupResult::front(), clang::CXXRecordDecl::getCanonicalDecl(), clang::APValue::getInt(), clang::ComparisonCategories::getResultString(), clang::APValue::getStructField(), hasValidIntValue(), Kind, clang::DeclContext::lookup(), clang::ComparisonCategoryInfo::Record, clang::DeclContextLookupResult::size(), and VD.
bool ComparisonCategoryInfo::ValueInfo::hasValidIntValue | ( | ) | const |
True iff we've successfully evaluated the variable as a constant expression and extracted its integer value.
Definition at line 23 of file ComparisonCategories.cpp.
References clang::VarDecl::checkInitIsICE(), distance(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::Type::getAsCXXRecordDecl(), clang::ValueDecl::getType(), clang::ComparisonCategoryInfo::Record, and VD.
Referenced by getIntValue(), and clang::ComparisonCategoryInfo::getValueInfo().
ComparisonCategoryResult clang::ComparisonCategoryInfo::ValueInfo::Kind |
Definition at line 78 of file ComparisonCategories.h.
Referenced by getIntValue().
VarDecl* clang::ComparisonCategoryInfo::ValueInfo::VD |
Definition at line 79 of file ComparisonCategories.h.
Referenced by getIntValue(), and hasValidIntValue().