[PATCH] D77080: [NFC][XCOFF][AIX] Refactor get/setContainingCsect

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 17:59:13 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:5146
               SectionKind::getMetadata());
-          S->setContainingCsect(Sec);
+          S->setCsectMCSectionXCOFF(Sec);
         }
----------------
daltenty wrote:
> It feels like this breaks the constraint you had listed under 2, since the symbol S is not actually the symbol representing the csect (i.e. the qualname symbol). Would we be able to wrap this whole business in a call to an new TLOF function like `TargetLoweringObjectFileXCOFF::getSectionForUndefinedFunction(StringRef)` and just use the qualname symbol we get back instead (so we don't need to call `setCsectMCSectionXCOFF()` seperately)? 
> 
> If we can do this we could restrict `setCsectMCSectionXCOFF()` so it can only be called from MCSectionXCOFF's constructor, enforcing the constraint that this only valid for symbols representing csects (and `hasCsectMCSectionXCOFF()` could become `isCsect()` ). 
Since the symbol is undefined. It must represent the csect. I also would prefer if we can have a stronger correspondence between being a QualName symbol and being the representation of a csect, but I am not sure how much that entails.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77080





More information about the llvm-commits mailing list