summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFolding.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/ConstantFolding.h')
-rw-r--r--lib/VMCore/ConstantFolding.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/ConstantFolding.h b/lib/VMCore/ConstantFolding.h
index 9ce1b2c..d3af1bd 100644
--- a/lib/VMCore/ConstantFolding.h
+++ b/lib/VMCore/ConstantFolding.h
@@ -175,10 +175,16 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1,
// Implement higher level instruction folding type instructions
//===----------------------------------------------------------------------===//
+inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V,
+ const Type *DestTy) {
+ return ConstRules::get(*V)->castTo(V, DestTy);
+}
+
inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode,
ConstPoolVal *V) {
switch (Opcode) {
case Instruction::Not: return !*V;
+ // TODO: Handle get element ptr instruction here in the future? GEP null?
}
return 0;
}