Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: lib/Target/PNaCl/PNaClTargetMachine.cpp

Issue 1395453003: Create a proper target machine for PNaCl. Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix a test Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Target/PNaCl/PNaClTargetMachine.h ('k') | lib/Target/PNaCl/TargetInfo/CMakeLists.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 //===-- llvm/Target/PNaCl/PNaClTargetMachine.cpp - Target Information -*- C++ -* -===//
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 // This file defines the TargetMachine class specific to PNaCl.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "PNaClTargetMachine.h"
15 #include "TargetInfo/PNaClTargetInfo.h"
16
17 #include "llvm/Bitcode/BitcodeWriterPass.h"
18 #include "llvm/IR/IRPrintingPasses.h"
19 #include "llvm/IR/LegacyPassManager.h"
20 #include "llvm/Support/TargetRegistry.h"
21
22 using namespace llvm;
23
24 extern "C" void LLVMInitializePNaClTarget() {
25 RegisterTargetMachine<PNaClTargetMachine> X(PNaClLe32_Target);
26 }
27
28 static const char* Datalayout = "e-p:32:32-i64:64-n32";
29
30 llvm::PNaClTargetMachine::PNaClTargetMachine(const Target& T, StringRef TT,
31 StringRef CPU, StringRef FS,
32 const TargetOptions &Options,
33 Reloc::Model RM,
34 CodeModel::Model CM,
35 CodeGenOpt::Level OL)
36 : TargetMachine(T, Datalayout, TT, CPU, FS, Options)
37 {
38 (void)RM; (void)CM; (void)OL;
39 }
40
41 llvm::PNaClTargetMachine::~PNaClTargetMachine() {
42 }
43
44 bool llvm::PNaClTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
45 raw_pwrite_stream &Out,
46 CodeGenFileType FType,
47 bool DisableVerify,
48 AnalysisID StartAfter,
49 AnalysisID StopAfter) {
50 (void)DisableVerify;
51 (void)StartAfter;
52 (void)StopAfter;
53
54 switch(FType) {
55 case CGFT_ObjectFile:
56 PM.add(createBitcodeWriterPass(Out));
57 break;
58 case CGFT_AssemblyFile:
59 PM.add(createPrintModulePass(Out));
60 break;
61 case CGFT_Null:
62 return true;
63 }
64
65 return false;
66 }
OLDNEW
« no previous file with comments | « lib/Target/PNaCl/PNaClTargetMachine.h ('k') | lib/Target/PNaCl/TargetInfo/CMakeLists.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698