OLD | NEW |
(Empty) | |
| 1 //===-- PNaClTargetMachine.cpp - Define TargetMachine for PNaCl -----------===// |
| 2 // |
| 3 // The LLVM Compiler Infrastructure |
| 4 // |
| 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. |
| 7 // |
| 8 //===----------------------------------------------------------------------===// |
| 9 // |
| 10 // |
| 11 //===----------------------------------------------------------------------===// |
| 12 |
| 13 #include "PNaCl.h" |
| 14 #include "PNaClTargetMachine.h" |
| 15 #include "llvm/PassManager.h" |
| 16 #include "llvm/Support/FormattedStream.h" |
| 17 #include "llvm/Support/TargetRegistry.h" |
| 18 using namespace llvm; |
| 19 |
| 20 extern "C" void LLVMInitializePNaClTarget() { |
| 21 // HACK: this code is needed to claim using at least one symbol |
| 22 // from libLLVMPNaClDesc to help to inlude this dependency into |
| 23 // LibDeps.txt, because it's implicitly implied by llc and Clang. |
| 24 long long a = (long long)(void*)&ThePNaClTarget; |
| 25 if (a*a < 1) { |
| 26 LLVMInitializePNaClTargetMC(); |
| 27 } |
| 28 // Register the target. |
| 29 RegisterTargetMachine<PNaClTargetMachine> X(ThePNaClTarget); |
| 30 } |
| 31 |
| 32 PNaClTargetMachine::PNaClTargetMachine(const Target &T, StringRef TT, |
| 33 StringRef CPU, StringRef FS, |
| 34 Reloc::Model RM, CodeModel::Model CM) |
| 35 : TargetMachine(T, TT, CPU, FS), |
| 36 DataLayout("e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-" |
| 37 "f64:64:64-p:32:32:32") { |
| 38 AsmInfo = T.createMCAsmInfo(TT); |
| 39 } |
| 40 |
| 41 //===----------------------------------------------------------------------===// |
| 42 // External Interface declaration |
| 43 //===----------------------------------------------------------------------===// |
| 44 |
| 45 bool PNaClTargetMachine::addPassesToEmitFile(PassManagerBase &PM, |
| 46 formatted_raw_ostream &o, |
| 47 CodeGenFileType FileType, |
| 48 CodeGenOpt::Level OptLevel, |
| 49 bool DisableVerify) { |
| 50 return true; |
| 51 } |
OLD | NEW |