forked from OSchip/llvm-project
Replace -use-init-array with -use-ctors.
We have been using .init-array for most systems for quiet some time, but tools like llc are still defaulting to .ctors because the old option was never changed. This patch makes llc default to .init-array and changes the option to be -use-ctors. Clang is not affected by this. It has its own fancier logic. llvm-svn: 216905
This commit is contained in:
parent
8bbb17dcc3
commit
4dd3677b5f
|
@ -190,8 +190,8 @@ EnablePIE("enable-pie",
|
|||
cl::init(false));
|
||||
|
||||
cl::opt<bool>
|
||||
UseInitArray("use-init-array",
|
||||
cl::desc("Use .init_array instead of .ctors."),
|
||||
UseCtors("use-ctors",
|
||||
cl::desc("Use .ctors instead of .init_array."),
|
||||
cl::init(false));
|
||||
|
||||
cl::opt<std::string> StopAfter("stop-after",
|
||||
|
@ -248,7 +248,7 @@ static inline TargetOptions InitTargetOptionsFromCodeGenFlags() {
|
|||
Options.StackAlignmentOverride = OverrideStackAlignment;
|
||||
Options.TrapFuncName = TrapFuncName;
|
||||
Options.PositionIndependentExecutable = EnablePIE;
|
||||
Options.UseInitArray = UseInitArray;
|
||||
Options.UseInitArray = !UseCtors;
|
||||
Options.DataSections = DataSections;
|
||||
Options.FunctionSections = FunctionSections;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -use-init-array -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-none-none-eabi -verify-machineinstrs -use-init-array -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-none-none-eabi -verify-machineinstrs -o - %s | FileCheck %s
|
||||
|
||||
define internal void @_GLOBAL__I_a() section ".text.startup" {
|
||||
ret void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llc -mtriple mipsel-unknown-linux -use-init-array < %s | FileCheck %s
|
||||
; RUN: llc -mtriple mipsel-unknown-linux < %s | FileCheck %s
|
||||
|
||||
target triple = "mipsel-unknown-linux"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llc < %s -mtriple=i386-linux-gnu | FileCheck %s --check-prefix=CHECK-DEFAULT
|
||||
; RUN: llc < %s -mtriple=i386-linux-gnu -use-ctors | FileCheck %s --check-prefix=CHECK-DEFAULT
|
||||
; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s --check-prefix=CHECK-DARWIN
|
||||
; PR5329
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=CTOR %s
|
||||
; RUN: llc -mtriple x86_64-pc-linux -use-init-array < %s | FileCheck --check-prefix=INIT-ARRAY %s
|
||||
; RUN: llc -mtriple x86_64-pc-linux -use-ctors < %s | FileCheck --check-prefix=CTOR %s
|
||||
; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=INIT-ARRAY %s
|
||||
@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }, { i32, void ()* } { i32 15, void ()* @g }]
|
||||
|
||||
define void @f() {
|
||||
|
|
Loading…
Reference in New Issue