[dragonegg] r187028 - Fix the build after removal of the SSPBufferSize codegen option.

Duncan Sands baldrick at free.fr
Wed Jul 24 02:13:01 PDT 2013


Author: baldrick
Date: Wed Jul 24 04:13:00 2013
New Revision: 187028

URL: http://llvm.org/viewvc/llvm-project?rev=187028&view=rev
Log:
Fix the build after removal of the SSPBufferSize codegen option.

Modified:
    dragonegg/trunk/src/Backend.cpp
    dragonegg/trunk/src/TypeConversion.cpp
    dragonegg/trunk/test/validator/c/StackProtector.c

Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=187028&r1=187027&r2=187028&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Wed Jul 24 04:13:00 2013
@@ -522,7 +522,6 @@ static void CreateTargetMachine(const st
   // TODO: DisableTailCalls.
   // TODO: TrapFuncName.
   Options.PositionIndependentExecutable = flag_pie;
-  Options.SSPBufferSize = PARAM_VALUE(PARAM_SSP_BUFFER_SIZE);
 #if (GCC_MINOR > 5)
   Options.EnableSegmentedStacks = flag_split_stack;
 #endif

Modified: dragonegg/trunk/src/TypeConversion.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/TypeConversion.cpp?rev=187028&r1=187027&r2=187028&view=diff
==============================================================================
--- dragonegg/trunk/src/TypeConversion.cpp (original)
+++ dragonegg/trunk/src/TypeConversion.cpp Wed Jul 24 04:13:00 2013
@@ -29,6 +29,7 @@
 
 // LLVM headers
 #include "llvm/ADT/SCCIterator.h"
+#include "llvm/ADT/StringExtras.h"
 
 // System headers
 #include <gmp.h>
@@ -49,6 +50,7 @@ extern "C" {
 #include "tree.h"
 
 #include "flags.h"
+#include "params.h"
 #ifndef ENABLE_BUILD_WITH_CXX
 } // extern "C"
 #endif
@@ -899,6 +901,11 @@ ConvertFunctionType(tree type, tree decl
 
   assert(RetTy && "Return type not specified!");
 
+  // Add codegen attributes.
+  if (flag_stack_protect)
+    FnAttrBuilder.addAttribute("stack-protector-buffer-size",
+                               utostr(PARAM_VALUE(PARAM_SSP_BUFFER_SIZE)));
+
   if (FnAttrBuilder.hasAttributes())
     Attrs.push_back(
         AttributeSet::get(Context, AttributeSet::FunctionIndex, FnAttrBuilder));

Modified: dragonegg/trunk/test/validator/c/StackProtector.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/validator/c/StackProtector.c?rev=187028&r1=187027&r2=187028&view=diff
==============================================================================
--- dragonegg/trunk/test/validator/c/StackProtector.c (original)
+++ dragonegg/trunk/test/validator/c/StackProtector.c Wed Jul 24 04:13:00 2013
@@ -1 +1,5 @@
-// RUN: %dragonegg -S -o /dev/null %s -fstack-protector --param ssp-buffer-size=1
+// RUN: %dragonegg -S -o - %s -fstack-protector --param ssp-buffer-size=1 | FileCheck --check-prefix=SP %s
+// RUN: %dragonegg -S -o - %s | FileCheck --check-prefix=NP %s
+void foo(void) {}
+// SP: attributes {{.*}} "stack-protector-buffer-size"="1"
+// NP-NOT: stack-protector





More information about the llvm-commits mailing list