[PATCH] D16820: Implement common symbol size calculation in llvm-size

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 13:56:09 PST 2016


rafael added inline comments.

================
Comment at: test/tools/llvm-size/X86/test-common.s:17
@@ +16,3 @@
+	movl	$1, x
+	movl	$1, y
+	movl	$1, z
----------------
Do you actually need all this? To test just the common size I don't see you need any asm instruction.

================
Comment at: tools/llvm-size/llvm-size.cpp:62
@@ +61,3 @@
+                         cl::desc("Print common symbols in the ELF file. \
+When using Berkely format, this is added to bss."),
+                         cl::init(false));
----------------
git-clang-format

================
Comment at: tools/llvm-size/llvm-size.cpp:137
@@ +136,3 @@
+static uint64_t getCommonSize(ObjectFile *Obj) {
+  uint64_t total_commons = 0;
+  for (auto &Sym : Obj->symbols())
----------------
TotalCommons

================
Comment at: tools/llvm-size/llvm-size.cpp:370
@@ +369,3 @@
+    if (ELFCommons) {
+      uint64_t common_size = getCommonSize(Obj);
+      total += common_size;
----------------
CommonSize


Repository:
  rL LLVM

http://reviews.llvm.org/D16820





More information about the llvm-commits mailing list