#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CallGraph.h"
-#include "llvm/CallGraphSCCPass.h"
+#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
NewAttributes.addAttribute(Attribute::NoReturn);
Function *F = (*I)->getFunction();
- const AttributeSet &PAL = F->getAttributes();
- const AttributeSet &NPAL = PAL.addAttr(F->getContext(), ~0,
- Attribute::get(F->getContext(),
- NewAttributes));
+ const AttributeSet &PAL = F->getAttributes().getFnAttributes();
+ const AttributeSet &NPAL = AttributeSet::get(
+ F->getContext(), AttributeSet::FunctionIndex, NewAttributes);
+
if (PAL != NPAL) {
MadeChange = true;
- F->setAttributes(NPAL);
+ F->addAttributes(AttributeSet::FunctionIndex, NPAL);
}
}