[PATCH] D69633: [XCOFF][AIX] Differentiate usage of label symbol and csect symbol

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 08:19:21 PST 2019


DiggerLin added inline comments.
Herald added a subscriber: wuzish.


================
Comment at: llvm/include/llvm/MC/MCSectionXCOFF.h:46
       : MCSection(SV_XCOFF, K, Begin), Name(Section), MappingClass(SMC),
-        Type(ST), StorageClass(SC) {
+        Type(ST), StorageClass(SC), QualName(QualName) {
     assert((ST == XCOFF::XTY_SD || ST == XCOFF::XTY_CM) &&
----------------
I think the name of the QualName is always same as Section Name,  I am prefer to create  the QualName inside the construct of the  MCSectionXCOFF.

otherwise we have to write a code which created a Qualname first. and then call the new MCSectionXCOFF(......) very time.


================
Comment at: llvm/lib/MC/MCContext.cpp:562
+  MCSectionXCOFF *Result = new (XCOFFAllocator.Allocate()) MCSectionXCOFF(
+      CachedName, SMC, Type, SC, Kind, cast<MCSymbolXCOFF>(QualName), Begin);
   Entry.second = Result;
----------------
the name of section is same as Qualname, if the  the Qualname is created in the MCSectionXCOFF , we do not need the code MCSymbol *QualName = getOrCreateSymbol(
      CachedName + "[" + XCOFF::getMappingClassString(SMC) + "]");

here.


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

https://reviews.llvm.org/D69633





More information about the llvm-commits mailing list