[cfe-commits] r167623 - in /cfe/trunk: include/clang/Frontend/CodeGenOptions.def lib/CodeGen/BackendUtil.cpp lib/Driver/Tools.cpp lib/Frontend/CompilerInvocation.cpp test/Driver/strictalign.c

Chad Rosier mcrosier at apple.com
Fri Nov 9 10:27:01 PST 2012


Author: mcrosier
Date: Fri Nov  9 12:27:01 2012
New Revision: 167623

URL: http://llvm.org/viewvc/llvm-project?rev=167623&view=rev
Log:
Implement -mstrict-align using '-backend-option -arm-strict-align' as this saves
us from having to make any backend changes.

Removed:
    cfe/trunk/test/Driver/strictalign.c
Modified:
    cfe/trunk/include/clang/Frontend/CodeGenOptions.def
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=167623&r1=167622&r2=167623&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Fri Nov  9 12:27:01 2012
@@ -100,7 +100,6 @@
 
 CODEGENOPT(StackRealignment  , 1, 0) ///< Control whether to permit stack
                                      ///< realignment.
-CODEGENOPT(StrictAlign       , 1, 0) ///< Force all memory accesses to be aligned.
 CODEGENOPT(UseInitArray      , 1, 0) ///< Control whether to use .init_array or
                                      ///< .ctors.
 VALUE_CODEGENOPT(StackAlignment    , 32, 0) ///< Overrides default stack 

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=167623&r1=167622&r2=167623&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Nov  9 12:27:01 2012
@@ -401,7 +401,6 @@
   Options.UseSoftFloat = CodeGenOpts.SoftFloat;
   Options.StackAlignmentOverride = CodeGenOpts.StackAlignment;
   Options.RealignStack = CodeGenOpts.StackRealignment;
-  Options.StrictAlign = CodeGenOpts.StrictAlign;
   Options.DisableTailCalls = CodeGenOpts.DisableTailCalls;
   Options.TrapFuncName = CodeGenOpts.TrapFuncName;
   Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=167623&r1=167622&r2=167623&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Nov  9 12:27:01 2012
@@ -2534,7 +2534,8 @@
     CmdArgs.push_back(Args.MakeArgString("-mstack-alignment=" + alignment));
   }
   if (Args.hasArg(options::OPT_mstrict_align)) {
-    CmdArgs.push_back(Args.MakeArgString("-mstrict-align"));
+    CmdArgs.push_back("-backend-option");
+    CmdArgs.push_back("-arm-strict-align");
   }
 
   // Forward -f options with positive and negative forms; we translate

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=167623&r1=167622&r2=167623&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Nov  9 12:27:01 2012
@@ -407,7 +407,6 @@
   Opts.SSPBufferSize =
     Args.getLastArgIntValue(OPT_stack_protector_buffer_size, 8, Diags);
   Opts.StackRealignment = Args.hasArg(OPT_mstackrealign);
-  Opts.StrictAlign = Args.hasArg(OPT_mstrict_align);
   if (Arg *A = Args.getLastArg(OPT_mstack_alignment)) {
     StringRef Val = A->getValue();
     unsigned StackAlignment = Opts.StackAlignment;

Removed: cfe/trunk/test/Driver/strictalign.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/strictalign.c?rev=167622&view=auto
==============================================================================
--- cfe/trunk/test/Driver/strictalign.c (original)
+++ cfe/trunk/test/Driver/strictalign.c (removed)
@@ -1,2 +0,0 @@
-// RUN: %clang -### -mstrict-align %s 2>&1 | FileCheck %s
-// CHECK: -mstrict-align





More information about the cfe-commits mailing list