llvm.org GIT mirror llvm / 20f47ab
Turn these two options in to trinary state so that they can be turned on and off separate from the platform if you're on darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162487 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
3 changed file(s) with 44 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
5353 cl::desc("Make an absence of debug location information explicit."),
5454 cl::init(false));
5555
56 static cl::opt DwarfAccelTables("dwarf-accel-tables", cl::Hidden,
56 namespace {
57 enum DefaultOnOff {
58 Default, Enable, Disable
59 };
60 }
61
62 static cl::opt DwarfAccelTables("dwarf-accel-tables", cl::Hidden,
5763 cl::desc("Output prototype dwarf accelerator tables."),
58 cl::init(false));
59
60 static cl::opt DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
64 cl::values(
65 clEnumVal(Default, "Default for platform"),
66 clEnumVal(Enable, "Enabled"),
67 clEnumVal(Disable, "Disabled"),
68 clEnumValEnd),
69 cl::init(Default));
70
71 static cl::opt DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
6172 cl::desc("Compatibility with Darwin gdb."),
62 cl::init(false));
73 cl::values(
74 clEnumVal(Default, "Default for platform"),
75 clEnumVal(Enable, "Enabled"),
76 clEnumVal(Disable, "Disabled"),
77 clEnumValEnd),
78 cl::init(Default));
6379
6480 namespace {
6581 const char *DWARFGroupName = "DWARF Emission";
140156
141157 // Turn on accelerator tables and older gdb compatibility
142158 // for Darwin.
143 if (Triple(M->getTargetTriple()).isOSDarwin()) {
144 DwarfAccelTables = true;
145 DarwinGDBCompat = true;
146 }
147
148 isDarwinGDBCompat = DarwinGDBCompat;
149
159 bool isDarwin = Triple(M->getTargetTriple()).isOSDarwin();
160 if (DarwinGDBCompat == Default) {
161 if (isDarwin)
162 isDarwinGDBCompat = true;
163 else
164 isDarwinGDBCompat = false;
165 } else
166 isDarwinGDBCompat = DarwinGDBCompat == Enable ? true : false;
167
168 if (DwarfAccelTables == Default) {
169 if (isDarwin)
170 hasDwarfAccelTables = true;
171 else
172 hasDwarfAccelTables = false;
173 } else
174 hasDwarfAccelTables = DwarfAccelTables == Enable ? true : false;
175
150176 {
151177 NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
152178 beginModule(M);
825851 emitAbbreviations();
826852
827853 // Emit info into the dwarf accelerator table sections.
828 if (DwarfAccelTables) {
854 if (useDwarfAccelTables()) {
829855 emitAccelNames();
830856 emitAccelObjC();
831857 emitAccelNamespaces();
835861 // Emit info into a debug pubtypes section.
836862 // TODO: When we don't need the option anymore we can
837863 // remove all of the code that adds to the table.
838 if (DarwinGDBCompat)
864 if (useDarwinGDBCompat())
839865 emitDebugPubTypes();
840866
841867 // Emit info into a debug loc section.
854880 // TODO: When we don't need the option anymore we
855881 // can remove all of the code that this section
856882 // depends upon.
857 if (DarwinGDBCompat)
883 if (useDarwinGDBCompat())
858884 emitDebugInlineInfo();
859885
860886 // Emit info into a debug str section.
308308
309309 // A holder for the DarwinGDBCompat flag so that the compile unit can use it.
310310 bool isDarwinGDBCompat;
311
311 bool hasDwarfAccelTables;
312312 private:
313313
314314 /// assignAbbrevNumber - Define a unique number for the abbreviation.
526526 /// useDarwinGDBCompat - returns whether or not to limit some of our debug
527527 /// output to the limitations of darwin gdb.
528528 bool useDarwinGDBCompat() { return isDarwinGDBCompat; }
529 bool useDwarfAccelTables() { return hasDwarfAccelTables; }
529530 };
530531 } // End of namespace llvm
531532
None ; RUN: llc -O0 -asm-verbose -darwin-gdb-compat -mtriple=x86_64-macosx < %s | FileCheck %s
0 ; RUN: llc -O0 -asm-verbose -mtriple=x86_64-macosx < %s | FileCheck %s
11 ; CHECK-NOT: .asciz "X" ## External Name
22 ; CHECK: .asciz "Y" ## External Name
33 ; Test to check type with no definition is listed in pubtypes section.