[PATCH] D70113: Mark llvm::ConstantExpr::getAsInstruction as const

Alex Denisov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 05:27:13 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5022a5fcaef9: Mark llvm::ConstantExpr::getAsInstruction as const (authored by AlexDenisov).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70113/new/

https://reviews.llvm.org/D70113

Files:
  llvm/include/llvm/IR/Constants.h
  llvm/lib/IR/Constants.cpp


Index: llvm/lib/IR/Constants.cpp
===================================================================
--- llvm/lib/IR/Constants.cpp
+++ llvm/lib/IR/Constants.cpp
@@ -3004,7 +3004,7 @@
       NewOps, this, From, To, NumUpdated, OperandNo);
 }
 
-Instruction *ConstantExpr::getAsInstruction() {
+Instruction *ConstantExpr::getAsInstruction() const {
   SmallVector<Value *, 4> ValueOperands(op_begin(), op_end());
   ArrayRef<Value*> Ops(ValueOperands);
 
Index: llvm/include/llvm/IR/Constants.h
===================================================================
--- llvm/include/llvm/IR/Constants.h
+++ llvm/include/llvm/IR/Constants.h
@@ -1250,7 +1250,7 @@
   /// which would take a ConstantExpr parameter, but that would have spread
   /// implementation details of ConstantExpr outside of Constants.cpp, which
   /// would make it harder to remove ConstantExprs altogether.
-  Instruction *getAsInstruction();
+  Instruction *getAsInstruction() const;
 
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const Value *V) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70113.228877.patch
Type: text/x-patch
Size: 1070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191112/e62a5d9a/attachment.bin>


More information about the llvm-commits mailing list