r205998 - Update Clang for LLVM split stack API changes in r205997

Reid Kleckner reid at kleckner.net
Thu Apr 10 15:59:14 PDT 2014


Author: rnk
Date: Thu Apr 10 17:59:13 2014
New Revision: 205998

URL: http://llvm.org/viewvc/llvm-project?rev=205998&view=rev
Log:
Update Clang for LLVM split stack API changes in r205997

Patch by Alex Crichton!

Added:
    cfe/trunk/test/CodeGen/split-stacks.c
Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/lib/CodeGen/CGCall.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=205998&r1=205997&r2=205998&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Thu Apr 10 17:59:13 2014
@@ -491,7 +491,6 @@ TargetMachine *EmitAssemblyHelper::Creat
   Options.DisableTailCalls = CodeGenOpts.DisableTailCalls;
   Options.TrapFuncName = CodeGenOpts.TrapFuncName;
   Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;
-  Options.EnableSegmentedStacks = CodeGenOpts.EnableSegmentedStacks;
 
   TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
                                                      FeaturesStr, Options,

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=205998&r1=205997&r2=205998&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Apr 10 17:59:13 2014
@@ -1090,6 +1090,8 @@ void CodeGenModule::ConstructAttributeLi
     FuncAttrs.addAttribute(llvm::Attribute::NoRedZone);
   if (CodeGenOpts.NoImplicitFloat)
     FuncAttrs.addAttribute(llvm::Attribute::NoImplicitFloat);
+  if (CodeGenOpts.EnableSegmentedStacks)
+    FuncAttrs.addAttribute("split-stack");
 
   if (AttrOnCallSite) {
     // Attributes that should go on the call site only.

Added: cfe/trunk/test/CodeGen/split-stacks.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/split-stacks.c?rev=205998&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/split-stacks.c (added)
+++ cfe/trunk/test/CodeGen/split-stacks.c Thu Apr 10 17:59:13 2014
@@ -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" {{.*}} }





More information about the cfe-commits mailing list