diff options
author | Alexis Hunt <alercah@gmail.com> | 2011-05-03 20:19:28 +0000 |
---|---|---|
committer | Alexis Hunt <alercah@gmail.com> | 2011-05-03 20:19:28 +0000 |
commit | 271c36811d2ab7185af753e5af76e1bcadbf5a7a (patch) | |
tree | a8b09f3c5819819732aa2e81b48d8c2ae5d80c57 /clang/lib/CodeGen/CGExprCXX.cpp | |
parent | a74926b518a766ef2d084cf5137b3aee88152f8a (diff) | |
download | bcm5719-llvm-271c36811d2ab7185af753e5af76e1bcadbf5a7a.tar.gz bcm5719-llvm-271c36811d2ab7185af753e5af76e1bcadbf5a7a.zip |
Fix delegating constructors stylistic issues.
Material bugfixes to come this afternoon.
llvm-svn: 130782
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprCXX.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp index bdaa873f183..eb0e2068dbe 100644 --- a/clang/lib/CodeGen/CGExprCXX.cpp +++ b/clang/lib/CodeGen/CGExprCXX.cpp @@ -404,17 +404,25 @@ CodeGenFunction::EmitCXXConstructExpr(const CXXConstructExpr *E, } else { CXXCtorType Type; - CXXConstructExpr::ConstructionKind K = E->getConstructionKind(); - if (K == CXXConstructExpr::CK_Delegating) { + bool ForVirtualBase = false; + + switch (E->getConstructionKind()) { + case CXXConstructExpr::CK_Delegating: // We should be emitting a constructor; GlobalDecl will assert this Type = CurGD.getCtorType(); - } else { - Type = (E->getConstructionKind() == CXXConstructExpr::CK_Complete) - ? Ctor_Complete : Ctor_Base; - } + break; - bool ForVirtualBase = - E->getConstructionKind() == CXXConstructExpr::CK_VirtualBase; + case CXXConstructExpr::CK_Complete: + Type = Ctor_Complete; + break; + + case CXXConstructExpr::CK_VirtualBase: + ForVirtualBase = true; + // fall-through + + case CXXConstructExpr::CK_NonVirtualBase: + Type = Ctor_Base; + } // Call the constructor. EmitCXXConstructorCall(CD, Type, ForVirtualBase, Dest.getAddr(), |