[llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp TargetMachine.cpp

Anton Korobeynikov asl at math.spbu.ru
Wed Jan 17 02:33:27 PST 2007



Changes in directory llvm/lib/Target:

TargetAsmInfo.cpp updated: 1.13 -> 1.14
TargetMachine.cpp updated: 1.58 -> 1.59
---
Log message:

* Fix one more bug in PIC codegen: extra load is needed for *all* 
non-statics.
* Introduce new option to output zero-initialized data to .bss section. 
This can reduce size of binaries. Enable it by default for ELF & 
Cygwin/Mingw targets. Probably, Darwin should be also added.


---
Diffs of the changes:  (+7 -0)

 TargetAsmInfo.cpp |    1 +
 TargetMachine.cpp |    6 ++++++
 2 files changed, 7 insertions(+)


Index: llvm/lib/Target/TargetAsmInfo.cpp
diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.13 llvm/lib/Target/TargetAsmInfo.cpp:1.14
--- llvm/lib/Target/TargetAsmInfo.cpp:1.13	Mon Jan 15 21:42:04 2007
+++ llvm/lib/Target/TargetAsmInfo.cpp	Wed Jan 17 04:33:08 2007
@@ -19,6 +19,7 @@
 TargetAsmInfo::TargetAsmInfo() :
   TextSection(".text"),
   DataSection(".data"),
+  BSSSection(".bss"),
   AddressSize(4),
   NeedsSet(false),
   MaxInstLength(4),


Index: llvm/lib/Target/TargetMachine.cpp
diff -u llvm/lib/Target/TargetMachine.cpp:1.58 llvm/lib/Target/TargetMachine.cpp:1.59
--- llvm/lib/Target/TargetMachine.cpp:1.58	Wed Jan 17 03:06:13 2007
+++ llvm/lib/Target/TargetMachine.cpp	Wed Jan 17 04:33:08 2007
@@ -28,6 +28,7 @@
   bool UnsafeFPMath;
   bool FiniteOnlyFPMathOption;
   bool UseSoftFloat;
+  bool NoZerosInBSS;
   Reloc::Model RelocationModel;
   CodeModel::Model CMModel;
 }
@@ -61,6 +62,11 @@
                cl::desc("Generate software floating point library calls"),
                cl::location(UseSoftFloat),
                cl::init(false));
+  cl::opt<bool, true>
+  DontPlaceZerosInBSS("nozero-initialized-in-bss",
+               cl::desc("Don't place zero-initialized symbols into bss section"),
+               cl::location(NoZerosInBSS),
+               cl::init(false));
 
   cl::opt<llvm::Reloc::Model, true>
   DefRelocationModel(






More information about the llvm-commits mailing list