diff options
author | Lang Hames <lhames@gmail.com> | 2013-02-17 07:22:09 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2013-02-17 07:22:09 +0000 |
commit | bf122744e5baa14f7b88745de02b15d638a5f154 (patch) | |
tree | e4a6bac07ffa8bdbbc896638d3575e506d0df245 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 7a786f8c7ac5250b54648b4063f271ef6c14d90f (diff) | |
download | bcm5719-llvm-bf122744e5baa14f7b88745de02b15d638a5f154.tar.gz bcm5719-llvm-bf122744e5baa14f7b88745de02b15d638a5f154.zip |
Re-apply r174919 - smarter copy/move assignment/construction, with fixes for
bitfield related issues.
The original commit broke Takumi's builder. The bug was caused by bitfield sizes
being determined by their underlying type, rather than the field info. A similar
issue with bitfield alignments showed up on closer testing. Both have been fixed
in this patch.
llvm-svn: 175389
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index cba3316600c..dd8906ed3d0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -560,6 +560,11 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, // The lambda "__invoke" function is special, because it forwards or // clones the body of the function call operator (but is actually static). EmitLambdaStaticInvokeFunction(cast<CXXMethodDecl>(FD)); + } else if (FD->isDefaulted() && isa<CXXMethodDecl>(FD) && + cast<CXXMethodDecl>(FD)->isCopyAssignmentOperator()) { + // Implicit copy-assignment gets the same special treatment as implicit + // copy-constructors. + emitImplicitAssignmentOperatorBody(Args); } else EmitFunctionBody(Args); |