summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/IR/Attributes.h3
-rw-r--r--llvm/lib/IR/Attributes.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index a5539cc713b..38f4ed983e6 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -286,6 +286,9 @@ public:
// AttributeSet Accessors
//===--------------------------------------------------------------------===//
+ /// \brief Retrieve the LLVM context.
+ LLVMContext &getContext() const;
+
/// \brief The attributes for the specified index are returned.
AttributeSet getParamAttributes(unsigned Idx) const;
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 99fafae88e8..04e95ef6b09 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -709,6 +709,10 @@ AttributeSet AttributeSet::removeAttributes(LLVMContext &C, unsigned Idx,
// AttributeSet Accessor Methods
//===----------------------------------------------------------------------===//
+LLVMContext &AttributeSet::getContext() const {
+ return pImpl->getContext();
+}
+
AttributeSet AttributeSet::getParamAttributes(unsigned Idx) const {
return pImpl && hasAttributes(Idx) ?
AttributeSet::get(pImpl->getContext(),
OpenPOWER on IntegriCloud