LLVM API Documentation

TargetIntrinsicInfo.h

Go to the documentation of this file.
00001 //===-- llvm/Target/TargetIntrinsicInfo.h - Instruction Info ----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file describes the target intrinsic instructions to the code generator.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_TARGET_TARGETINTRINSICINFO_H
00015 #define LLVM_TARGET_TARGETINTRINSICINFO_H
00016 
00017 namespace llvm {
00018 
00019 class Function;
00020 class Module;
00021 class Type;
00022 
00023 //---------------------------------------------------------------------------
00024 ///
00025 /// TargetIntrinsicInfo - Interface to description of machine instruction set
00026 ///
00027 class TargetIntrinsicInfo {
00028   
00029   const char **Intrinsics;               // Raw array to allow static init'n
00030   unsigned NumIntrinsics;                // Number of entries in the desc array
00031 
00032   TargetIntrinsicInfo(const TargetIntrinsicInfo &);  // DO NOT IMPLEMENT
00033   void operator=(const TargetIntrinsicInfo &);   // DO NOT IMPLEMENT
00034 public:
00035   TargetIntrinsicInfo(const char **desc, unsigned num);
00036   virtual ~TargetIntrinsicInfo();
00037 
00038   unsigned getNumIntrinsics() const { return NumIntrinsics; }
00039 
00040   virtual Function *getDeclaration(Module *M, const char *BuiltinName) const {
00041     return 0;
00042   }
00043 
00044   // Returns the Function declaration for intrinsic BuiltinName.  If the
00045   // intrinsic can be overloaded, uses Tys to return the correct function.
00046   virtual Function *getDeclaration(Module *M, const char *BuiltinName,
00047                                    const Type **Tys, unsigned numTys) const {
00048     return 0;
00049   }
00050 
00051   // Returns true if the Builtin can be overloaded.
00052   virtual bool isOverloaded(Module *M, const char *BuiltinName) const {
00053     return false;
00054   }
00055 
00056   virtual unsigned getIntrinsicID(Function *F) const { return 0; }
00057 };
00058 
00059 } // End llvm namespace
00060 
00061 #endif