[PATCH] D96346: [NFC][PPC] Refactor TOC representation to allow several entries for the same symbol
Baptiste Saleil via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 10 07:57:38 PST 2021
bsaleil added inline comments.
================
Comment at: llvm/lib/MC/MCExpr.cpp:225
case VK_None: return "<<none>>";
+ case VK_Empty: return "<<empty>>";
----------------
amyk wrote:
> nit: Address the clang format.
>
> Also, sorry, this might be a silly question. What is the difference between `VK_None` and `VK_Empty`?
You can see in `MCExpr.h` that `VK_Empty` is used to represent an empty key in a `DenseMap`. If I understand correctly how `DenseMap` works, when inserting a value, if there is a collision, it looks for a slot with an empty key to put the value. So if we use `VK_None` as the empty key, this prevents us from actually inserting the `VK_None` value in the table, because it may be overwritten by a later insertion.
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