Make the x86 asm flavor part of the subtarget info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30146 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 2c2acec..5107f91 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -13,9 +13,24 @@
#include "X86Subtarget.h"
#include "llvm/Module.h"
+#include "llvm/Support/CommandLine.h"
#include "X86GenSubtarget.inc"
using namespace llvm;
+cl::opt<X86Subtarget::AsmWriterFlavorTy>
+AsmWriterFlavor("x86-asm-syntax",
+ cl::desc("Choose style of code to emit from X86 backend:"),
+ cl::values(
+ clEnumValN(X86Subtarget::att, "att", " Emit AT&T-style assembly"),
+ clEnumValN(X86Subtarget::intel, "intel", " Emit Intel-style assembly"),
+ clEnumValEnd),
+#ifdef _MSC_VER
+ cl::init(X86Subtarget::intel)
+#else
+ cl::init(X86Subtarget::att)
+#endif
+ );
+
/// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in the
/// specified arguments. If we can't run cpuid on the host, return true.
static bool GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX,
@@ -151,6 +166,7 @@
MinRepStrSizeThreshold = 128;
X86SSELevel = NoMMXSSE;
X863DNowLevel = NoThreeDNow;
+ AsmFlavor = AsmWriterFlavor;
Is64Bit = false;
// Determine default and user specified characteristics