From: Bill Wendling Date: Sun, 10 Feb 2013 05:00:40 +0000 (+0000) Subject: Add accessor for the LLVMContext. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=85b3fbecdfe934ac7519a8831c4bd262cba99d12;p=oota-llvm.git Add accessor for the LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174824 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(),