Skip to content

Commit

Permalink
Add accessor for the LLVMContext.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174824 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
isanbard committed Feb 10, 2013
1 parent 7dcb23a commit 85b3fbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/llvm/IR/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ class AttributeSet {
// AttributeSet Accessors
//===--------------------------------------------------------------------===//

/// \brief Retrieve the LLVM context.
LLVMContext &getContext() const;

/// \brief The attributes for the specified index are returned.
AttributeSet getParamAttributes(unsigned Idx) const;

Expand Down
4 changes: 4 additions & 0 deletions lib/IR/Attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 85b3fbe

Please sign in to comment.