aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/IA64/IA64TargetMachine.cpp
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2009-07-15 17:27:11 +0000
committerStuart Hastings <stuart@apple.com>2009-07-15 17:27:11 +0000
commit2286f8dc4cec0625f7d7a14e2570926cf8599646 (patch)
tree2443581013659cf94139995c03b6883ff4ab43db /lib/Target/IA64/IA64TargetMachine.cpp
parent7fe3dd5b7ea9ef7d3cfd6d26dfdd7ddf49718339 (diff)
Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/IA64/IA64TargetMachine.cpp')
-rw-r--r--lib/Target/IA64/IA64TargetMachine.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/lib/Target/IA64/IA64TargetMachine.cpp b/lib/Target/IA64/IA64TargetMachine.cpp
index 5355075f8b..00fdd5e8a6 100644
--- a/lib/Target/IA64/IA64TargetMachine.cpp
+++ b/lib/Target/IA64/IA64TargetMachine.cpp
@@ -20,8 +20,7 @@
using namespace llvm;
// Register the target
-extern Target TheIA64Target;
-static RegisterTarget<IA64TargetMachine> X(TheIA64Target, "ia64",
+static RegisterTarget<IA64TargetMachine> X("ia64",
"IA-64 (Itanium) [experimental]");
// No assembler printer by default
@@ -34,12 +33,36 @@ const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
return new IA64TargetAsmInfo(*this);
}
+unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
+ // we match [iI][aA]*64
+ bool seenIA64=false;
+ std::string TT = M.getTargetTriple();
+
+ if (TT.size() >= 4) {
+ if( (TT[0]=='i' || TT[0]=='I') &&
+ (TT[1]=='a' || TT[1]=='A') ) {
+ for(unsigned int i=2; i<(TT.size()-1); i++)
+ if(TT[i]=='6' && TT[i+1]=='4')
+ seenIA64=true;
+ }
+
+ if (seenIA64)
+ return 20; // strong match
+ }
+ // If the target triple is something non-ia64, we don't match.
+ if (!TT.empty()) return 0;
+
+#if defined(__ia64__) || defined(__IA64__)
+ return 5;
+#else
+ return 0;
+#endif
+}
+
/// IA64TargetMachine ctor - Create an LP64 architecture model
///
-IA64TargetMachine::IA64TargetMachine(const Target &T, const Module &M,
- const std::string &FS)
- : LLVMTargetMachine(T),
- DataLayout("e-f80:128:128"),
+IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
+ : DataLayout("e-f80:128:128"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
TLInfo(*this) { // FIXME? check this stuff
}