[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Dec 12 09:40:48 PST 2004
Changes in directory llvm/lib/Target/X86:
X86TargetMachine.cpp updated: 1.71 -> 1.72
---
Log message:
Use the target triple to pick this target.
---
Diffs of the changes: (+7 -1)
Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.71 llvm/lib/Target/X86/X86TargetMachine.cpp:1.72
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.71 Tue Nov 2 09:27:57 2004
+++ llvm/lib/Target/X86/X86TargetMachine.cpp Sun Dec 12 11:40:06 2004
@@ -69,9 +69,15 @@
}
unsigned X86TargetMachine::getModuleMatchQuality(const Module &M) {
+ // We strongly match "i[3-9]86-*".
+ std::string TT = M.getTargetTriple();
+ if (TT.size() >= 5 && TT[0] == 'i' && TT[2] == '8' && TT[3] == '6' &&
+ TT[4] == '-' && TT[1] - '3' < 6)
+ return 20;
+
if (M.getEndianness() == Module::LittleEndian &&
M.getPointerSize() == Module::Pointer32)
- return 10; // Direct match
+ return 10; // Weak match
else if (M.getEndianness() != Module::AnyEndianness ||
M.getPointerSize() != Module::AnyPointerSize)
return 0; // Match for some other target
More information about the llvm-commits
mailing list