diff options
-rw-r--r-- | include/llvm/ConstantHandling.h | 8 | ||||
-rw-r--r-- | lib/VMCore/ConstantFold.h | 8 | ||||
-rw-r--r-- | lib/VMCore/ConstantFolding.h | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/include/llvm/ConstantHandling.h b/include/llvm/ConstantHandling.h index 9e9e760..72632ee 100644 --- a/include/llvm/ConstantHandling.h +++ b/include/llvm/ConstantHandling.h @@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1, // Implement higher level instruction folding type instructions //===----------------------------------------------------------------------===// -inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V, +inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V, const Type *DestTy) { return ConstRules::get(*V)->castTo(V, DestTy); } inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode, - ConstPoolVal *V) { + const ConstPoolVal *V) { switch (Opcode) { case Instruction::Not: return !*V; // TODO: Handle get element ptr instruction here in the future? GEP null? @@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode, } inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode, - ConstPoolVal *V1, - ConstPoolVal *V2) { + const ConstPoolVal *V1, + const ConstPoolVal *V2) { switch (Opcode) { case Instruction::Add: return *V1 + *V2; case Instruction::Sub: return *V1 - *V2; diff --git a/lib/VMCore/ConstantFold.h b/lib/VMCore/ConstantFold.h index 9e9e760..72632ee 100644 --- a/lib/VMCore/ConstantFold.h +++ b/lib/VMCore/ConstantFold.h @@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1, // Implement higher level instruction folding type instructions //===----------------------------------------------------------------------===// -inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V, +inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V, const Type *DestTy) { return ConstRules::get(*V)->castTo(V, DestTy); } inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode, - ConstPoolVal *V) { + const ConstPoolVal *V) { switch (Opcode) { case Instruction::Not: return !*V; // TODO: Handle get element ptr instruction here in the future? GEP null? @@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode, } inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode, - ConstPoolVal *V1, - ConstPoolVal *V2) { + const ConstPoolVal *V1, + const ConstPoolVal *V2) { switch (Opcode) { case Instruction::Add: return *V1 + *V2; case Instruction::Sub: return *V1 - *V2; diff --git a/lib/VMCore/ConstantFolding.h b/lib/VMCore/ConstantFolding.h index 9e9e760..72632ee 100644 --- a/lib/VMCore/ConstantFolding.h +++ b/lib/VMCore/ConstantFolding.h @@ -179,13 +179,13 @@ inline ConstPoolBool *operator<=(const ConstPoolVal &V1, // Implement higher level instruction folding type instructions //===----------------------------------------------------------------------===// -inline ConstPoolVal *ConstantFoldCastInstruction(ConstPoolVal *V, +inline ConstPoolVal *ConstantFoldCastInstruction(const ConstPoolVal *V, const Type *DestTy) { return ConstRules::get(*V)->castTo(V, DestTy); } inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode, - ConstPoolVal *V) { + const ConstPoolVal *V) { switch (Opcode) { case Instruction::Not: return !*V; // TODO: Handle get element ptr instruction here in the future? GEP null? @@ -194,8 +194,8 @@ inline ConstPoolVal *ConstantFoldUnaryInstruction(unsigned Opcode, } inline ConstPoolVal *ConstantFoldBinaryInstruction(unsigned Opcode, - ConstPoolVal *V1, - ConstPoolVal *V2) { + const ConstPoolVal *V1, + const ConstPoolVal *V2) { switch (Opcode) { case Instruction::Add: return *V1 + *V2; case Instruction::Sub: return *V1 - *V2; |