2004-06-20 09:40:46 +02:00
|
|
|
//===-- IntrinsicLowering.h - Intrinsic Function Lowering -------*- C++ -*-===//
|
2005-04-21 22:39:54 +02:00
|
|
|
//
|
2004-06-20 09:40:46 +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:39:54 +02:00
|
|
|
//
|
2004-06-20 09:40:46 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 22:39:54 +02:00
|
|
|
//
|
2004-06-20 09:40:46 +02: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 19:00:10 +01:00
|
|
|
// having to modify all of the C backend or interpreter.
|
2004-06-20 09:40:46 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
|
|
|
|
#define LLVM_CODEGEN_INTRINSICLOWERING_H
|
|
|
|
|
|
|
|
#include "llvm/Intrinsics.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class CallInst;
|
|
|
|
class Module;
|
2007-01-29 18:39:50 +01:00
|
|
|
class TargetData;
|
2005-04-21 22:39:54 +02:00
|
|
|
|
2004-09-28 03:59:17 +02:00
|
|
|
class IntrinsicLowering {
|
2007-01-29 18:39:50 +01:00
|
|
|
const TargetData& TD;
|
2009-06-26 22:33:47 +02:00
|
|
|
|
2009-06-25 02:04:15 +02:00
|
|
|
|
|
|
|
bool Warned;
|
2004-09-28 03:59:17 +02:00
|
|
|
public:
|
2009-06-25 02:04:15 +02:00
|
|
|
explicit IntrinsicLowering(const TargetData &td) :
|
2009-06-26 22:33:47 +02:00
|
|
|
TD(td), Warned(false) {}
|
2004-06-20 09:40:46 +02: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 19:00:10 +01:00
|
|
|
void AddPrototypes(Module &M);
|
2004-06-20 09:40:46 +02:00
|
|
|
|
2007-01-28 23:26:42 +01: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.
|
2004-06-20 09:40:46 +02: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 19:00:10 +01:00
|
|
|
void LowerIntrinsicCall(CallInst *CI);
|
2004-06-20 09:40:46 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|