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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2011-09-22 20:32:54 +00:00
Родитель 690b2dbde0
Коммит 8990daf237
1 изменённых файлов: 3 добавлений и 7 удалений

Просмотреть файл

@ -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;
}