[PATCH] D73674: Propeller: LLVM support for basic block sections (Base Patch - Part 2)

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 11:19:46 PST 2020


tmsriram added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:786
+
+  if (!TM.getUniqueSectionNames()) {
+    Name += ".";
----------------
davidxl wrote:
> Is the logic reversed? Can you add a comment in the source?
It is not reversed.  With unique section names, the section for function main would be named .text.main.cold and will be unique across this module as main is a unique name.  Without unique section names, this would be named just .text.cold and all cold sections in this module would be grouped in one section.  

So, the function name must be appended to section only if -funique-section-names is off. I have refactored this code and combined two functions into one.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:807
+    const TargetMachine &TM) const {
+  SmallString<128> Name;
+  Name = (static_cast<MCSectionELF *>(MBB.getParent()->getSection()))
----------------
davidxl wrote:
> Why there is no getUniqueSectioNames check here as in other cases?
Good catch, fixed.


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

https://reviews.llvm.org/D73674





More information about the llvm-commits mailing list