================
@@ -8038,6 +8060,32 @@ class DependentBitIntType final : public Type, public
llvm::FoldingSetNode {
}
};
+class PredefinedSugarType final : public Type {
+public:
+ friend class ASTContext;
+ using Kind = PredefinedSugarKind;
+
+private:
+ PredefinedSugarType(Kind KD, QualType UnderlyingType)
+ : Type(PredefinedSugar, UnderlyingType->getCanonicalTypeInternal(),
+ TypeDependence::None) {
+ PredefinedSugarTypeBits.Kind = llvm::to_underlying(KD);
+ }
+
+public:
+ bool isSugared() const { return true; }
+
+ QualType desugar() const { return getCanonicalTypeInternal(); }
+
+ Kind getKind() const { return Kind(PredefinedSugarTypeBits.Kind); }
+
+ StringRef getName() const;
----------------
mizvekov wrote:
It might be worthwhile to consider returning an IdentifierInfo. These are
uniqued, which makes it cheaper to compare them, and it increases commonality
with other code that deals with these identifiers.
https://github.com/llvm/llvm-project/pull/143653
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits