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

Unified Diff: lib/Target/PNaCl/MCTargetDesc/PNaClMCTargetDesc.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/MCTargetDesc/PNaClMCTargetDesc.h ('k') | lib/Target/PNaCl/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/PNaCl/MCTargetDesc/PNaClMCTargetDesc.cpp
===================================================================
--- lib/Target/PNaCl/MCTargetDesc/PNaClMCTargetDesc.cpp (revision 0)
+++ lib/Target/PNaCl/MCTargetDesc/PNaClMCTargetDesc.cpp (revision 0)
@@ -0,0 +1,48 @@
+//===-- PNaClMCTargetDesc.cpp - PNaCl Target Descriptions -------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides PNaCl specific target descriptions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "PNaClMCTargetDesc.h"
+#include "PNaClMCAsmInfo.h"
+#include "llvm/MC/MCCodeGenInfo.h"
+#include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/Support/TargetRegistry.h"
+
+using namespace llvm;
+
+static MCSubtargetInfo *createPNaClMCSubtargetInfo(StringRef TT, StringRef CPU,
+ StringRef FS) {
+ return new MCSubtargetInfo();
+}
+
+static MCCodeGenInfo *createPNaClMCCodeGenInfo(StringRef TT, Reloc::Model RM,
+ CodeModel::Model CM) {
+ MCCodeGenInfo *X = new MCCodeGenInfo();
+ X->InitMCCodeGenInfo(Reloc::PIC_, CM);
+ return X;
+}
+
+// Force static initialization.
+extern "C" void LLVMInitializePNaClTargetMC() {
+ // Register the MC asm info.
+ RegisterMCAsmInfo<PNaClMCAsmInfo> X(ThePNaClTarget);
+
+ // Register the MC codegen info.
+ TargetRegistry::RegisterMCCodeGenInfo(ThePNaClTarget,
+ createPNaClMCCodeGenInfo);
+
+ // Register the MC subtarget info.
+ TargetRegistry::RegisterMCSubtargetInfo(ThePNaClTarget,
+ createPNaClMCSubtargetInfo);
+}
« no previous file with comments | « lib/Target/PNaCl/MCTargetDesc/PNaClMCTargetDesc.h ('k') | lib/Target/PNaCl/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698