1 //===- CodeGenWrappers.h - Code Generation Class Wrappers -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // These classes wrap target description classes used by the various code
11 // generation TableGen backends. This makes it easier to access the data and
12 // provides a single place that needs to check it for validity. All of these
13 // classes throw exceptions on error conditions.
15 //===----------------------------------------------------------------------===//
17 #ifndef CODEGENWRAPPERS_H
18 #define CODEGENWRAPPERS_H
20 #include "llvm/CodeGen/ValueTypes.h"
27 /// getValueType - Return the MVT::ValueType that the specified TableGen record
29 MVT::ValueType getValueType(Record *Rec);
31 std::ostream &operator<<(std::ostream &OS, MVT::ValueType T);
32 std::string getName(MVT::ValueType T);
33 std::string getEnumName(MVT::ValueType T);
36 /// CodeGenTarget - This class corresponds to the Target class in the .td files.
40 std::vector<Record*> CalleeSavedRegisters;
41 MVT::ValueType PointerType;
46 Record *getTargetRecord() const { return TargetRec; }
47 const std::string &getName() const;
49 const std::vector<Record*> &getCalleeSavedRegisters() const {
50 return CalleeSavedRegisters;
53 MVT::ValueType getPointerType() const { return PointerType; }
55 // getInstructionSet - Return the InstructionSet object...
56 Record *getInstructionSet() const;
58 // getInstructionSet - Return the CodeGenInstructionSet object for this
59 // target, lazily reading it from the record keeper as needed.
60 // CodeGenInstructionSet *getInstructionSet -