diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index f852805408c1..d27e04fccfc7 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -164,6 +164,9 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Emit the rest of the function body. EmitFunctionBody(); + // Emit the XRay table for this function. + emitXRayTable(); + // If we need V4T thumb mode Register Indirect Jump pads, emit them. // These are created per function, rather than per TU, since it's // relatively easy to exceed the thumb branch range within a TU. diff --git a/llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll b/llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll index 8a8c667b2d8d..93c3cb14fb73 100644 --- a/llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll +++ b/llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll @@ -23,3 +23,9 @@ define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: bx lr } +; CHECK: .p2align 4 +; CHECK-NEXT: .long {{.*}}Lxray_synthetic_0 +; CHECK-NEXT: .section {{.*}}xray_instr_map{{.*}} +; CHECK-LABEL: Lxray_synthetic_0: +; CHECK: .long {{.*}}Lxray_sled_0 +; CHECK: .long {{.*}}Lxray_sled_1 diff --git a/llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll b/llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll index 07852cd68796..d14590b88679 100644 --- a/llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll +++ b/llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll @@ -23,3 +23,9 @@ define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: bx lr } +; CHECK: .p2align 4 +; CHECK-NEXT: .long {{.*}}Lxray_synthetic_0 +; CHECK-NEXT: .section {{.*}}xray_instr_map{{.*}} +; CHECK-LABEL: Lxray_synthetic_0: +; CHECK: .long {{.*}}Lxray_sled_0 +; CHECK: .long {{.*}}Lxray_sled_1