[PATCH] D21907: [AArch64] fix profiling with GNU LINUX on Aarch64

Brian Rzycki via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 14:03:03 PDT 2016


brzycki created this revision.
brzycki added reviewers: abdulras, rengolin, jmolloy.
brzycki added subscribers: cfe-commits, sebpop, evandro.
Herald added subscribers: rengolin, aemerson.

The GNU profiling support indicates that the interface is `_mcount` rather than `mcount` on GLIBC Linux for AArch64.

http://reviews.llvm.org/D21907

Files:
  clang/lib/Basic/Targets.cpp
  clang/test/Frontend/gnu-mcount.c

Index: clang/test/Frontend/gnu-mcount.c
===================================================================
--- clang/test/Frontend/gnu-mcount.c
+++ clang/test/Frontend/gnu-mcount.c
@@ -6,6 +6,7 @@
 // RUN: %clang -target armv7-unknown-linux-gnueabi -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI-MEABI-GNU
 // RUN: %clang -target aarch64-unknown-linux-gnueabi -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM64-EABI
 // RUN: %clang -target aarch64-unknown-linux-gnueabi -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM64-EABI-MEABI-GNU
+// RUN: %clang -target aarch64-unknown-linux-gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM64-LINUX-GNU
 // RUN: %clang -target armv7-unknown-linux-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI
 // RUN: %clang -target armv7-unknown-linux-gnueabihf -meabi gnu -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM-EABI-MEABI-GNU
 // RUN: %clang -target aarch64-unknown-linux-gnueabihf -pg -S -emit-llvm -o - %s | FileCheck %s -check-prefix CHECK -check-prefix CHECK-ARM64-EABI
@@ -44,6 +45,7 @@
 }
 
 // CHECK-LABEL: f
+// CHECK-ARM64-LINUX-GNU: call void @_mcount()
 // CHECK-ARM-IOS-NOT: call void @_mcount()
 // CHECK-ARM-IOS-NOT: call void @"\01__gnu_mcount_nc"()
 // CHECK-ARM-EABI: call void @"\01mcount"()
Index: clang/lib/Basic/Targets.cpp
===================================================================
--- clang/lib/Basic/Targets.cpp
+++ clang/lib/Basic/Targets.cpp
@@ -471,6 +471,7 @@
     case llvm::Triple::ppc:
     case llvm::Triple::ppc64:
     case llvm::Triple::ppc64le:
+    case llvm::Triple::aarch64:
       this->MCountName = "_mcount";
       break;
     case llvm::Triple::x86:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21907.62411.patch
Type: text/x-patch
Size: 1907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160630/d45812ba/attachment-0001.bin>


More information about the cfe-commits mailing list