diff options
| author | Reid Kleckner <rnk@google.com> | 2017-04-24 20:38:30 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-04-24 20:38:30 +0000 |
| commit | b4a2d18777f9fe5110b572bb25d0d6187be6f0d9 (patch) | |
| tree | c59579769e264eefaf44c5d91dbf3f1b1d1e42d6 /llvm/lib/IR | |
| parent | b2c390e9f5f71ab8f023a5b428334faac0a07741 (diff) | |
| download | bcm5719-llvm-b4a2d18777f9fe5110b572bb25d0d6187be6f0d9.tar.gz bcm5719-llvm-b4a2d18777f9fe5110b572bb25d0d6187be6f0d9.zip | |
[Bitcode] Refactor attribute group writing to avoid getSlotAttributes
Summary:
That API creates a temporary AttributeList to carry an index and a
single AttributeSet. We need to carry the index in addition to the set,
because that is how attribute groups are currently encoded.
NFC
Reviewers: pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32262
llvm-svn: 301245
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/Attributes.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index d690111ef21..f6deba6c04b 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -1257,6 +1257,12 @@ AttributeList AttributeList::getSlotAttributes(unsigned Slot) const { return pImpl->getSlotAttributes(Slot); } +AttributeSet AttributeList::getSlotSet(unsigned Slot) const { + assert(pImpl && Slot < pImpl->getNumSlots() && + "Slot # out of range!"); + return pImpl->getSlotNode(Slot); +} + #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void AttributeList::dump() const { dbgs() << "PAL[\n"; |

