blob: 5fcff927a70ef06be4000e1efa5d61e3dcff8187 [file] [log] [blame]
Chris Lattner9e493cf2006-03-03 02:32:46 +00001//===- CodeGenIntrinsic.h - Intrinsic Class Wrapper ------------*- C++ -*--===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerb672d982006-03-03 06:13:41 +00005// This file was developed by Chris Lattner and is distributed under
Chris Lattner9e493cf2006-03-03 02:32:46 +00006// 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
20namespace 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"
Chris Lattner022f64f2006-03-13 23:08:44 +000028 std::string GCCBuiltinName;// Name of the corresponding GCC builtin, or "".
Chris Lattner3f8b8912006-03-15 01:33:26 +000029 std::string TargetPrefix; // Target prefix, e.g. "ppc" for t-s intrinsics.
Chris Lattner022f64f2006-03-13 23:08:44 +000030
Chris Lattnerf97a00e2006-03-09 22:05:04 +000031 /// ArgTypes - The type primitive enum value for the return value and all
32 /// of the arguments. These are things like Type::UIntTyID.
33 std::vector<std::string> ArgTypes;
34
Chris Lattner18faf5d2006-03-13 22:38:57 +000035 /// ArgTypeDefs - The records for each argument type.
36 ///
37 std::vector<Record*> ArgTypeDefs;
38
Chris Lattner9e493cf2006-03-03 02:32:46 +000039 // Memory mod/ref behavior of this intrinsic.
40 enum {
41 NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem
42 } ModRef;
43
44 CodeGenIntrinsic(Record *R);
45 };
46
47 /// LoadIntrinsics - Read all of the intrinsics defined in the specified
48 /// .td file.
49 std::vector<CodeGenIntrinsic> LoadIntrinsics(const RecordKeeper &RC);
50}
51
52#endif