mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-21 04:25:45 -04:00

Summary: Make it possible to feed runtime information back to tablegen to enable profile-guided tablegen-eration, detection of untested tablegen definitions, etc. Being a cross-compiler by nature, LLVM will potentially collect data for multiple architectures (e.g. when running 'ninja check'). We therefore need a way for TableGen to figure out what data applies to the backend it is generating at the time. This patch achieves that by including the name of the 'def X : Target ...' for the backend in the TargetRegistry. Reviewers: qcolombet Reviewed By: qcolombet Subscribers: jholewinski, arsenm, jyknight, aditya_nandakumar, sdardis, nemanjai, ab, nhaehnle, t.p.northover, javed.absar, qcolombet, llvm-commits, fedor.sergeev Differential Revision: https://reviews.llvm.org/D39742 llvm-svn: 318352
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
//===-- SparcTargetInfo.cpp - Sparc Target Implementation -----------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "Sparc.h"
|
|
#include "llvm/IR/Module.h"
|
|
#include "llvm/Support/TargetRegistry.h"
|
|
using namespace llvm;
|
|
|
|
Target &llvm::getTheSparcTarget() {
|
|
static Target TheSparcTarget;
|
|
return TheSparcTarget;
|
|
}
|
|
Target &llvm::getTheSparcV9Target() {
|
|
static Target TheSparcV9Target;
|
|
return TheSparcV9Target;
|
|
}
|
|
Target &llvm::getTheSparcelTarget() {
|
|
static Target TheSparcelTarget;
|
|
return TheSparcelTarget;
|
|
}
|
|
|
|
extern "C" void LLVMInitializeSparcTargetInfo() {
|
|
RegisterTarget<Triple::sparc, /*HasJIT=*/true> X(getTheSparcTarget(), "sparc",
|
|
"Sparc", "Sparc");
|
|
RegisterTarget<Triple::sparcv9, /*HasJIT=*/true> Y(
|
|
getTheSparcV9Target(), "sparcv9", "Sparc V9", "Sparc");
|
|
RegisterTarget<Triple::sparcel, /*HasJIT=*/true> Z(
|
|
getTheSparcelTarget(), "sparcel", "Sparc LE", "Sparc");
|
|
}
|