This method gets or creates an index for a debug info attribute.
| 726 | private: |
| 727 | /// This method gets or creates an index for a debug info attribute. |
| 728 | uint64_t getDebugInfoIndex(Attribute attr) { |
| 729 | const void *key = attr.getAsOpaquePointer(); |
| 730 | auto it = diIndexMap.find(key); |
| 731 | if (it != diIndexMap.end()) |
| 732 | return it->second; |
| 733 | |
| 734 | // Check if the debug info attribute has a reserved index and return it. |
| 735 | auto reserved = getDebugReserved(attr); |
| 736 | if (reserved != Bytecode::DebugReserved::SIZE) |
| 737 | return static_cast<uint64_t>(reserved); |
| 738 | |
| 739 | // Register any dependent debug info attributes. |
| 740 | registerDebugInfo(attr); |
| 741 | |
| 742 | // Adjust the index to account for reserved indices. |
| 743 | uint64_t diIndex = debuginfoList.size() + |
| 744 | static_cast<uint64_t>(Bytecode::DebugReserved::SIZE); |
| 745 | |
| 746 | diIndexMap[key] = diIndex; |
| 747 | debuginfoList.push_back(attr); |
| 748 | return diIndex; |
| 749 | } |
| 750 | |
| 751 | LogicalResult invalidLocError(Operation *op, Attribute attr) { |
| 752 | return op->emitError() |