[PATCH] D30326: [MS-ABI] Allow #pragma section to choose for ZI data

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 05:08:39 PST 2017


rogfer01 added inline comments.


================
Comment at: lib/Driver/Tools.cpp:5940
+                   options::OPT_fno_always_use_bss, false))
+    CmdArgs.push_back("-always-use-bss");
+
----------------
I think you mean `"-falways-use-bss"`.

Please add a test that checks that the driver is forwarding to CC1 the right flag. You only have a CC1 test that cannot catch this bug.


================
Comment at: lib/Sema/SemaDecl.cpp:10742-10743
+  Expr* InitExpr = var->getInit();
+  if (!InitExpr)
+    return var->hasGlobalStorage();
+
----------------
This check wasn't in the original code. Can you explain why it is needed here?

If it is needed, maybe you want a test for this as well.


================
Comment at: test/CodeGenCXX/zi-sections.cpp:39
+int ArrayMinusTwo[] = {0, -2, 0};
+int ArrayUnInit;
+// CHECK-ZI-DATA: @ShortZero = global i16 0, section ".data.1", align 2
----------------
Would it make sense a test that checks array fillers?

```
int ArrayWithFiller[10] = { 0 };
int ArrayWithFillerTwo[10] = { 0, 2 };
int ArrayWithAllFiller[10] = { };
```


https://reviews.llvm.org/D30326





More information about the cfe-commits mailing list