[llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Sep 7 15:29:55 PDT 2006
Changes in directory llvm/lib/Target/X86:
X86Subtarget.cpp updated: 1.29 -> 1.30
---
Log message:
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.
---
Diffs of the changes: (+12 -8)
X86Subtarget.cpp | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
Index: llvm/lib/Target/X86/X86Subtarget.cpp
diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.29 llvm/lib/Target/X86/X86Subtarget.cpp:1.30
--- llvm/lib/Target/X86/X86Subtarget.cpp:1.29 Thu Sep 7 07:23:47 2006
+++ llvm/lib/Target/X86/X86Subtarget.cpp Thu Sep 7 17:29:41 2006
@@ -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 @@
#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;
}
More information about the llvm-commits
mailing list