Value *CreateFNeg(Constant *C) const override {
return ConstFolder.CreateFNeg(C);
}
- Value *CreateNot(Constant *C) const override {
- return ConstFolder.CreateNot(C);
- }
Value *CreateUnOp(Instruction::UnaryOps Opc, Constant *C) const override {
return ConstFolder.CreateUnOp(Opc, C);
Constant *CreateFNeg(Constant *C) const override {
return Fold(ConstantExpr::getFNeg(C));
}
- Constant *CreateNot(Constant *C) const override {
- return Fold(ConstantExpr::getNot(C));
- }
Constant *CreateUnOp(Instruction::UnaryOps Opc, Constant *C) const override {
return Fold(ConstantExpr::get(Opc, C));
return ConstantExpr::getFNeg(C);
}
- Constant *CreateNot(Constant *C) const override {
- return ConstantExpr::getNot(C);
- }
-
Constant *CreateUnOp(Instruction::UnaryOps Opc, Constant *C) const override {
return ConstantExpr::get(Opc, C);
}
}
Value *CreateNot(Value *V, const Twine &Name = "") {
- if (auto *VC = dyn_cast<Constant>(V))
- return Insert(Folder.CreateNot(VC), Name);
- return Insert(BinaryOperator::CreateNot(V), Name);
+ return CreateXor(V, Constant::getAllOnesValue(V->getType()), Name);
}
Value *CreateUnOp(Instruction::UnaryOps Opc,
virtual Value *CreateNeg(Constant *C,
bool HasNUW = false, bool HasNSW = false) const = 0;
virtual Value *CreateFNeg(Constant *C) const = 0;
- virtual Value *CreateNot(Constant *C) const = 0;
virtual Value *CreateUnOp(Instruction::UnaryOps Opc, Constant *C) const = 0;
//===--------------------------------------------------------------------===//
return UnaryOperator::CreateFNeg(C);
}
- Instruction *CreateNot(Constant *C) const override {
- return BinaryOperator::CreateNot(C);
- }
-
Instruction *CreateUnOp(Instruction::UnaryOps Opc,
Constant *C) const override {
return UnaryOperator::Create(Opc, C);