Chris Lattner | 9e493cf | 2006-03-03 02:32:46 +0000 | [diff] [blame^] | 1 | //===- CodeGenIntrinsic.h - Intrinsic Class Wrapper ------------*- C++ -*--===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 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. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines a wrapper class for the 'Intrinsic' TableGen class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef CODEGEN_INTRINSIC_H |
| 15 | #define CODEGEN_INTRINSIC_H |
| 16 | |
| 17 | #include <string> |
| 18 | #include <vector> |
| 19 | |
| 20 | namespace llvm { |
| 21 | class Record; |
| 22 | class RecordKeeper; |
| 23 | |
| 24 | struct CodeGenIntrinsic { |
| 25 | Record *TheDef; // The actual record defining this instruction. |
| 26 | std::string Name; // The name of the LLVM function "llvm.bswap.i32" |
| 27 | std::string EnumName; // The name of the enum "bswap_i32" |
| 28 | |
| 29 | // Memory mod/ref behavior of this intrinsic. |
| 30 | enum { |
| 31 | NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem |
| 32 | } ModRef; |
| 33 | |
| 34 | CodeGenIntrinsic(Record *R); |
| 35 | }; |
| 36 | |
| 37 | /// LoadIntrinsics - Read all of the intrinsics defined in the specified |
| 38 | /// .td file. |
| 39 | std::vector<CodeGenIntrinsic> LoadIntrinsics(const RecordKeeper &RC); |
| 40 | } |
| 41 | |
| 42 | #endif |