[PATCH] D18419: Handle section vs global name conflict.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 14:01:30 PDT 2016


eugenis added inline comments.

================
Comment at: lib/MC/MCContext.cpp:189-190
@@ -198,5 +188,4 @@
     }
     auto NameEntry = UsedNames.insert(std::make_pair(NewName, true));
-    if (NameEntry.second) {
-      // Ok, we found a name. Have the MCSymbol object itself refer to the copy
-      // of the string that is embedded in the UsedNames entry.
+    if (NameEntry.second || !NameEntry.first->second) {
+      // Ok, we found a name.
----------------
pcc wrote:
> You can simplify this to:
> 
> ```
> bool &Used = UsedNames[NewName];
> if (!Used) {
>   Used = true;
> ...
> ```
MCSymbol constructor needs a pointer to StringMapEntry.


Repository:
  rL LLVM

http://reviews.llvm.org/D18419





More information about the llvm-commits mailing list