diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2010-08-06 16:37:05 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2010-08-06 16:37:05 +0000 |
commit | 165301d38d8bdd80b5b1a2287f41ae06ebbb3ea5 (patch) | |
tree | 117781800d54a27e7a5fdd2a751abcc0be2fd79c /clang/lib/CodeGen/CGExprScalar.cpp | |
parent | f95e3580041a0ef151f6262d7a7d92fb0a4346d5 (diff) | |
download | bcm5719-llvm-165301d38d8bdd80b5b1a2287f41ae06ebbb3ea5.tar.gz bcm5719-llvm-165301d38d8bdd80b5b1a2287f41ae06ebbb3ea5.zip |
Initialize variable to work around warning; unfortunately, there isn't any
way to tell gcc "really, values outside the enum aren't valid".
llvm-svn: 110450
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 3939ec7d306..ae073da672a 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1278,7 +1278,7 @@ Value *ScalarExprEmitter::VisitOffsetOfExpr(OffsetOfExpr *E) { QualType CurrentType = E->getTypeSourceInfo()->getType(); for (unsigned i = 0; i != n; ++i) { OffsetOfExpr::OffsetOfNode ON = E->getComponent(i); - llvm::Value *Offset; + llvm::Value *Offset = 0; switch (ON.getKind()) { case OffsetOfExpr::OffsetOfNode::Array: { // Compute the index @@ -1325,10 +1325,10 @@ Value *ScalarExprEmitter::VisitOffsetOfExpr(OffsetOfExpr *E) { CurrentType = MemberDecl->getType(); break; } - + case OffsetOfExpr::OffsetOfNode::Identifier: llvm_unreachable("dependent __builtin_offsetof"); - + case OffsetOfExpr::OffsetOfNode::Base: { if (ON.getBase()->isVirtual()) { CGF.ErrorUnsupported(E, "virtual base in offsetof"); |