summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-17 04:54:50 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-17 04:54:50 +0000
commite15c71236252c21a77c8a406246053e1cbb63ffa (patch)
treebf61836efdb2a4fe422c044b3a3ce75fbaaf94ee /lib/CodeGen/CodeGenModule.cpp
parentbd64520ca4e4d4c531637d311f8ea384c912fce8 (diff)
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'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index c30fe22a67..418b1449d3 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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<RecordType>())
return ConstantInit &&
- cast<CXXRecordDecl>(Record->getDecl())->isPOD() &&
!cast<CXXRecordDecl>(Record->getDecl())->hasMutableFields();
}