From 85b3fbecdfe934ac7519a8831c4bd262cba99d12 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sun, 10 Feb 2013 05:00:40 +0000 Subject: [PATCH] Add accessor for the LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174824 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Attributes.h | 3 +++ lib/IR/Attributes.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index a5539cc713b..38f4ed983e6 100644 --- a/include/llvm/IR/Attributes.h +++ b/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/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp index 99fafae88e8..04e95ef6b09 100644 --- a/lib/IR/Attributes.cpp +++ b/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(), -- 2.34.1