diff options
author | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-05-03 20:19:28 +0000 |
---|---|---|
committer | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-05-03 20:19:28 +0000 |
commit | d49bd5515b89bedc57c3d1d3be457e4340dbdb1d (patch) | |
tree | 60a74d7c91cac7bdcbf9501a8c5709976cc0d4a9 /lib/CodeGen/CGExprCXX.cpp | |
parent | 2a053a33707eba9e642adedb557b1a6aace103b5 (diff) |
Fix delegating constructors stylistic issues.
Material bugfixes to come this afternoon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index bdaa873f18..eb0e2068db 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/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(), |