[JITLink] Store Sections in a DenseMap with the section name as key.
This speeds up section lookup by name. This change was motivated by poor performance of a testcase while trying to fix the NoAlloc lifetime patch that was originally landed as 2cc64df0. The NoAlloc lifetime patch causes ELF non-SHF_ALLOC sections to be given a JITLink Section (previously they were skipped), and the llvm/test/ExecutionEngine/JITLink/X86/ELF_shndex.s testcase creates > 64k non-SHF_ALLOC sections, each of which now needs to be checked to ensure that its name does not clash. Moving to a DenseMap allows us to implement this check efficiently.
Loading
Please sign in to comment