This reflects the fact that only ASTContext should ever create an
instance of BuiltinType, and matches what we do for all the other Type
subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337048
91177308-0d34-0410-b5e6-
96231b3b80d8
#include "clang/AST/BuiltinTypes.def"
};
-public:
+private:
+ friend class ASTContext; // ASTContext creates these.
+
BuiltinType(Kind K)
: Type(Builtin, QualType(), /*Dependent=*/(K == Dependent),
/*InstantiationDependent=*/(K == Dependent),
BuiltinTypeBits.Kind = K;
}
+public:
Kind getKind() const { return static_cast<Kind>(BuiltinTypeBits.Kind); }
StringRef getName(const PrintingPolicy &Policy) const;