//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
+#include "llvm/ParameterAttributes.h"
#include <set>
#include <algorithm>
using namespace llvm;
// 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;
+ ParameterAttributes 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);
}