#ifndef LLVM_FUNCTION_H
#define LLVM_FUNCTION_H
-#include "llvm/GlobalValue.h"
-#include "llvm/CallingConv.h"
-#include "llvm/BasicBlock.h"
#include "llvm/Argument.h"
#include "llvm/Attributes.h"
+#include "llvm/BasicBlock.h"
+#include "llvm/CallingConv.h"
+#include "llvm/GlobalValue.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
///
void addFnAttr(Attributes::AttrVal N) {
// Function Attributes are stored at ~0 index
- AttrBuilder B;
- B.addAttribute(N);
- addAttribute(~0U, Attributes::get(getContext(), B));
+ addAttribute(AttrListPtr::FunctionIndex, Attributes::get(getContext(), N));
}
/// removeFnAttr - Remove function attributes from this function.
return getParamAttributes(n).hasAttribute(Attributes::NoAlias);
}
void setDoesNotAlias(unsigned n) {
- AttrBuilder B;
- B.addAttribute(Attributes::NoAlias);
- addAttribute(n, Attributes::get(getContext(), B));
+ addAttribute(n, Attributes::get(getContext(), Attributes::NoAlias));
}
/// @brief Determine if the parameter can be captured.
return getParamAttributes(n).hasAttribute(Attributes::NoCapture);
}
void setDoesNotCapture(unsigned n) {
- AttrBuilder B;
- B.addAttribute(Attributes::NoCapture);
- addAttribute(n, Attributes::get(getContext(), B));
+ addAttribute(n, Attributes::get(getContext(), Attributes::NoCapture));
}
/// copyAttributesFrom - copy all additional attributes (those not needed to