diff options
Diffstat (limited to 'lib/Transforms/IPO/PruneEH.cpp')
-rw-r--r-- | lib/Transforms/IPO/PruneEH.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index 69bb1f67c7..529f98e504 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -122,17 +122,15 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) { // If the SCC doesn't unwind or doesn't throw, note this fact. if (!SCCMightUnwind || !SCCMightReturn) for (unsigned i = 0, e = SCC.size(); i != e; ++i) { - const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs(); - uint16_t RAttributes = PAL ? PAL->getParamAttrs(0) : 0; + uint16_t NewAttributes = ParamAttr::None; if (!SCCMightUnwind) - RAttributes |= ParamAttr::NoUnwind; + NewAttributes |= ParamAttr::NoUnwind; if (!SCCMightReturn) - RAttributes |= ParamAttr::NoReturn; + NewAttributes |= ParamAttr::NoReturn; - ParamAttrsVector modVec; - modVec.push_back(ParamAttrsWithIndex::get(0, RAttributes)); - PAL = ParamAttrsList::getModified(PAL, modVec); + const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs(); + PAL = ParamAttrsList::includeAttrs(PAL, 0, NewAttributes); SCC[i]->getFunction()->setParamAttrs(PAL); } |