blob: 25b66715c94cd1083fc344022c3c0d6914d6ff13 [file] [log] [blame]
Clement Courbet44b4c542018-06-19 11:28:59 +00001//===-- Target.h ------------------------------------------------*- C++ -*-===//
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/// \file
11///
12/// Classes that handle the creation of target-specific objects. This is
13/// similar to llvm::Target/TargetRegistry.
14///
15//===----------------------------------------------------------------------===//
16
17#ifndef LLVM_TOOLS_LLVM_EXEGESIS_TARGET_H
18#define LLVM_TOOLS_LLVM_EXEGESIS_TARGET_H
19
20#include "llvm/ADT/Triple.h"
21
22namespace exegesis {
23
24class ExegesisTarget {
25public:
26 // Returns the ExegesisTarget for the given triple or nullptr if the target
27 // does not exist.
28 static const ExegesisTarget* lookup(llvm::StringRef TT);
29 // Registers a target. Not thread safe.
30 static void registerTarget(ExegesisTarget *T);
31
Roman Lebedev3de96642018-06-19 11:58:10 +000032 virtual ~ExegesisTarget();
Clement Courbet44b4c542018-06-19 11:28:59 +000033
34private:
35 virtual bool matchesArch(llvm::Triple::ArchType Arch) const = 0;
36 const ExegesisTarget* Next = nullptr;
37};
38
39} // namespace exegesis
40
41#endif // LLVM_TOOLS_LLVM_EXEGESIS_TARGET_H