2004-06-20 07:40:46 +00:00
|
|
|
//===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- C++ -*-===//
|
2005-04-21 20:39:54 +00:00
|
|
|
//
|
2003-12-28 08:19:13 +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:39:54 +00:00
|
|
|
//
|
2003-12-28 08:19:13 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 20:39:54 +00:00
|
|
|
//
|
2003-12-28 08:19:13 +00:00
|
|
|
// This file defines the IntrinsicLowering interface. This interface allows
|
|
|
|
// addition of domain-specific or front-end specific intrinsics to LLVM without
|
2006-11-15 18:00:10 +00:00
|
|
|
// having to modify all of the C backend or interpreter.
|
2003-12-28 08:19:13 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-06-20 07:40:46 +00:00
|
|
|
#ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
|
|
|
|
#define LLVM_CODEGEN_INTRINSICLOWERING_H
|
2003-12-28 08:19:13 +00:00
|
|
|
|
2003-12-28 21:23:38 +00:00
|
|
|
#include "llvm/Intrinsics.h"
|
|
|
|
|
2003-12-28 08:19:13 +00:00
|
|
|
namespace llvm {
|
|
|
|
class CallInst;
|
2004-05-09 04:29:49 +00:00
|
|
|
class Module;
|
2007-01-29 17:39:50 +00:00
|
|
|
class TargetData;
|
2005-04-21 20:39:54 +00:00
|
|
|
|
2004-09-28 01:59:17 +00:00
|
|
|
class IntrinsicLowering {
|
2007-01-29 17:39:50 +00:00
|
|
|
const TargetData& TD;
|
2004-09-28 01:59:17 +00:00
|
|
|
public:
|
2007-07-05 20:40:15 +00:00
|
|
|
explicit IntrinsicLowering(const TargetData &td) : TD(td) {}
|
2003-12-28 08:19:13 +00:00
|
|
|
|
2004-05-09 04:29:49 +00:00
|
|
|
/// AddPrototypes - This method, if called, causes all of the prototypes
|
|
|
|
/// that might be needed by an intrinsic lowering implementation to be
|
|
|
|
/// inserted into the module specified.
|
2006-11-15 18:00:10 +00:00
|
|
|
void AddPrototypes(Module &M);
|
2004-05-09 04:29:49 +00:00
|
|
|
|
2007-01-28 22:26:42 +00:00
|
|
|
/// LowerIntrinsicCall - This method replaces a call with the LLVM function
|
|
|
|
/// which should be used to implement the specified intrinsic function call.
|
|
|
|
/// If an intrinsic function must be implemented by the code generator
|
|
|
|
/// (such as va_start), this function should print a message and abort.
|
2003-12-28 08:19:13 +00:00
|
|
|
///
|
|
|
|
/// Otherwise, if an intrinsic function call can be lowered, the code to
|
|
|
|
/// implement it (often a call to a non-intrinsic function) is inserted
|
|
|
|
/// _after_ the call instruction and the call is deleted. The caller must
|
|
|
|
/// be capable of handling this kind of change.
|
|
|
|
///
|
2006-11-15 18:00:10 +00:00
|
|
|
void LowerIntrinsicCall(CallInst *CI);
|
2003-12-28 08:19:13 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|