2003-05-08 03:33:54 +00:00
|
|
|
//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
|
2005-04-21 20:19:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 20:19:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-05-08 03:33:54 +00:00
|
|
|
//
|
|
|
|
// This file defines a set of enums which allow processing of intrinsic
|
|
|
|
// functions. Values of these enum types are returned by
|
|
|
|
// Function::getIntrinsicID.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_INTRINSICS_H
|
|
|
|
#define LLVM_INTRINSICS_H
|
|
|
|
|
2008-04-30 04:56:14 +00:00
|
|
|
#include <string>
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
2007-04-01 07:26:35 +00:00
|
|
|
class Type;
|
2007-02-07 20:38:26 +00:00
|
|
|
class FunctionType;
|
|
|
|
class Function;
|
|
|
|
class Module;
|
2008-09-25 21:00:45 +00:00
|
|
|
class AttrListPtr;
|
2007-02-07 20:38:26 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
/// Intrinsic Namespace - This namespace contains an enum with a value for
|
2003-06-03 15:30:13 +00:00
|
|
|
/// every intrinsic/builtin function known by LLVM. These enum values are
|
|
|
|
/// returned by Function::getIntrinsicID().
|
|
|
|
///
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace Intrinsic {
|
2003-05-08 03:33:54 +00:00
|
|
|
enum ID {
|
|
|
|
not_intrinsic = 0, // Must be zero
|
2003-05-17 22:26:33 +00:00
|
|
|
|
2006-03-09 20:03:31 +00:00
|
|
|
// Get the intrinsic enums generated from Intrinsics.td
|
|
|
|
#define GET_INTRINSIC_ENUM_VALUES
|
|
|
|
#include "llvm/Intrinsics.gen"
|
|
|
|
#undef GET_INTRINSIC_ENUM_VALUES
|
2006-03-25 06:32:07 +00:00
|
|
|
, num_intrinsics
|
2003-05-08 03:33:54 +00:00
|
|
|
};
|
2006-03-25 06:32:07 +00:00
|
|
|
|
|
|
|
/// Intrinsic::getName(ID) - Return the LLVM name for an intrinsic, such as
|
|
|
|
/// "llvm.ppc.altivec.lvx".
|
2007-04-01 07:26:35 +00:00
|
|
|
std::string getName(ID id, const Type **Tys = 0, unsigned numTys = 0);
|
2007-02-07 20:38:26 +00:00
|
|
|
|
|
|
|
/// Intrinsic::getType(ID) - Return the function type for an intrinsic.
|
|
|
|
///
|
2007-04-01 07:26:35 +00:00
|
|
|
const FunctionType *getType(ID id, const Type **Tys = 0, unsigned numTys = 0);
|
2007-02-07 20:38:26 +00:00
|
|
|
|
2008-09-25 21:00:45 +00:00
|
|
|
/// Intrinsic::getAttributes(ID) - Return the attributes for an intrinsic.
|
2007-12-03 20:06:50 +00:00
|
|
|
///
|
2008-09-25 21:00:45 +00:00
|
|
|
AttrListPtr getAttributes(ID id);
|
2007-12-03 20:06:50 +00:00
|
|
|
|
2007-02-07 20:38:26 +00:00
|
|
|
/// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
|
|
|
|
/// declaration for an intrinsic, and return it.
|
2008-02-20 01:07:51 +00:00
|
|
|
///
|
|
|
|
/// The Tys and numTys parameters are for intrinsics with overloaded types
|
|
|
|
/// (i.e., those using iAny or fAny). For a declaration for an overloaded
|
|
|
|
/// intrinsic, Tys should point to an array of numTys pointers to Type,
|
|
|
|
/// and must provide exactly one type for each overloaded type in the
|
|
|
|
/// intrinsic.
|
2007-04-01 07:26:35 +00:00
|
|
|
Function *getDeclaration(Module *M, ID id, const Type **Tys = 0,
|
|
|
|
unsigned numTys = 0);
|
2007-02-07 20:38:26 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End Intrinsic namespace
|
|
|
|
|
|
|
|
} // End llvm namespace
|
2003-05-08 03:33:54 +00:00
|
|
|
|
|
|
|
#endif
|