[PATCH] D64462: [ADT] [WIP] Add MutableRange class

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 08:00:53 PDT 2019


MaskRay added a comment.

> This will eventually be used in D64281 <https://reviews.llvm.org/D64281>.

You probably need a data structure to process symbol table/section header table/program header table. To that end, this patch adds an overlay data structure (MutableRange as the name made me puzzled) to make operations more efficient. Have you benchmarked whether the librarified llvm-objcopy will benefit from a fancy data structure like this? I'm thinking plain vectors (as is) may just meet the needs.

If you just want to make interleaved insertion/deletion efficient:

1. add section .a
2. remove section .b
3. add section .c
4. remove section .d
5. add section .e

You can just group them by insertion/deletion: insertion_batch(1,3,5) then deletion_batch(2,4).

If this is going to be promoted to ADT, I think it should be justified by a second use case.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64462/new/

https://reviews.llvm.org/D64462





More information about the llvm-commits mailing list