During codegen assert that any copy assignment, destructor or constructor that

we need to synthesize has been marked as used by Sema.

Change Sema to avoid these asserts.

llvm-svn: 97589
This commit is contained in:
Rafael Espindola
2010-03-02 21:28:26 +00:00
parent f61e34d120
commit 70e040d552
5 changed files with 103 additions and 53 deletions

View File

@@ -752,14 +752,20 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(const char *MangledName,
// A called constructor which has no definition or declaration need be
// synthesized.
else if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(FD)) {
if (CD->isImplicit())
if (CD->isImplicit()) {
assert (CD->isUsed());
DeferredDeclsToEmit.push_back(D);
}
} else if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(FD)) {
if (DD->isImplicit())
if (DD->isImplicit()) {
assert (DD->isUsed());
DeferredDeclsToEmit.push_back(D);
}
} else if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
if (MD->isCopyAssignment() && MD->isImplicit())
if (MD->isCopyAssignment() && MD->isImplicit()) {
assert (MD->isUsed());
DeferredDeclsToEmit.push_back(D);
}
}
}