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"
30 /// getValueType - Return the MVT::ValueType that the specified TableGen record
32 MVT::ValueType getValueType(Record *Rec);
34 std::ostream &operator<<(std::ostream &OS, MVT::ValueType T);
35 std::string getName(MVT::ValueType T);
36 std::string getEnumName(MVT::ValueType T);
39 /// CodeGenTarget - This class corresponds to the Target class in the .td files.
43 std::vector<Record*> CalleeSavedRegisters;
44 MVT::ValueType PointerType;
49 Record *getTargetRecord() const { return TargetRec; }
50 const std::string &getName() const;
52 const std::vector<Record*> &getCalleeSavedRegisters() const {
53 return CalleeSavedRegisters;
56 MVT::ValueType getPointerType() const { return PointerType; }
58 // getInstructionSet - Return the InstructionSet object...
59 Record *getInstructionSet() const;
61 // getInstructionSet - Return the CodeGenInstructionSet object for this
62 // target, lazily reading it from the record keeper as needed.
63 // CodeGenInstructionSet *getInstructionSet -
66 } // End llvm namespace