summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-09-04 04:39:38 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-09-04 04:39:38 +0000
commitdc42d031fb5787733d6765d6fefc76d46a7a4c9b (patch)
treebfa4e040c38cf310b741e07ba84741a78408d25e /lib
parent14ce9f1d253472b73689787c28808dd2ade6281d (diff)
downloadllvm-dc42d031fb5787733d6765d6fefc76d46a7a4c9b.tar.gz
llvm-dc42d031fb5787733d6765d6fefc76d46a7a4c9b.tar.bz2
llvm-dc42d031fb5787733d6765d6fefc76d46a7a4c9b.tar.xz
Revert "Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level.""
This reverts commit r189913. Talked with Eric on IRC. I am going to XFAIL the failing test since it is using what Eric described as "the member hack" which was needed on that old GDB. Sorry for the noise! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp26
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp17
2 files changed, 7 insertions, 36 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 7b3842811a..517ace6dfc 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -100,7 +100,7 @@ int64_t CompileUnit::getDefaultLowerBound() const {
/// addFlag - Add a flag that is true.
void CompileUnit::addFlag(DIE *Die, uint16_t Attribute) {
- if (!DD->useDarwinGDBCompat())
+ if (DD->getDwarfVersion() >= 4)
Die->addValue(Attribute, dwarf::DW_FORM_flag_present,
DIEIntegerOne);
else
@@ -1242,17 +1242,6 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
// Add function template parameters.
addTemplateParams(*SPDie, SP.getTemplateParams());
- // Unfortunately this code needs to stay here instead of below the
- // AT_specification code in order to work around a bug in older
- // gdbs that requires the linkage name to resolve multiple template
- // functions.
- // TODO: Remove this set of code when we get rid of the old gdb
- // compatibility.
- StringRef LinkageName = SP.getLinkageName();
- if (!LinkageName.empty() && DD->useDarwinGDBCompat())
- addString(SPDie, dwarf::DW_AT_MIPS_linkage_name,
- GlobalValue::getRealLinkageName(LinkageName));
-
// If this DIE is going to refer declaration info using AT_specification
// then there is no need to add other attributes.
if (DeclDie) {
@@ -1264,7 +1253,8 @@ DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
}
// Add the linkage name if we have one.
- if (!LinkageName.empty() && !DD->useDarwinGDBCompat())
+ StringRef LinkageName = SP.getLinkageName();
+ if (!LinkageName.empty())
addString(SPDie, dwarf::DW_AT_MIPS_linkage_name,
GlobalValue::getRealLinkageName(LinkageName));
@@ -1459,21 +1449,15 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
} else {
addBlock(VariableDIE, dwarf::DW_AT_location, 0, Block);
}
- // Add linkage name.
+ // Add the linkage name.
StringRef LinkageName = GV.getLinkageName();
- if (!LinkageName.empty()) {
+ if (!LinkageName.empty())
// From DWARF4: DIEs to which DW_AT_linkage_name may apply include:
// TAG_common_block, TAG_constant, TAG_entry_point, TAG_subprogram and
// TAG_variable.
addString(IsStaticMember && VariableSpecDIE ?
VariableSpecDIE : VariableDIE, dwarf::DW_AT_MIPS_linkage_name,
GlobalValue::getRealLinkageName(LinkageName));
- // In compatibility mode with older gdbs we put the linkage name on both
- // the TAG_variable DIE and on the TAG_member DIE.
- if (IsStaticMember && VariableSpecDIE && DD->useDarwinGDBCompat())
- addString(VariableDIE, dwarf::DW_AT_MIPS_linkage_name,
- GlobalValue::getRealLinkageName(LinkageName));
- }
} else if (const ConstantInt *CI =
dyn_cast_or_null<ConstantInt>(GV.getConstant())) {
// AT_const_value was added when the static member was created. To avoid
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index ce684ffe80..3e1877dc95 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -85,14 +85,6 @@ DwarfAccelTables("dwarf-accel-tables", cl::Hidden,
cl::init(Default));
static cl::opt<DefaultOnOff>
-DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
- cl::desc("Compatibility with Darwin gdb."),
- cl::values(clEnumVal(Default, "Default for platform"),
- clEnumVal(Enable, "Enabled"),
- clEnumVal(Disable, "Disabled"), clEnumValEnd),
- cl::init(Default));
-
-static cl::opt<DefaultOnOff>
SplitDwarf("split-dwarf", cl::Hidden,
cl::desc("Output prototype dwarf split debug info."),
cl::values(clEnumVal(Default, "Default for platform"),
@@ -206,11 +198,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
// and handle split dwarf.
bool IsDarwin = Triple(A->getTargetTriple()).isOSDarwin();
- if (DarwinGDBCompat == Default)
- IsDarwinGDBCompat = IsDarwin;
- else
- IsDarwinGDBCompat = DarwinGDBCompat == Enable;
-
if (DwarfAccelTables == Default)
HasDwarfAccelTables = IsDarwin;
else
@@ -1898,10 +1885,10 @@ void DwarfDebug::emitSectionLabels() {
DwarfLineSectionSym =
emitSectionSym(Asm, TLOF.getDwarfLineSection(), "section_line");
emitSectionSym(Asm, TLOF.getDwarfLocSection());
- if (HasDwarfPubSections)
+ if (HasDwarfPubSections) {
emitSectionSym(Asm, TLOF.getDwarfPubNamesSection());
- if (useDarwinGDBCompat() || HasDwarfPubSections)
emitSectionSym(Asm, TLOF.getDwarfPubTypesSection());
+ }
DwarfStrSectionSym =
emitSectionSym(Asm, TLOF.getDwarfStrSection(), "info_string");
if (useSplitDwarf()) {