diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:01:23 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:01:23 +0000 |
| commit | ef811d8e058f321ce639c3a3d105f3f043cea8a3 (patch) | |
| tree | 0be64957334c2f97bc2c45bb4789191c1769815d /llvm/lib/Target/MSP430/MSP430TargetMachine.cpp | |
| parent | a9b7df98e6d38cd76665d815e3fe6c300cfefc2c (diff) | |
| download | bcm5719-llvm-ef811d8e058f321ce639c3a3d105f3f043cea8a3.tar.gz bcm5719-llvm-ef811d8e058f321ce639c3a3d105f3f043cea8a3.zip | |
Add 'msp430' target triple recognizer
llvm-svn: 70708
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430TargetMachine.cpp')
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430TargetMachine.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp b/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp index cf4464d8aa9..a2dee33c6c9 100644 --- a/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -43,7 +43,6 @@ MSP430TargetMachine::MSP430TargetMachine(const Module &M, InstrInfo(*this), TLInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { } - const TargetAsmInfo *MSP430TargetMachine::createTargetAsmInfo() const { return new MSP430TargetAsmInfo(*this); } @@ -54,10 +53,22 @@ bool MSP430TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) { return false; } -bool MSP430TargetMachine:: -addAssemblyEmitter(PassManagerBase &PM, bool Fast, bool Verbose, - raw_ostream &Out) { +bool MSP430TargetMachine::addAssemblyEmitter(PassManagerBase &PM, + bool Fast, bool Verbose, + raw_ostream &Out) { // Output assembly language. PM.add(createMSP430CodePrinterPass(Out, *this, Fast, Verbose)); return false; } + +unsigned MSP430TargetMachine::getModuleMatchQuality(const Module &M) { + std::string TT = M.getTargetTriple(); + + // We strongly match msp430 + if (TT.size() >= 6 && TT[0] == 'm' && TT[1] == 's' && TT[2] == 'p' && + TT[3] == '4' && TT[4] == '3' && TT[5] == '0') + return 20; + + return 0; +} + |

