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

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

Issue 7847007: lto/addAsmGlobalSymbols: fail fracefully when the target does not define AsmParser. (Closed) Base URL: https://llvm.org/svn/llvm-project/llvm/trunk/
Patch Set: . Created 9 years, 3 months 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 //===-- 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 }
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