summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-03-02 21:28:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-03-02 21:28:26 +0000
commit70e040d5527f29eade48b718d01c540082a49be0 (patch)
tree770bcaa99de31aa04fd53dc4359fa6c0a2928961 /clang/lib/CodeGen/CodeGenModule.cpp
parentf61e34d120621d02b3095d68edcfb7520aae9ac4 (diff)
downloadbcm5719-llvm-70e040d5527f29eade48b718d01c540082a49be0.tar.gz
bcm5719-llvm-70e040d5527f29eade48b718d01c540082a49be0.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 52366190881..91c7322c676 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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);
+ }
}
}
OpenPOWER on IntegriCloud