2003-05-08 05:33:54 +02:00
|
|
|
//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
|
2005-04-21 22:19:05 +02:00
|
|
|
//
|
2003-10-20 22:19:47 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:19:05 +02:00
|
|
|
//
|
2003-10-20 22:19:47 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2003-05-08 05:33:54 +02: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 06:56:14 +02:00
|
|
|
#include <string>
|
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2007-04-01 09:26:35 +02:00
|
|
|
class Type;
|
2007-02-07 21:38:26 +01:00
|
|
|
class FunctionType;
|
|
|
|
class Function;
|
2009-08-11 19:45:13 +02:00
|
|
|
class LLVMContext;
|
2007-02-07 21:38:26 +01:00
|
|
|
class Module;
|
2008-09-25 23:00:45 +02:00
|
|
|
class AttrListPtr;
|
2007-02-07 21:38:26 +01:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
/// Intrinsic Namespace - This namespace contains an enum with a value for
|
2003-06-03 17:30:13 +02:00
|
|
|
/// every intrinsic/builtin function known by LLVM. These enum values are
|
|
|
|
/// returned by Function::getIntrinsicID().
|
|
|
|
///
|
2003-11-11 23:41:34 +01:00
|
|
|
namespace Intrinsic {
|
2003-05-08 05:33:54 +02:00
|
|
|
enum ID {
|
|
|
|
not_intrinsic = 0, // Must be zero
|
2003-05-18 00:26:33 +02:00
|
|
|
|
2006-03-09 21:03:31 +01: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 07:32:07 +01:00
|
|
|
, num_intrinsics
|
2003-05-08 05:33:54 +02:00
|
|
|
};
|
2006-03-25 07:32:07 +01:00
|
|
|
|
|
|
|
/// Intrinsic::getName(ID) - Return the LLVM name for an intrinsic, such as
|
|
|
|
/// "llvm.ppc.altivec.lvx".
|
2007-04-01 09:26:35 +02:00
|
|
|
std::string getName(ID id, const Type **Tys = 0, unsigned numTys = 0);
|
2007-02-07 21:38:26 +01:00
|
|
|
|
|
|
|
/// Intrinsic::getType(ID) - Return the function type for an intrinsic.
|
|
|
|
///
|
2009-07-08 01:43:39 +02:00
|
|
|
const FunctionType *getType(LLVMContext &Context, ID id,
|
|
|
|
const Type **Tys = 0, unsigned numTys = 0);
|
2007-02-07 21:38:26 +01:00
|
|
|
|
2009-02-25 00:17:49 +01:00
|
|
|
/// Intrinsic::isOverloaded(ID) - Returns true if the intrinsic can be
|
|
|
|
/// overloaded.
|
|
|
|
bool isOverloaded(ID id);
|
|
|
|
|
2008-09-25 23:00:45 +02:00
|
|
|
/// Intrinsic::getAttributes(ID) - Return the attributes for an intrinsic.
|
2007-12-03 21:06:50 +01:00
|
|
|
///
|
2008-09-25 23:00:45 +02:00
|
|
|
AttrListPtr getAttributes(ID id);
|
2007-12-03 21:06:50 +01:00
|
|
|
|
2007-02-07 21:38:26 +01:00
|
|
|
/// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
|
|
|
|
/// declaration for an intrinsic, and return it.
|
2008-02-20 02:07:51 +01:00
|
|
|
///
|
|
|
|
/// The Tys and numTys parameters are for intrinsics with overloaded types
|
2010-02-09 17:59:14 +01:00
|
|
|
/// (e.g., those using iAny, fAny, vAny, or iPTRAny). 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
|
2008-02-20 02:07:51 +01:00
|
|
|
/// intrinsic.
|
2007-04-01 09:26:35 +02:00
|
|
|
Function *getDeclaration(Module *M, ID id, const Type **Tys = 0,
|
|
|
|
unsigned numTys = 0);
|
2009-02-05 02:49:45 +01:00
|
|
|
|
|
|
|
/// Map a GCC builtin name to an intrinsic ID.
|
|
|
|
ID getIntrinsicForGCCBuiltin(const char *Prefix, const char *BuiltinName);
|
2007-02-07 21:38:26 +01:00
|
|
|
|
2003-11-11 23:41:34 +01:00
|
|
|
} // End Intrinsic namespace
|
|
|
|
|
|
|
|
} // End llvm namespace
|
2003-05-08 05:33:54 +02:00
|
|
|
|
|
|
|
#endif
|