[PATCH] D69528: [PowerPC][XCOFF] Add assembly support for zero initalized global values.

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 08:54:04 PST 2019


DiggerLin added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1861
+  // as tentative defintions, which is only appropriate for SectionKind::Common.
+  if (Kind.isBSS())
+    return DataSection;
----------------
DiggerLin wrote:
> DiggerLin wrote:
> > how about the Kind.isBSSExternal() ?
> I read the code again, the Kind.isBSS() include the BSSExternal
>  bool isBSS() const { return K == BSS || K == BSSLocal || K == BSSExtern; }
The BSSLocal will be put in the .bss section. 

Here I think it maybe better(more clear) to change to 
if (Kind.isBSS() && !kind.isBSSLocal()) 

keep current code, it is OK, for the code in the line 1842 , it deal with the  Kind.isBSSLocal() first before it go to line 1861.
if (Kind.isBSSLocal() || Kind.isCommon()) { 




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69528





More information about the llvm-commits mailing list