Update Clang for LLVM split stack API changes in r205997

Patch by Alex Crichton!

llvm-svn: 205998
This commit is contained in:
Reid Kleckner
2014-04-10 22:59:13 +00:00
parent 9c6582129a
commit fb873af67e
3 changed files with 20 additions and 1 deletions

View File

@@ -491,7 +491,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
Options.DisableTailCalls = CodeGenOpts.DisableTailCalls; Options.DisableTailCalls = CodeGenOpts.DisableTailCalls;
Options.TrapFuncName = CodeGenOpts.TrapFuncName; Options.TrapFuncName = CodeGenOpts.TrapFuncName;
Options.PositionIndependentExecutable = LangOpts.PIELevel != 0; Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;
Options.EnableSegmentedStacks = CodeGenOpts.EnableSegmentedStacks;
TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU, TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
FeaturesStr, Options, FeaturesStr, Options,

View File

@@ -1090,6 +1090,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
FuncAttrs.addAttribute(llvm::Attribute::NoRedZone); FuncAttrs.addAttribute(llvm::Attribute::NoRedZone);
if (CodeGenOpts.NoImplicitFloat) if (CodeGenOpts.NoImplicitFloat)
FuncAttrs.addAttribute(llvm::Attribute::NoImplicitFloat); FuncAttrs.addAttribute(llvm::Attribute::NoImplicitFloat);
if (CodeGenOpts.EnableSegmentedStacks)
FuncAttrs.addAttribute("split-stack");
if (AttrOnCallSite) { if (AttrOnCallSite) {
// Attributes that should go on the call site only. // Attributes that should go on the call site only.

View File

@@ -0,0 +1,18 @@
// RUN: %clang -target x86_64-linux-gnu -fsplit-stack -S %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-SEGSTK %s
// RUN: %clang -target x86_64-linux-gnu -S %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-NOSEGSTK %s
int foo() {
return 0;
}
int main() {
return foo();
}
// CHECK-SEGSTK: define i32 @foo() #0 {
// CHECK-SEGSTK: define i32 @main() #0 {
// CHECK-SEGSTK: #0 = { {{.*}} "split-stack" {{.*}} }
// CHECK-NOSEGSTK: define i32 @foo() #0 {
// CHECK-NOSEGSTK: define i32 @main() #0 {
// CHECK-NOSEGSTK-NOT: #0 = { {{.*}} "split-stack" {{.*}} }