New feature: add support for target intrinsics being defined in the
[oota-llvm.git] / include / llvm / Target / TargetIntrinsicInfo.h
1 //===-- llvm/Target/TargetIntrinsicInfo.h - Instruction Info ----*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file describes the target intrinsic instructions to the code generator.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_TARGET_TARGETINTRINSICINFO_H
15 #define LLVM_TARGET_TARGETINTRINSICINFO_H
16
17 namespace llvm {
18
19 class Function;
20 class Module;
21
22 //---------------------------------------------------------------------------
23 ///
24 /// TargetIntrinsicInfo - Interface to description of machine instruction set
25 ///
26 class TargetIntrinsicInfo {
27   
28   const char **Intrinsics;               // Raw array to allow static init'n
29   unsigned NumIntrinsics;                // Number of entries in the desc array
30
31   TargetIntrinsicInfo(const TargetIntrinsicInfo &);  // DO NOT IMPLEMENT
32   void operator=(const TargetIntrinsicInfo &);   // DO NOT IMPLEMENT
33 public:
34   TargetIntrinsicInfo(const char **desc, unsigned num);
35   virtual ~TargetIntrinsicInfo();
36
37   unsigned getNumIntrinsics() const { return NumIntrinsics; }
38
39   virtual Function *getDeclaration(Module *M, const char *BuiltinName) const {
40     return 0;
41   }
42   
43   virtual unsigned getIntrinsicID(Function *F) const { return 0; }
44 };
45
46 } // End llvm namespace
47
48 #endif