summaryrefslogtreecommitdiff
path: root/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp
blob: 1e4db94ef0d359bdf32b3d849e821177faa6d604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//===-- AlphaTargetInfo.cpp - Alpha Target Implementation -----------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "Alpha.h"
#include "llvm/Module.h"
#include "llvm/Target/TargetRegistry.h"
using namespace llvm;

llvm::Target llvm::TheAlphaTarget;

static unsigned Alpha_TripleMatchQuality(const std::string &TT) {
  // We strongly match "alpha*".
  if (TT.size() >= 5 && TT[0] == 'a' && TT[1] == 'l' && TT[2] == 'p' &&
      TT[3] == 'h' && TT[4] == 'a')
    return 20;

  return 0;
}

extern "C" void LLVMInitializeAlphaTargetInfo() { 
  TargetRegistry::RegisterTarget(TheAlphaTarget, "alpha",
                                  "Alpha [experimental]",
                                  &Alpha_TripleMatchQuality,
                                  /*HasJIT=*/true);
}