[llvm] r278113 - [XRay] Test for xray_instr_map in object file. (NFC)

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 03:42:11 PDT 2016


Author: dberris
Date: Tue Aug  9 05:42:11 2016
New Revision: 278113

URL: http://llvm.org/viewvc/llvm-project?rev=278113&view=rev
Log:
[XRay] Test for xray_instr_map in object file. (NFC)

This makes a trivial change in the emission of the per-function XRay
tables, and makes sure that the xray_instr_map section does show up in
the object file.

Modified:
    llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
    llvm/trunk/test/CodeGen/X86/xray-section-group.ll

Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=278113&r1=278112&r2=278113&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Tue Aug  9 05:42:11 2016
@@ -1105,7 +1105,6 @@ void X86AsmPrinter::EmitXRayTable() {
       Section = OutContext.getELFSection("xray_instr_map", ELF::SHT_PROGBITS,
                                          ELF::SHF_ALLOC | ELF::SHF_GROUP, 0,
                                          Fn->getComdat()->getName());
-      OutStreamer->SwitchSection(Section);
     } else {
       Section = OutContext.getELFSection("xray_instr_map", ELF::SHT_PROGBITS,
                                          ELF::SHF_ALLOC);

Modified: llvm/trunk/test/CodeGen/X86/xray-section-group.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/xray-section-group.ll?rev=278113&r1=278112&r2=278113&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/xray-section-group.ll (original)
+++ llvm/trunk/test/CodeGen/X86/xray-section-group.ll Tue Aug  9 05:42:11 2016
@@ -1,4 +1,6 @@
 ; RUN: llc -filetype=asm -o - -mtriple=x86_64-unknown-linux-gnu -function-sections < %s | FileCheck %s
+; RUN: llc -filetype=obj -o %t -mtriple=x86_64-unknown-linux-gnu -function-sections < %s
+; RUN: llvm-objdump -triple x86_64-unknown-linux-gnu -disassemble-all %t | FileCheck %s --check-prefix=CHECK-OBJ
 
 define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" {
 ; CHECK: .section .text.foo,"ax", at progbits
@@ -7,8 +9,10 @@ define i32 @foo() nounwind noinline uwta
 }
 
 $bar = comdat any
-define i32 @comdat() nounwind noinline uwtable "function-instrument"="xray-always" comdat($bar) {
-; CHECK: .section .text.comdat,"axG", at progbits,bar,comdat
+define i32 @bar() nounwind noinline uwtable "function-instrument"="xray-always" comdat($bar) {
+; CHECK: .section .text.bar,"axG", at progbits,bar,comdat
   ret i32 1
 ; CHECK: .section xray_instr_map,"aG", at progbits,bar,comdat
 }
+
+; CHECK-OBJ:      section xray_instr_map:




More information about the llvm-commits mailing list