From ae819500a16af284fe03e2951be714f6b89ad56f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 17 Feb 2012 04:54:50 +0000 Subject: When performing IRGen on a global, emit it as a constant if: 1) It has a const-qualified type, and 2) It has no mutable members, and 3) It has no dynamic initialization, and 4) It has trivial destruction. Remove the unnecessary requirement that the type be POD. This allows us to mark all constexpr objects with no mutable members as 'constant'. llvm-svn: 150792 --- clang/lib/CodeGen/CodeGenModule.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c30fe22..418b144 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1110,7 +1110,6 @@ static bool DeclIsConstantGlobal(ASTContext &Context, const VarDecl *D, if (const RecordType *Record = Context.getBaseElementType(D->getType())->getAs()) return ConstantInit && - cast(Record->getDecl())->isPOD() && !cast(Record->getDecl())->hasMutableFields(); } -- cgit v1.1