#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/InstIterator.h"
#include "SVF-LLVM/BasicTypes.h"
#include "SVF-LLVM/BreakConstantExpr.h"
#include "Util/GeneralType.h"
#include "Util/SVFUtil.h"
#include <iostream>
#include <map>
#include <utility>
Go to the source code of this file.
◆ DEBUG_TYPE
| #define DEBUG_TYPE "break-constgeps" |
◆ convertExpression()
Definition at line 164 of file BreakConstantExpr.cpp.
165{
166
167
168
169 if (CE->getOpcode() == Instruction::GetElementPtr)
170 ++GEPChanges;
171 ++TotalChanges;
173 Result->insertBefore(InsertPt->getIterator());
174 return Result;
175}
llvm::Instruction Instruction
◆ hasConstantBinaryOrUnaryOp()
Definition at line 114 of file BreakConstantExpr.cpp.
115{
117 {
118 if (Instruction::isBinaryOp(CE->getOpcode()) || Instruction::isUnaryOp(CE->getOpcode()))
119 {
120 return CE;
121 }
122 else
123 {
125 {
127 return CE;
128 }
129 }
130 }
131
132 return nullptr;
133}
static ConstantExpr * hasConstantBinaryOrUnaryOp(Value *V)
LLVM_NODISCARD std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > dyn_cast(const Y &Val)
llvm::ConstantExpr ConstantExpr
◆ hasConstantExpr()
Definition at line 138 of file BreakConstantExpr.cpp.
139{
141 {
142 return gep;
143 }
145 {
146 return buop;
147 }
148 else
149 {
150 return nullptr;
151 }
152}
static ConstantExpr * hasConstantGEP(Value *V)
◆ hasConstantGEP()
Definition at line 89 of file BreakConstantExpr.cpp.
90{
92 {
93 if (CE->getOpcode() == Instruction::GetElementPtr)
94 {
95 return CE;
96 }
97 else
98 {
100 {
102 return CE;
103 }
104 }
105 }
106
107 return nullptr;
108}
◆ STATISTIC() [1/2]
| STATISTIC |
( |
GEPChanges | , |
|
|
"Number of Converted GEP Constant Expressions" | ) |
◆ STATISTIC() [2/2]
| STATISTIC |
( |
TotalChanges | , |
|
|
"Number of Converted Constant Expressions" | ) |