Implement -mstrict-align using '-backend-option -arm-strict-align' as this saves
us from having to make any backend changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167623 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Frontend/CodeGenOptions.def b/include/clang/Frontend/CodeGenOptions.def
index 3df0b2f..558e6f1 100644
--- a/include/clang/Frontend/CodeGenOptions.def
+++ b/include/clang/Frontend/CodeGenOptions.def
@@ -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 
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 4fe5d81..62f87c9 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -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;
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 3a6ecd7..00894c4 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -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
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 5663d8b..d0ff7d2 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -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;
diff --git a/test/Driver/strictalign.c b/test/Driver/strictalign.c
deleted file mode 100644
index e48c07c..0000000
--- a/test/Driver/strictalign.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: %clang -### -mstrict-align %s 2>&1 | FileCheck %s
-// CHECK: -mstrict-align