[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86AsmPrinter.h X86IntelAsmPrinter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Nov 21 14:20:00 PST 2005
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.13 -> 1.14
X86AsmPrinter.cpp updated: 1.153 -> 1.154
X86AsmPrinter.h updated: 1.5 -> 1.6
X86IntelAsmPrinter.cpp updated: 1.9 -> 1.10
---
Log message:
Add a forELF flag, allowing the removal of forCygwin and simplification of
conditionals.
---
Diffs of the changes: (+12 -7)
X86ATTAsmPrinter.cpp | 2 +-
X86AsmPrinter.cpp | 11 ++++++++---
X86AsmPrinter.h | 4 ++--
X86IntelAsmPrinter.cpp | 2 +-
4 files changed, 12 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.13 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.14
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.13 Mon Nov 21 02:32:23 2005
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Mon Nov 21 16:19:48 2005
@@ -35,7 +35,7 @@
SwitchSection("\t.text\n", MF.getFunction());
EmitAlignment(4); // FIXME: This should be parameterized somewhere.
O << "\t.globl\t" << CurrentFnName << "\n";
- if (!forCygwin && !forDarwin)
+ if (forELF)
O << "\t.type\t" << CurrentFnName << ", @function\n";
O << CurrentFnName << ":\n";
Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.153 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.154
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.153 Mon Nov 21 13:50:31 2005
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp Mon Nov 21 16:19:48 2005
@@ -39,15 +39,18 @@
cl::init(att));
/// doInitialization
-bool X86SharedAsmPrinter::doInitialization(Module& M) {
- forCygwin = false;
+bool X86SharedAsmPrinter::doInitialization(Module &M) {
+ bool forCygwin = false;
forDarwin = false;
+ forELF = false;
bool forWin32 = false;
const std::string& TT = M.getTargetTriple();
if (TT.length() > 5) {
forCygwin = TT.find("cygwin") != std::string::npos ||
TT.find("mingw") != std::string::npos;
forDarwin = TT.find("darwin") != std::string::npos;
+ if (!forDarwin && !forCygwin)
+ forELF = true;
} else if (TT.empty()) {
#if defined(__CYGWIN__) || defined(__MINGW32__)
forCygwin = true;
@@ -55,6 +58,8 @@
forDarwin = true;
#elif defined(_WIN32)
forWin32 = true;
+#else
+ forELF = true;
#endif
}
@@ -139,7 +144,7 @@
}
EmitAlignment(Align);
- if (!forCygwin && !forDarwin) {
+ if (forELF) {
O << "\t.type " << name << ", at object\n";
O << "\t.size " << name << "," << Size << "\n";
}
Index: llvm/lib/Target/X86/X86AsmPrinter.h
diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.5 llvm/lib/Target/X86/X86AsmPrinter.h:1.6
--- llvm/lib/Target/X86/X86AsmPrinter.h:1.5 Mon Nov 21 02:32:23 2005
+++ llvm/lib/Target/X86/X86AsmPrinter.h Mon Nov 21 16:19:48 2005
@@ -29,12 +29,12 @@
struct X86SharedAsmPrinter : public AsmPrinter {
X86SharedAsmPrinter(std::ostream &O, TargetMachine &TM)
- : AsmPrinter(O, TM), forCygwin(false), forDarwin(false) { }
+ : AsmPrinter(O, TM), forELF(false), forDarwin(false) { }
bool doInitialization(Module &M);
bool doFinalization(Module &M);
- bool forCygwin;
+ bool forELF;
bool forDarwin;
// Necessary for Darwin to print out the apprioriate types of linker stubs
Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.9 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.10
--- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.9 Mon Nov 21 02:32:23 2005
+++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Mon Nov 21 16:19:48 2005
@@ -35,7 +35,7 @@
SwitchSection("\t.text\n", MF.getFunction());
EmitAlignment(4);
O << "\t.globl\t" << CurrentFnName << "\n";
- if (!forCygwin && !forDarwin)
+ if (forELF)
O << "\t.type\t" << CurrentFnName << ", @function\n";
O << CurrentFnName << ":\n";
More information about the llvm-commits
mailing list