DebugInfo: TargetOptions/MCAsmInfo support for compressed debug info sections
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 27 Mar 2014 20:45:41 +0000 (20:45 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 27 Mar 2014 20:45:41 +0000 (20:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204957 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAsmInfo.h
include/llvm/Target/TargetOptions.h
lib/CodeGen/LLVMTargetMachine.cpp

index 0ecffa34bd623ce04e9322aa39203aa356ce5309..724c3d7f38e164c581e9ab44583e4e588e2f5575 100644 (file)
@@ -307,6 +307,9 @@ namespace llvm {
     /// construction (see LLVMTargetMachine::initAsmInfo()).
     bool UseIntegratedAssembler;
 
+    /// Compress DWARF debug sections. Defaults to false.
+    bool CompressDebugSections;
+
   public:
     explicit MCAsmInfo();
     virtual ~MCAsmInfo();
@@ -538,6 +541,12 @@ namespace llvm {
     virtual void setUseIntegratedAssembler(bool Value) {
       UseIntegratedAssembler = Value;
     }
+
+    bool compressDebugSections() const { return CompressDebugSections; }
+
+    void setCompressDebugSections(bool CompressDebugSections) {
+      this->CompressDebugSections = CompressDebugSections;
+    }
   };
 }
 
index f50af6734b11abf374e84b59209eb4ee089c67c6..1f873439c65aca823fdeb66a4fcae0f64a909d26 100644 (file)
@@ -50,8 +50,8 @@ namespace llvm {
           DisableTailCalls(false), StackAlignmentOverride(0),
           EnableFastISel(false), PositionIndependentExecutable(false),
           EnableSegmentedStacks(false), UseInitArray(false),
-          DisableIntegratedAS(false), TrapFuncName(""),
-          FloatABIType(FloatABI::Default),
+          DisableIntegratedAS(false), CompressDebugSections(false),
+          TrapFuncName(""), FloatABIType(FloatABI::Default),
           AllowFPOpFusion(FPOpFusion::Standard) {}
 
     /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
@@ -161,6 +161,9 @@ namespace llvm {
     /// Disable the integrated assembler.
     unsigned DisableIntegratedAS : 1;
 
+    /// Compress DWARF debug sections.
+    unsigned CompressDebugSections : 1;
+
     /// getTrapFunctionName - If this returns a non-empty string, this means
     /// isel should lower Intrinsic::trap to a call to the specified function
     /// name instead of an ISD::TRAP node.
index 77f8377d9be901a35c2e698271b52ae78d767a56..9c2718be7f2868414e520e21238fe188913b5293 100644 (file)
@@ -75,6 +75,9 @@ void LLVMTargetMachine::initAsmInfo() {
   if (Options.DisableIntegratedAS)
     TmpAsmInfo->setUseIntegratedAssembler(false);
 
+  if (Options.CompressDebugSections)
+    TmpAsmInfo->setCompressDebugSections(true);
+
   AsmInfo = TmpAsmInfo;
 }