summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Alpha/AlphaTargetMachine.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
commit338191cd67a0a3e324c8b1475c975fed5ffa9e94 (patch)
treeeef241f50ca61beb5959953f38fdd29594a20597 /llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
parentc5928d2fad2313bf8e582fec74b2b9a385f350e7 (diff)
downloadbcm5719-llvm-338191cd67a0a3e324c8b1475c975fed5ffa9e94.tar.gz
bcm5719-llvm-338191cd67a0a3e324c8b1475c975fed5ffa9e94.zip
Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk. llvm-svn: 75799
Diffstat (limited to 'llvm/lib/Target/Alpha/AlphaTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/Alpha/AlphaTargetMachine.cpp37
1 files changed, 30 insertions, 7 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp b/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
index a7a8162c124..625d0cea543 100644
--- a/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
+++ b/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
@@ -22,9 +22,7 @@
using namespace llvm;
// Register the targets
-extern Target TheAlphaTarget;
-static RegisterTarget<AlphaTargetMachine> X(TheAlphaTarget, "alpha",
- "Alpha [experimental]");
+static RegisterTarget<AlphaTargetMachine> X("alpha", "Alpha [experimental]");
// No assembler printer by default
AlphaTargetMachine::AsmPrinterCtorFn AlphaTargetMachine::AsmPrinterCtor = 0;
@@ -36,10 +34,35 @@ const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
return new AlphaTargetAsmInfo(*this);
}
-AlphaTargetMachine::AlphaTargetMachine(const Target &T, const Module &M,
- const std::string &FS)
- : LLVMTargetMachine(T),
- DataLayout("e-f128:128:128"),
+unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) {
+ // We strongly match "alpha*".
+ std::string TT = M.getTargetTriple();
+ if (TT.size() >= 5 && TT[0] == 'a' && TT[1] == 'l' && TT[2] == 'p' &&
+ TT[3] == 'h' && TT[4] == 'a')
+ return 20;
+ // If the target triple is something non-alpha, we don't match.
+ if (!TT.empty()) return 0;
+
+ if (M.getEndianness() == Module::LittleEndian &&
+ M.getPointerSize() == Module::Pointer64)
+ return 10; // Weak match
+ else if (M.getEndianness() != Module::AnyEndianness ||
+ M.getPointerSize() != Module::AnyPointerSize)
+ return 0; // Match for some other target
+
+ return getJITMatchQuality()/2;
+}
+
+unsigned AlphaTargetMachine::getJITMatchQuality() {
+#ifdef __alpha
+ return 10;
+#else
+ return 0;
+#endif
+}
+
+AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
+ : DataLayout("e-f128:128:128"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
Subtarget(M, FS),
OpenPOWER on IntegriCloud