mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
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
This commit is contained in:
parent
c1610fa3c4
commit
20f47ab768
@ -54,13 +54,29 @@ static cl::opt<bool> UnknownLocations("use-unknown-locations", cl::Hidden,
|
|||||||
cl::desc("Make an absence of debug location information explicit."),
|
cl::desc("Make an absence of debug location information explicit."),
|
||||||
cl::init(false));
|
cl::init(false));
|
||||||
|
|
||||||
static cl::opt<bool> DwarfAccelTables("dwarf-accel-tables", cl::Hidden,
|
namespace {
|
||||||
cl::desc("Output prototype dwarf accelerator tables."),
|
enum DefaultOnOff {
|
||||||
cl::init(false));
|
Default, Enable, Disable
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static cl::opt<bool> DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
|
static cl::opt<DefaultOnOff> DwarfAccelTables("dwarf-accel-tables", cl::Hidden,
|
||||||
|
cl::desc("Output prototype dwarf accelerator tables."),
|
||||||
|
cl::values(
|
||||||
|
clEnumVal(Default, "Default for platform"),
|
||||||
|
clEnumVal(Enable, "Enabled"),
|
||||||
|
clEnumVal(Disable, "Disabled"),
|
||||||
|
clEnumValEnd),
|
||||||
|
cl::init(Default));
|
||||||
|
|
||||||
|
static cl::opt<DefaultOnOff> DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
|
||||||
cl::desc("Compatibility with Darwin gdb."),
|
cl::desc("Compatibility with Darwin gdb."),
|
||||||
cl::init(false));
|
cl::values(
|
||||||
|
clEnumVal(Default, "Default for platform"),
|
||||||
|
clEnumVal(Enable, "Enabled"),
|
||||||
|
clEnumVal(Disable, "Disabled"),
|
||||||
|
clEnumValEnd),
|
||||||
|
cl::init(Default));
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const char *DWARFGroupName = "DWARF Emission";
|
const char *DWARFGroupName = "DWARF Emission";
|
||||||
@ -141,13 +157,23 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
|
|||||||
|
|
||||||
// Turn on accelerator tables and older gdb compatibility
|
// Turn on accelerator tables and older gdb compatibility
|
||||||
// for Darwin.
|
// for Darwin.
|
||||||
if (Triple(M->getTargetTriple()).isOSDarwin()) {
|
bool isDarwin = Triple(M->getTargetTriple()).isOSDarwin();
|
||||||
DwarfAccelTables = true;
|
if (DarwinGDBCompat == Default) {
|
||||||
DarwinGDBCompat = true;
|
if (isDarwin)
|
||||||
}
|
isDarwinGDBCompat = true;
|
||||||
|
else
|
||||||
|
isDarwinGDBCompat = false;
|
||||||
|
} else
|
||||||
|
isDarwinGDBCompat = DarwinGDBCompat == Enable ? true : false;
|
||||||
|
|
||||||
|
if (DwarfAccelTables == Default) {
|
||||||
|
if (isDarwin)
|
||||||
|
hasDwarfAccelTables = true;
|
||||||
|
else
|
||||||
|
hasDwarfAccelTables = false;
|
||||||
|
} else
|
||||||
|
hasDwarfAccelTables = DwarfAccelTables == Enable ? true : false;
|
||||||
|
|
||||||
isDarwinGDBCompat = DarwinGDBCompat;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
|
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
|
||||||
beginModule(M);
|
beginModule(M);
|
||||||
@ -826,7 +852,7 @@ void DwarfDebug::endModule() {
|
|||||||
emitAbbreviations();
|
emitAbbreviations();
|
||||||
|
|
||||||
// Emit info into the dwarf accelerator table sections.
|
// Emit info into the dwarf accelerator table sections.
|
||||||
if (DwarfAccelTables) {
|
if (useDwarfAccelTables()) {
|
||||||
emitAccelNames();
|
emitAccelNames();
|
||||||
emitAccelObjC();
|
emitAccelObjC();
|
||||||
emitAccelNamespaces();
|
emitAccelNamespaces();
|
||||||
@ -836,7 +862,7 @@ void DwarfDebug::endModule() {
|
|||||||
// Emit info into a debug pubtypes section.
|
// Emit info into a debug pubtypes section.
|
||||||
// TODO: When we don't need the option anymore we can
|
// TODO: When we don't need the option anymore we can
|
||||||
// remove all of the code that adds to the table.
|
// remove all of the code that adds to the table.
|
||||||
if (DarwinGDBCompat)
|
if (useDarwinGDBCompat())
|
||||||
emitDebugPubTypes();
|
emitDebugPubTypes();
|
||||||
|
|
||||||
// Emit info into a debug loc section.
|
// Emit info into a debug loc section.
|
||||||
@ -855,7 +881,7 @@ void DwarfDebug::endModule() {
|
|||||||
// TODO: When we don't need the option anymore we
|
// TODO: When we don't need the option anymore we
|
||||||
// can remove all of the code that this section
|
// can remove all of the code that this section
|
||||||
// depends upon.
|
// depends upon.
|
||||||
if (DarwinGDBCompat)
|
if (useDarwinGDBCompat())
|
||||||
emitDebugInlineInfo();
|
emitDebugInlineInfo();
|
||||||
|
|
||||||
// Emit info into a debug str section.
|
// Emit info into a debug str section.
|
||||||
|
@ -309,7 +309,7 @@ class DwarfDebug {
|
|||||||
|
|
||||||
// A holder for the DarwinGDBCompat flag so that the compile unit can use it.
|
// A holder for the DarwinGDBCompat flag so that the compile unit can use it.
|
||||||
bool isDarwinGDBCompat;
|
bool isDarwinGDBCompat;
|
||||||
|
bool hasDwarfAccelTables;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// assignAbbrevNumber - Define a unique number for the abbreviation.
|
/// assignAbbrevNumber - Define a unique number for the abbreviation.
|
||||||
@ -527,6 +527,7 @@ public:
|
|||||||
/// useDarwinGDBCompat - returns whether or not to limit some of our debug
|
/// useDarwinGDBCompat - returns whether or not to limit some of our debug
|
||||||
/// output to the limitations of darwin gdb.
|
/// output to the limitations of darwin gdb.
|
||||||
bool useDarwinGDBCompat() { return isDarwinGDBCompat; }
|
bool useDarwinGDBCompat() { return isDarwinGDBCompat; }
|
||||||
|
bool useDwarfAccelTables() { return hasDwarfAccelTables; }
|
||||||
};
|
};
|
||||||
} // End of namespace llvm
|
} // End of namespace llvm
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc -O0 -asm-verbose -darwin-gdb-compat -mtriple=x86_64-macosx < %s | FileCheck %s
|
; RUN: llc -O0 -asm-verbose -mtriple=x86_64-macosx < %s | FileCheck %s
|
||||||
; CHECK-NOT: .asciz "X" ## External Name
|
; CHECK-NOT: .asciz "X" ## External Name
|
||||||
; CHECK: .asciz "Y" ## External Name
|
; CHECK: .asciz "Y" ## External Name
|
||||||
; Test to check type with no definition is listed in pubtypes section.
|
; Test to check type with no definition is listed in pubtypes section.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user