================
@@ -47,20 +47,46 @@ namespace clang {
class ASTContext;
class CXXBaseSpecifier;
+/// Base class for Objective-C object literals (@"...", @42, @[], @{}).
+class ObjCObjectLiteral : public Expr {
+protected:
+ ObjCObjectLiteral(StmtClass SC, QualType T, bool ECI, ExprValueKind VK,
+ ExprObjectKind OK)
+ : Expr(SC, T, VK, OK) {
+ setDependence(ExprDependence::None);
+ ObjCObjectLiteralBits.IsExpressibleAsConstantInitializer = ECI;
+ }
+ explicit ObjCObjectLiteral(StmtClass SC, EmptyShell Empty)
+ : Expr(SC, Empty) {}
+
+public:
+ bool isGlobalAllocation() const {
+ return isExpressibleAsConstantInitializer();
+ }
+ bool isExpressibleAsConstantInitializer() const {
+ return ObjCObjectLiteralBits.IsExpressibleAsConstantInitializer;
+ }
+ void setExpressibleAsConstantInitializer(bool ECI) {
----------------
ojhunt wrote:
To be clear, ECI seems fine here courtesy of the method name
https://github.com/llvm/llvm-project/pull/185130
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits