| 842 | /// This method returns a debug info attribute for a given index. |
| 843 | template <typename T> |
| 844 | T getDebugInfo(uint64_t diIndex) { |
| 845 | // Check if the index is reserved for special debug info attributes. |
| 846 | if (diIndex == static_cast<uint64_t>(Bytecode::DebugReserved::UnknownLoc)) |
| 847 | return dyn_cast<T>(UnknownLoc::get(&context)); |
| 848 | |
| 849 | // Adjust the index to account for reserved indices. |
| 850 | diIndex -= static_cast<uint64_t>(Bytecode::DebugReserved::SIZE); |
| 851 | |
| 852 | if (diIndex >= diCache.size()) |
| 853 | return T(); |
| 854 | if (diCache[diIndex]) |
| 855 | return dyn_cast_or_null<T>(diCache[diIndex]); |
| 856 | |
| 857 | return dyn_cast_or_null<T>(getDebugInfo(diIndex)); |
| 858 | } |
| 859 | |
| 860 | /// This method reads an index and converts it to a debug info attribute. |
| 861 | template <typename T> |
nothing calls this directly
no test coverage detected