#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/ParamAttrsList.h"
#include <set>
#include <algorithm>
using namespace llvm;
STATISTIC(NumRemoved, "Number of invokes removed");
STATISTIC(NumUnreach, "Number of noreturn calls optimized");
-STATISTIC(NumBBUnwind, "Number of unwind_to removed from blocks");
+STATISTIC(NumBBUnwind, "Number of unwind dest removed from blocks");
namespace {
struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass {
if (!SCCMightReturn)
NewAttributes |= ParamAttr::NoReturn;
- const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs();
- PAL = ParamAttrsList::includeAttrs(PAL, 0, NewAttributes);
- SCC[i]->getFunction()->setParamAttrs(PAL);
+ const PAListPtr &PAL = SCC[i]->getFunction()->getParamAttrs();
+ SCC[i]->getFunction()->setParamAttrs(PAL.addAttr(0, NewAttributes));
}
for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
MadeChange = true;
++NumUnreach;
break;
- } else if (!CI->doesNotThrow())
+ } else if (!CI->doesNotThrow()) {
couldUnwind = true;
+ }
}
// Strip 'unwindTo' off of BBs that have no calls/invokes without nounwind.