diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index f2b0f9be9614..c2fd6ce3679c 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -135,6 +135,9 @@ namespace llvm { /// getDataLayout - Return information about data layout. const DataLayout &getDataLayout() const; + /// getTargetTriple - Return the target triple string. + StringRef getTargetTriple() const; + /// getCurrentSection() - Return the current section we are emitting to. const MCSection *getCurrentSection() const; diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 864787d32fd2..84162ace4188 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -133,6 +133,10 @@ const DataLayout &AsmPrinter::getDataLayout() const { return *TM.getDataLayout(); } +StringRef AsmPrinter::getTargetTriple() const { + return TM.getTargetTriple(); +} + /// getCurrentSection() - Return the current section we are emitting to. const MCSection *AsmPrinter::getCurrentSection() const { return OutStreamer.getCurrentSection().first; diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c4e77aafabc3..ee6308c466a6 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -176,7 +176,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) // Turn on accelerator tables and older gdb compatibility // for Darwin. - bool IsDarwin = Triple(M->getTargetTriple()).isOSDarwin(); + bool IsDarwin = Triple(A->getTargetTriple()).isOSDarwin(); if (DarwinGDBCompat == Default) { if (IsDarwin) IsDarwinGDBCompat = true; diff --git a/llvm/test/DebugInfo/member-pointers.ll b/llvm/test/DebugInfo/member-pointers.ll index a78aa629ec61..20f4e68e2aa8 100644 --- a/llvm/test/DebugInfo/member-pointers.ll +++ b/llvm/test/DebugInfo/member-pointers.ll @@ -7,7 +7,7 @@ ; CHECK: [[TYPE:.*]]: DW_TAG_subroutine_type ; CHECK: DW_TAG_formal_parameter ; CHECK-NEXT: DW_AT_type -; CHECK-NEXT: DW_AT_artificial [DW_FORM_flag_present] +; CHECK-NEXT: DW_AT_artificial [DW_FORM_flag ; CHECK: DW_TAG_ptr_to_member_type ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]}) ; IR generated from clang -g with the following source: