[PATCH] D96346: [NFC][PPC] Refactor TOC representation to allow several entries for the same symbol

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 11:43:16 PST 2021


sfertile added inline comments.


================
Comment at: llvm/include/llvm/MC/MCExpr.h:421
+// Specialize DenseMapInfo to allow MCSymbolRefExpr::VariantKind in DenseMap
+template <> struct DenseMapInfo<MCSymbolRefExpr::VariantKind> {
+  static inline MCSymbolRefExpr::VariantKind getEmptyKey() {
----------------
I'm not sure why we need this, or even why this works ... IIUC MapVector creates a dense map from the key type to the index of the value. Shouldn't we be creating a `DenseMapInfo` of the key type which is now a `std::pair<const MCSymbol *, MCSymbolRefExpr::VariantKind>`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96346



More information about the llvm-commits mailing list