Don't remove filters.

It's not valid to remove filters from landingpad instructions, even if we catch
the type. The metadata won't be set up correctly.

Testcase is projects/llvm-test/SingleSource/UnitTests/EH/filter-2.cpp.

llvm-svn: 140335
This commit is contained in:
Bill Wendling 2011-09-22 20:32:54 +00:00
parent eb4089ad01
commit 8c4b716352
1 changed files with 3 additions and 7 deletions

View File

@ -777,13 +777,9 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
EHFilterScope &filter = cast<EHFilterScope>(*I);
hasFilter = true;
// Add all the filter values which we aren't already explicitly
// catching.
for (unsigned i = 0, e = filter.getNumFilters(); i != e; ++i) {
llvm::Value *filterType = filter.getFilter(i);
if (!catchTypes.count(filterType))
filterTypes.push_back(filterType);
}
// Add all the filter values.
for (unsigned i = 0, e = filter.getNumFilters(); i != e; ++i)
filterTypes.push_back(filter.getFilter(i));
goto done;
}