aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-07 22:29:41 +0000
committerChris Lattner <sabre@nondot.org>2006-09-07 22:29:41 +0000
commitcdb341dcfa371b842d0299250e961e4206a5ff5a (patch)
tree04e4b648df797a12a32e5a191fcf002a039c53a2 /lib/Target
parent93463363b3dbe9f8f0adff2d20c33ff8a502cd78 (diff)
downloadexternal_llvm-cdb341dcfa371b842d0299250e961e4206a5ff5a.zip
external_llvm-cdb341dcfa371b842d0299250e961e4206a5ff5a.tar.gz
external_llvm-cdb341dcfa371b842d0299250e961e4206a5ff5a.tar.bz2
Fix a cross-build issue. The asmsyntax shouldn't be affected by the build
host, it should be affected by the target. Allow the command line option to override in either case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 5107f91..e3776d8 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -18,18 +18,12 @@
using namespace llvm;
cl::opt<X86Subtarget::AsmWriterFlavorTy>
-AsmWriterFlavor("x86-asm-syntax",
+AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::unset),
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
- );
+ clEnumValEnd));
/// 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.
@@ -199,6 +193,16 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS) {
#endif
}
+ // If the asm syntax hasn't been overridden on the command line, use whatever
+ // the target wants.
+ if (AsmFlavor == X86Subtarget::unset) {
+ if (TargetType == isWindows) {
+ AsmFlavor = X86Subtarget::intel;
+ } else {
+ AsmFlavor = X86Subtarget::att;
+ }
+ }
+
if (TargetType == isDarwin || TargetType == isCygwin)
stackAlignment = 16;
}