1 //===- CodeGenIntrinsic.h - Intrinsic Class Wrapper ------------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Chris Lattner and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines a wrapper class for the 'Intrinsic' TableGen class.
12 //===----------------------------------------------------------------------===//
14 #ifndef CODEGEN_INTRINSIC_H
15 #define CODEGEN_INTRINSIC_H
19 #include "llvm/CodeGen/ValueTypes.h"
25 struct CodeGenIntrinsic {
26 Record *TheDef; // The actual record defining this instruction.
27 std::string Name; // The name of the LLVM function "llvm.bswap.i32"
28 std::string EnumName; // The name of the enum "bswap_i32"
29 std::string GCCBuiltinName;// Name of the corresponding GCC builtin, or "".
30 std::string TargetPrefix; // Target prefix, e.g. "ppc" for t-s intrinsics.
32 /// ArgTypes - The type primitive enum value for the return value and all
33 /// of the arguments. These are things like Type::UIntTyID.
34 std::vector<std::string> ArgTypes;
36 /// ArgVTs - The MVT::ValueType for each argument type.
37 std::vector<MVT::ValueType> ArgVTs;
39 /// ArgTypeDefs - The records for each argument type.
41 std::vector<Record*> ArgTypeDefs;
43 // Memory mod/ref behavior of this intrinsic.
45 NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem
48 CodeGenIntrinsic(Record *R);
51 /// LoadIntrinsics - Read all of the intrinsics defined in the specified
53 std::vector<CodeGenIntrinsic> LoadIntrinsics(const RecordKeeper &RC);