summaryrefslogtreecommitdiffstats
path: root/clang/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
commitae819500a16af284fe03e2951be714f6b89ad56f (patch)
tree9e43c925174dda55e8c49e70d4deac8dccad82a5 /clang/lib/CodeGen/CodeGenModule.cpp
parent7ae3c75d97e46c56b7b40290381e0e4ef0c9125f (diff)
downloadbcm5719-llvm-ae819500a16af284fe03e2951be714f6b89ad56f.tar.gz
bcm5719-llvm-ae819500a16af284fe03e2951be714f6b89ad56f.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index c30fe22a674..418b1449d33 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<RecordType>())
return ConstantInit &&
- cast<CXXRecordDecl>(Record->getDecl())->isPOD() &&
!cast<CXXRecordDecl>(Record->getDecl())->hasMutableFields();
}
OpenPOWER on IntegriCloud