summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-10 05:00:40 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-10 05:00:40 +0000
commit5d020a3a31c07baa57b5ee149bd43d2c8fdf277a (patch)
tree62655de5c49b2877fd51e710ba99ddc380424c34
parent67ffb338ee8cb1d9115c00754932b40b036862ba (diff)
downloadbcm5719-llvm-5d020a3a31c07baa57b5ee149bd43d2c8fdf277a.tar.gz
bcm5719-llvm-5d020a3a31c07baa57b5ee149bd43d2c8fdf277a.zip
Add accessor for the LLVMContext.
llvm-svn: 174824
-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