summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-06-03 15:36:07 +0000
committerAnders Carlsson <andersca@mac.com>2010-06-03 15:36:07 +0000
commitbcb2e4cb63d30c3ea4997cbec957cc9865ac6432 (patch)
tree0a1d1aa5429c7c4a5a3bb94571b63a4654568e58 /clang/lib/CodeGen/CGExprConstant.cpp
parent7cd082a7a3dc798043a0abfbfb5a9b4eeb57e477 (diff)
downloadbcm5719-llvm-bcb2e4cb63d30c3ea4997cbec957cc9865ac6432.tar.gz
bcm5719-llvm-bcb2e4cb63d30c3ea4997cbec957cc9865ac6432.zip
Don't try to explicitly zero out bit-fields.
llvm-svn: 105391
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 21a2a605a43..a145a66b59b 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -1117,6 +1117,11 @@ llvm::Constant *CodeGenModule::EmitNullConstant(QualType T) {
for (RecordDecl::field_iterator I = RD->field_begin(),
E = RD->field_end(); I != E; ++I) {
const FieldDecl *FD = *I;
+
+ // Ignore bit fields.
+ if (FD->isBitField())
+ continue;
+
unsigned FieldNo = Layout.getLLVMFieldNo(FD);
Elements[FieldNo] = EmitNullConstant(FD->getType());
}
OpenPOWER on IntegriCloud