14#ifndef LLVM_CLANG_AST_COMPARISONCATEGORIES_H
15#define LLVM_CLANG_AST_COMPARISONCATEGORIES_H
18#include "llvm/ADT/APSInt.h"
19#include "llvm/ADT/DenseMap.h"
61std::optional<ComparisonCategoryType>
128 ValueInfo *Info = lookupValueInfo(ValueKind);
130 "comparison category does not contain the specified result kind");
132 "couldn't determine the integer constant for this value");
140 return Kind == CCK::StrongOrdering;
146 return Kind == CCK::PartialOrdering;
154 if (!
isStrong() && Res == CCR::Equal)
155 return CCR::Equivalent;
181 static std::vector<ComparisonCategoryResult>
188 assert(
Result !=
nullptr &&
189 "information for specified comparison category has not been built");
208 const auto &This = *
this;
223 mutable llvm::DenseMap<char, ComparisonCategoryInfo>
Data;
enum clang::sema::@1655::IndirectLocalPathEntry::EntryKind Kind
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::Record Record
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a C++ struct/union/class.
const ComparisonCategoryInfo * lookupInfoForType(QualType Ty) const
ComparisonCategoryInfo * lookupInfo(ComparisonCategoryType Kind)
const ComparisonCategoryInfo & getInfoForType(QualType Ty) const
Return the comparison category information as specified by getCategoryForType(Ty).
const ComparisonCategoryInfo * lookupInfo(ComparisonCategoryType Kind) const
Return the cached comparison category information for the specified 'Kind'.
const ComparisonCategoryInfo & getInfo(ComparisonCategoryType Kind) const
Return the comparison category information for the category specified by 'Kind'.
static StringRef getCategoryString(ComparisonCategoryType Kind)
static StringRef getResultString(ComparisonCategoryResult Kind)
static std::vector< ComparisonCategoryResult > getPossibleResultsForType(ComparisonCategoryType Type)
Return the list of results which are valid for the specified comparison category type.
bool isPartial() const
True iff the comparison is not totally ordered.
const ValueInfo * getLess() const
const ValueInfo * getUnordered() const
const ValueInfo * getValueInfo(ComparisonCategoryResult ValueKind) const
ComparisonCategoryType Kind
The Kind of the comparison category type.
bool isStrong() const
True iff the comparison is "strong".
const ValueInfo * getGreater() const
const ValueInfo * getEqualOrEquiv() const
ComparisonCategoryResult makeWeakResult(ComparisonCategoryResult Res) const
Converts the specified result kind into the correct result kind for this category.
ComparisonCategoryInfo(const ASTContext &Ctx, const CXXRecordDecl *RD, ComparisonCategoryType Kind)
Represent a C++ namespace.
A (possibly-)qualified type.
Sema - This implements semantic analysis and AST building for C.
The base class of the type hierarchy.
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.
std::optional< ComparisonCategoryType > getComparisonCategoryForBuiltinCmp(QualType T)
Get the comparison category that should be used when comparing values of type T.
ComparisonCategoryType commonComparisonType(ComparisonCategoryType A, ComparisonCategoryType B)
Determine the common comparison type, as defined in C++2a [class.spaceship]p4.
ComparisonCategoryResult
An enumeration representing the possible results of a three-way comparison.
@ Result
The result type of a method or function.
ComparisonCategoryType
An enumeration representing the different comparison categories types.
const FunctionProtoType * T
Diagnostic wrappers for TextAPI types for error reporting.
ValueInfo(ComparisonCategoryResult Kind, VarDecl *VD)
bool hasValidIntValue() const
True iff we've successfully evaluated the variable as a constant expression and extracted its integer...
ComparisonCategoryResult Kind
llvm::APSInt getIntValue() const
Get the constant integer value used by this variable to represent the comparison category result type...