mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Make this a *real* header:
1. Remove using namespace llvm; 2. Remove unneeded #includes. 3. Add #include guard. Also add prototypes for new code moved from transformutils to libanalysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33682 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -12,12 +12,42 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Constants.h"
|
#ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H
|
||||||
#include "llvm/Function.h"
|
#define LLVM_ANALYSIS_CONSTANTFOLDING_H
|
||||||
using namespace llvm;
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
class Constant;
|
||||||
|
class ConstantExpr;
|
||||||
|
class Instruction;
|
||||||
|
class TargetData;
|
||||||
|
class Function;
|
||||||
|
|
||||||
|
/// ConstantFoldInstruction - Attempt to constant fold the specified
|
||||||
|
/// instruction. If successful, the constant result is returned, if not, null
|
||||||
|
/// is returned. Note that this function can only fail when attempting to fold
|
||||||
|
/// instructions like loads and stores, which have no constant expression form.
|
||||||
|
///
|
||||||
|
Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0);
|
||||||
|
|
||||||
|
/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
|
||||||
|
/// specified operands. If successful, the constant result is returned, if not,
|
||||||
|
/// null is returned. Note that this function can fail when attempting to
|
||||||
|
/// fold instructions like loads and stores, which have no constant expression
|
||||||
|
/// form.
|
||||||
|
///
|
||||||
|
Constant *ConstantFoldInstOperands(
|
||||||
|
const Instruction *I, ///< The model instruction
|
||||||
|
Constant** Ops, ///< The array of constant operands to use.
|
||||||
|
unsigned NumOps, ///< The number of operands provided.
|
||||||
|
const TargetData *TD = 0 ///< Optional target information.
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
|
||||||
|
/// getelementptr constantexpr, return the constant value being addressed by the
|
||||||
|
/// constant expression, or null if something is funny and we can't decide.
|
||||||
|
Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
|
||||||
|
|
||||||
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
||||||
/// the specified function.
|
/// the specified function.
|
||||||
bool canConstantFoldCallTo(Function *F);
|
bool canConstantFoldCallTo(Function *F);
|
||||||
@ -28,3 +58,4 @@ Constant *
|
|||||||
ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands);
|
ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user