[cfe-commits] r114916 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/DeclCXX.cpp lib/CodeGen/CGExprCXX.cpp lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaOverload.cpp lib/Serialization/ASTReaderDecl.cpp lib/Serialization/ASTWriterDecl.cpp
Douglas Gregor
dgregor at apple.com
Mon Sep 27 15:37:28 PDT 2010
Author: dgregor
Date: Mon Sep 27 17:37:28 2010
New Revision: 114916
URL: http://llvm.org/viewvc/llvm-project?rev=114916&view=rev
Log:
Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/lib/AST/DeclCXX.cpp
cfe/trunk/lib/CodeGen/CGExprCXX.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Mon Sep 27 17:37:28 2010
@@ -1102,7 +1102,6 @@
bool HasWrittenPrototype : 1;
bool IsDeleted : 1;
bool IsTrivial : 1; // sunk from CXXMethodDecl
- bool IsCopyAssignment : 1; // sunk from CXXMethodDecl
bool HasImplicitReturnZero : 1;
/// \brief End part of this FunctionDecl's source range.
@@ -1182,7 +1181,6 @@
SClass(S), SClassAsWritten(SCAsWritten), IsInline(isInline),
IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false),
HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false),
- IsCopyAssignment(false),
HasImplicitReturnZero(false),
EndRangeLoc(NameInfo.getEndLoc()),
TemplateOrSpecialization(),
@@ -1291,9 +1289,6 @@
bool isTrivial() const { return IsTrivial; }
void setTrivial(bool IT) { IsTrivial = IT; }
- bool isCopyAssignment() const { return IsCopyAssignment; }
- void setCopyAssignment(bool CA) { IsCopyAssignment = CA; }
-
/// Whether falling off this function implicitly returns null/zero.
/// If a more specific implicit return value is required, front-ends
/// should synthesize the appropriate return statements.
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Mon Sep 27 17:37:28 2010
@@ -284,10 +284,8 @@
// If this is the implicit copy constructor, note that we have now
// declared it.
// FIXME: Move constructors
- if (Method->getOverloadedOperator() == OO_Equal) {
+ if (Method->getOverloadedOperator() == OO_Equal)
data().DeclaredCopyAssignment = true;
- Method->setCopyAssignment(true);
- }
}
// Nothing else to do for implicitly-declared members.
@@ -359,8 +357,7 @@
return;
// This is a copy assignment operator.
- // Note on the decl that it is a copy assignment operator.
- Method->setCopyAssignment(true);
+ // FIXME: Move assignment operators.
// Suppress the implicit declaration of a copy constructor.
data().UserDeclaredCopyAssignment = true;
Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Mon Sep 27 17:37:28 2010
@@ -114,7 +114,7 @@
if (MD->isTrivial()) {
if (isa<CXXDestructorDecl>(MD)) return RValue::get(0);
- assert(MD->isCopyAssignment() && "unknown trivial member function");
+ assert(MD->isCopyAssignmentOperator() && "unknown trivial member function");
// We don't like to generate the trivial copy assignment operator when
// it isn't necessary; just produce the proper effect here.
llvm::Value *RHS = EmitLValue(*CE->arg_begin()).getAddress();
@@ -211,7 +211,7 @@
ReturnValueSlot ReturnValue) {
assert(MD->isInstance() &&
"Trying to emit a member call expr on a static method!");
- if (MD->isCopyAssignment()) {
+ if (MD->isCopyAssignmentOperator()) {
const CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(MD->getDeclContext());
if (ClassDecl->hasTrivialCopyAssignment()) {
assert(!ClassDecl->hasUserDeclaredCopyAssignment() &&
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Sep 27 17:37:28 2010
@@ -867,7 +867,7 @@
DeferredDeclsToEmit.push_back(D);
}
} else if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
- if (MD->isCopyAssignment() && MD->isImplicit()) {
+ if (MD->isImplicit() && MD->isCopyAssignmentOperator()) {
assert(MD->isUsed() && "Sema doesn't consider CopyAssignment as used.");
DeferredDeclsToEmit.push_back(D);
}
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Sep 27 17:37:28 2010
@@ -1063,7 +1063,8 @@
if (isa<CXXDestructorDecl>(MD))
return Sema::CXXDestructor;
- assert(MD->isCopyAssignment() && "Must have copy assignment operator");
+ assert(MD->isCopyAssignmentOperator() &&
+ "Must have copy assignment operator");
return Sema::CXXCopyAssignment;
}
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Sep 27 17:37:28 2010
@@ -4930,7 +4930,6 @@
CopyAssignment->setAccess(AS_public);
CopyAssignment->setImplicit();
CopyAssignment->setTrivial(ClassDecl->hasTrivialCopyAssignment());
- CopyAssignment->setCopyAssignment(true);
// Add the parameter to the operator.
ParmVarDecl *FromParam = ParmVarDecl::Create(Context, CopyAssignment,
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Mon Sep 27 17:37:28 2010
@@ -5525,7 +5525,7 @@
if (!Meth->isImplicit())
return isTemplate ? oc_method_template : oc_method;
- assert(Meth->isCopyAssignment()
+ assert(Meth->isCopyAssignmentOperator()
&& "implicit method is not copy assignment operator?");
return oc_implicit_copy_assignment;
}
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Mon Sep 27 17:37:28 2010
@@ -346,7 +346,6 @@
FD->setHasWrittenPrototype(Record[Idx++]);
FD->setDeleted(Record[Idx++]);
FD->setTrivial(Record[Idx++]);
- FD->setCopyAssignment(Record[Idx++]);
FD->setHasImplicitReturnZero(Record[Idx++]);
FD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=114916&r1=114915&r2=114916&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Mon Sep 27 17:37:28 2010
@@ -296,7 +296,6 @@
Record.push_back(D->hasWrittenPrototype());
Record.push_back(D->isDeleted());
Record.push_back(D->isTrivial());
- Record.push_back(D->isCopyAssignment());
Record.push_back(D->hasImplicitReturnZero());
Writer.AddSourceLocation(D->getLocEnd(), Record);
More information about the cfe-commits
mailing list