[PATCH] Use MCFillFragment for zero-initialized data

Serge Pavlov sepavloff at gmail.com
Thu Jun 27 04:45:49 PDT 2013


  I will add a line to test a non zero address space:

  @a0 = addrspace(1) global [4 x [4 x i32]] zeroinitializer, align 16

  It looks like 'addrspace' is ignored, object files are bitwise identical whatever value is used in addrspace.


================
Comment at: lib/MC/MCObjectStreamer.cpp:379
@@ +378,3 @@
+void MCObjectStreamer::EmitZeros(uint64_t NumBytes, unsigned AddrSpace) {
+  assert(AddrSpace == 0 && "Address space must be 0!");
+  unsigned ItemSize = getCurrentSection().first->isVirtualSection() ? 0 : 1;
----------------
Rafael Ávila de Espíndola wrote:
> I don't think you can assert that. Just forward to MCStreamer::EmitZeros if the address space is not zero.
MCStreamer::EmitZeros will eventually call MCObjectStreamer::EmitFill, which contains the same assert. None of classes derived from MCObjectStreamer support emission of values into address spaces other that 0. IIUC this assert marks uninplemented feature, maybe it worth leaving?


http://llvm-reviews.chandlerc.com/D1043



More information about the llvm-commits mailing list