Implement -mstrict-align using '-backend-option -arm-strict-align' as this saves
authorChad Rosier <mcrosier@apple.com>
Fri, 9 Nov 2012 18:27:01 +0000 (18:27 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 9 Nov 2012 18:27:01 +0000 (18:27 +0000)
us from having to make any backend changes.

llvm-svn: 167623

clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Driver/strictalign.c [deleted file]

index 3df0b2f..558e6f1 100644 (file)
@@ -100,7 +100,6 @@ CODEGENOPT(VerifyModule      , 1, 1) ///< Control whether the module should be r
 
 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 
index 4fe5d81..62f87c9 100644 (file)
@@ -401,7 +401,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
   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;
index 3a6ecd7..00894c4 100644 (file)
@@ -2534,7 +2534,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     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
index 5663d8b..d0ff7d2 100644 (file)
@@ -407,7 +407,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
   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/clang/test/Driver/strictalign.c b/clang/test/Driver/strictalign.c
deleted file mode 100644 (file)
index e48c07c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: %clang -### -mstrict-align %s 2>&1 | FileCheck %s
-// CHECK: -mstrict-align