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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/PNaCl/PNaClTargetMachine.cpp
===================================================================
--- lib/Target/PNaCl/PNaClTargetMachine.cpp (revision 0)
+++ lib/Target/PNaCl/PNaClTargetMachine.cpp (revision 0)
@@ -0,0 +1,51 @@
+//===-- PNaClTargetMachine.cpp - Define TargetMachine for PNaCl -----------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//
+//===----------------------------------------------------------------------===//
+
+#include "PNaCl.h"
+#include "PNaClTargetMachine.h"
+#include "llvm/PassManager.h"
+#include "llvm/Support/FormattedStream.h"
+#include "llvm/Support/TargetRegistry.h"
+using namespace llvm;
+
+extern "C" void LLVMInitializePNaClTarget() {
+ // HACK: this code is needed to claim using at least one symbol
+ // from libLLVMPNaClDesc to help to inlude this dependency into
+ // LibDeps.txt, because it's implicitly implied by llc and Clang.
+ long long a = (long long)(void*)&ThePNaClTarget;
+ if (a*a < 1) {
+ LLVMInitializePNaClTargetMC();
+ }
+ // Register the target.
+ RegisterTargetMachine<PNaClTargetMachine> X(ThePNaClTarget);
+}
+
+PNaClTargetMachine::PNaClTargetMachine(const Target &T, StringRef TT,
+ StringRef CPU, StringRef FS,
+ Reloc::Model RM, CodeModel::Model CM)
+ : TargetMachine(T, TT, CPU, FS),
+ DataLayout("e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-"
+ "f64:64:64-p:32:32:32") {
+ AsmInfo = T.createMCAsmInfo(TT);
+}
+
+//===----------------------------------------------------------------------===//
+// External Interface declaration
+//===----------------------------------------------------------------------===//
+
+bool PNaClTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
+ formatted_raw_ostream &o,
+ CodeGenFileType FileType,
+ CodeGenOpt::Level OptLevel,
+ bool DisableVerify) {
+ return true;
+}
« 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