diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-04-11 20:23:49 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-04-11 20:23:49 +0000 |
commit | 330ff7f94059e4df0338c64aa37e8a4f24a2d3ea (patch) | |
tree | 8ee1dd2c7c9fef11418a428076814b178dcf6131 | |
parent | 18959c3191983ca66f475c7f1519608f898e0af4 (diff) | |
download | llvm-330ff7f94059e4df0338c64aa37e8a4f24a2d3ea.zip llvm-330ff7f94059e4df0338c64aa37e8a4f24a2d3ea.tar.gz llvm-330ff7f94059e4df0338c64aa37e8a4f24a2d3ea.tar.bz2 |
Merging r198937:
------------------------------------------------------------------------
r198937 | kristof.beyls | 2014-01-10 08:41:49 -0500 (Fri, 10 Jan 2014) | 2 lines
Make sure -use-init-array has intended effect on all AArch64 ELF targets, not just linux.
------------------------------------------------------------------------
llvm-svn: 206065
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64TargetObjectFile.h | 8 | ||||
-rw-r--r-- | llvm/test/CodeGen/AArch64/init-array.ll | 1 |
4 files changed, 16 insertions, 8 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index c65995f..cf7aec3 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -31,12 +31,8 @@ using namespace llvm; static TargetLoweringObjectFile *createTLOF(AArch64TargetMachine &TM) { const AArch64Subtarget *Subtarget = &TM.getSubtarget<AArch64Subtarget>(); - - if (Subtarget->isTargetLinux()) - return new AArch64LinuxTargetObjectFile(); - if (Subtarget->isTargetELF()) - return new TargetLoweringObjectFileELF(); - llvm_unreachable("unknown subtarget type"); + assert (Subtarget->isTargetELF() && "unknown subtarget type"); + return new AArch64ElfTargetObjectFile(); } AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM) diff --git a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp index b4452f5..f8f2119 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp @@ -22,3 +22,10 @@ AArch64LinuxTargetObjectFile::Initialize(MCContext &Ctx, TargetLoweringObjectFileELF::Initialize(Ctx, TM); InitializeELF(TM.Options.UseInitArray); } + +void +AArch64ElfTargetObjectFile::Initialize(MCContext &Ctx, + const TargetMachine &TM) { + TargetLoweringObjectFileELF::Initialize(Ctx, TM); + InitializeELF(TM.Options.UseInitArray); +} diff --git a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h index bf0565a..f782285 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h +++ b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h @@ -20,8 +20,12 @@ namespace llvm { - /// AArch64LinuxTargetObjectFile - This implementation is used for linux - /// AArch64. + /// AArch64ElfTargetObjectFile - This implementation is used for ELF + /// AArch64 targets. + class AArch64ElfTargetObjectFile : public TargetLoweringObjectFileELF { + virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); + }; + class AArch64LinuxTargetObjectFile : public TargetLoweringObjectFileELF { virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); }; diff --git a/llvm/test/CodeGen/AArch64/init-array.ll b/llvm/test/CodeGen/AArch64/init-array.ll index 3ff1c1a..076ae27 100644 --- a/llvm/test/CodeGen/AArch64/init-array.ll +++ b/llvm/test/CodeGen/AArch64/init-array.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -use-init-array < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-none-none-eabi -verify-machineinstrs -use-init-array < %s | FileCheck %s define internal void @_GLOBAL__I_a() section ".text.startup" { ret void |